-
Notifications
You must be signed in to change notification settings - Fork 300
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
Plugins lazy module loading #2049
Conversation
Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2049 +/- ##
==========================================
+ Coverage 83.18% 85.98% +2.79%
==========================================
Files 173 308 +135
Lines 16840 22940 +6100
Branches 3471 3468 -3
==========================================
+ Hits 14009 19725 +5716
- Misses 2236 2615 +379
- Partials 595 600 +5 ☔ View full report in Codecov by Sentry. |
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.
I had heard stories about lazy importing breaking some workflows. For example in flytekit
: flyteorg/flyte#3853 .
Overall, I am okay with making plugin imports lazy. Moving forward, how do we make sure plugins always lazy import dependencies? I suspect the monodocs will fail with an "can not import ___" error, which does not directly connect to the solution of lazy loading.
I also fixed that in this PR |
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.
LGTM, I also tested the airflow plugin, and it works well for me.
Short of catching this in a review (or monodocs build thing), not sure how we can handle this. Edit: I guess we can also add a plugin unit test in CI:
|
Created this issue @thomasjpfan: we can discuss the plugin convention issue there - flyteorg/flyte#4619 |
Tracking issue
Fixes flyteorg/flyte#4401
Why are the changes needed?
This change is primarily to simplify the dependencies needed for things like generating API reference documentation for flytekit. Before one needed all dependencies of all plugins to render API docs.
What changes were proposed in this pull request?
Use
flytekit.lazy_module
to lazily load modules in the plugin packages.How was this patch tested?
Run tests locally with pytest