-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Refactor lazy imports to avoid accidental eager imports #13296
Conversation
✅ Deploy Preview for prefect-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Tests are currently failing due to an upstream change in the apprise library that we're working to fix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super interesting, what mechanism caused the additional imports to happen?
@chrisguidry I haven't had time to dig into this yet, but it was |
The problem was that using |
This work is part of our effort to speed up CLI commands. The
lazy_import
function inadvertently imported more things when you called it, particularly a bunch of Docker and Kubernetes packages. The problem was the function's call toinspect.stack()
, which was only necessary to produce a detailed error message. I tightened the error message to remove the need to callinspect.stack()
.Example
Checklist
<link to issue>
"maintenance
,fix
,feature
,enhancement
,docs
.For documentation changes:
netlify.toml
for files that are removed or renamed.For new functions or classes in the Python SDK:
mkdocs.yml
navigation.