-
Notifications
You must be signed in to change notification settings - Fork 16.4k
[AIRFLOW-6001] Lazy load CLI commands #6594
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
Conversation
1c2072f to
911910e
Compare
Codecov Report
@@ Coverage Diff @@
## master #6594 +/- ##
==========================================
- Coverage 83.69% 83.46% -0.23%
==========================================
Files 650 669 +19
Lines 37427 37560 +133
==========================================
+ Hits 31325 31350 +25
- Misses 6102 6210 +108
Continue to review full report at Codecov.
|
turbaszek
left a comment
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 think it looks good but it's a big change. I like the approach, one thing I suggest is changing stuff_command.py to stuff_commands.py because often there are multiple commands in one file.
|
@nuclearpinguin Sometimes there is one command and sometimes there are several commands. It depends if it is a single command or a subcommand. Subcommend is a command that lets you invoke other commands, but it is still a command, although it groups other commands, so I'd rather stay with the current prefix. This is a big change, but unfortunately it is very difficult to divide it into several PRs, because there will be a lot of conflicts in imports.I divided it very carefully into several commits so that everyone can do a review. |
potiuk
left a comment
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 think it is indeed worth merging it fast. This is mainly restructuring/refactoring and moving code around and I think @mik-laj has done a reasonable job of splitting it into separate moves. I looked through it and I see that those changes make perfect sense for the future CLI changes and it's worth to take one-time pain of splitting this all up. But since it is such a huge change - maybe others @ashb @kaxil @KevinYang21 @Fokko @feluelle ? (and others) can take a look and see if they have no problem with merging such a big change.
|
@mik-laj Did you reverse before and after in your PR description? |
|
@ashb yes. Fixed. |
ashb
left a comment
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.
Great idea!
Couple of small comments
621d460 to
e4b8da4
Compare
|
I rebased the rebased, took into account the comments. Can I do something else? |
|
Really like this change. Good work @mik-laj |
Currently, CLI loads all packages even when the command is not used in any way, which takes CPU time and memory. I suggest that only commands that are executed be loaded. This can speed up task launch time and also improve user productivity.
Quick benchmark:
Test:
Before;
After:
Now
airflow versioncommand executes 25% faster.Make sure you have checked all steps below.
Jira
Description
Tests
Commits
Documentation