-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Introduce decorator to load providers configuration #32765
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
Merged
potiuk
merged 1 commit into
apache:main
from
potiuk:make-sure-providers-configuration-is-initialized
Jul 22, 2023
Merged
Introduce decorator to load providers configuration #32765
potiuk
merged 1 commit into
apache:main
from
potiuk:make-sure-providers-configuration-is-initialized
Jul 22, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
Author
|
Reopened with full tests. |
023cb69 to
8dc809c
Compare
adbd5be to
79857f5
Compare
A number of commands in Airflow relies on the fact that providers configuration is loaded. This is a rather fast operation as it does not involve any importing of provider classes, just discovering entrypoints, running them and parsing yaml configuration, so it is a very low sub-second time to do it. We cannot do it once in settings/config because we actually need settings/config to be pre-initialized without providers in order to be able to bootstrap airflow, therefore we need to run it individually in each command that can be run with the "airflow" entrypoint. Decorator seems to be best suited to do the job: * easy to apply and not easy to forget when you create another command and look at other commands * nicely wraps around local ProvidersManager import There are exceptions for the "version" and "providers lazy-loaded" commands because they are NOT supposed to initialize configuration of providers.
79857f5 to
95b02c6
Compare
Member
Author
This was referenced Jul 22, 2023
Merged
hussein-awala
approved these changes
Jul 22, 2023
Member
hussein-awala
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.
Looks good! LGTM
Member
Author
|
Oh nice. That will let me get all the others smaller :) |
69 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area:CLI
area:plugins
area:providers
area:Triggerer
area:webserver
Webserver related Issues
changelog:skip
Changes that should be skipped from the changelog (CI, tests, etc..)
full tests needed
We need to run full set of tests for this PR to merge
provider:celery
provider:cncf-kubernetes
Kubernetes (k8s) provider related issues
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A number of commands in Airflow relies on the fact that
providers configuration is loaded. This is a rather fast operation
as it does not involve any importing of provider classes, just
discovering entrypoints, running them and parsing yaml configuration,
so it is a very low sub-second time to do it.
We cannot do it once in settings/config because we actually need
settings/config to be pre-initialized without providers in order
to be able to bootstrap airflow, therefore we need to run
it individually in each command that can be run with the
"airflow" entrypoint. Decorator seems to be best suited to do
the job:
command and look at other commands
There are exceptions for the "version" and "providers lazy-loaded"
commands because they are NOT supposed to initialize configuration
of providers.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in newsfragments.