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

Fix: Variables methods type-hinting #12278

Merged
merged 1 commit into from Mar 14, 2024
Merged

Conversation

aaazzam
Copy link
Contributor

@aaazzam aaazzam commented Mar 13, 2024

Fixes type-hinting in variable methods _get_variable_by_name and prefect.variables.get by removing @inject_client in favor of prefect.client.utilities.get_or_create_client introduced in #12258.

@aaazzam aaazzam requested a review from a team as a code owner March 13, 2024 16:07
Copy link

netlify bot commented Mar 13, 2024

Deploy Preview for prefect-docs-preview ready!

Name Link
🔨 Latest commit 32a17bd
🔍 Latest deploy log https://app.netlify.com/sites/prefect-docs-preview/deploys/65f1cf550db12e0009a2bc73
😎 Deploy Preview https://deploy-preview-12278--prefect-docs-preview.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 configuration.

Copy link
Collaborator

@chrisguidry chrisguidry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Curious why your new version of @inject_client didn't help?

@aaazzam
Copy link
Contributor Author

aaazzam commented Mar 14, 2024

@chrisguidry I couldn't get inject_client to correctly type hint. Might revisit if I'm feeling adventurous, so doing a more straightforward function utility to get it correct.

@chrisguidry
Copy link
Collaborator

FWIW I like your approach here better than the magic

@aaazzam aaazzam merged commit 1195715 into main Mar 14, 2024
45 checks passed
@aaazzam aaazzam deleted the type-hinting-variable-methods branch March 14, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants