Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes inject_client in scenarios where the client kwarg is passed None #6942

Merged
merged 2 commits into from
Sep 23, 2022

Conversation

desertaxle
Copy link
Member

@desertaxle desertaxle commented Sep 23, 2022

Example

Got a report of failures saving blocks from the Slack community. Blocks could be saved outside of flows, but not within flows. Root cause seems to be that inject_client was working when creating a new client, but not when retrieving an existing one for functions that had a default value of None due to setdefault behavior. This change pops client from kwargs in all scenarios to allow setdefault to do it's thing.

Closes #6940

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • This pull request includes tests or only affects documentation.
  • This pull request includes a label categorizing the change e.g. fix, feature, enhancement

@netlify
Copy link

netlify bot commented Sep 23, 2022

Deploy Preview for prefect-orion ready!

Name Link
🔨 Latest commit c649c3a
🔍 Latest deploy log https://app.netlify.com/sites/prefect-orion/deploys/632dcf85ecdd7d000982cb6b
😎 Deploy Preview https://deploy-preview-6942--prefect-orion.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@desertaxle desertaxle added the fix A fix for a bug in an existing feature label Sep 23, 2022
@desertaxle desertaxle marked this pull request as ready for review September 23, 2022 15:20
@desertaxle desertaxle changed the title Fixes inject client Fixes inject_client in scenarios where the client kwarg has a default value of None Sep 23, 2022
@desertaxle desertaxle changed the title Fixes inject_client in scenarios where the client kwarg has a default value of None Fixes inject_client in scenarios where the client kwarg has a default value of None Sep 23, 2022
@zanieb
Copy link
Contributor

zanieb commented Sep 23, 2022

I believe this is when None is passed, not when it is the default. **kwargs doesn't peek at the wrapped function to determine if there are default values here. Similar issue regardless.

@desertaxle desertaxle changed the title Fixes inject_client in scenarios where the client kwarg has a default value of None Fixes inject_client in scenarios where the client kwarg is passed None Sep 23, 2022
@zanieb zanieb merged commit 008157a into main Sep 23, 2022
@zanieb zanieb deleted the fix-block-save branch September 23, 2022 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix A fix for a bug in an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Saving to a string block causes a failure when run in an agent
2 participants