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

Add optional features in providers. #21074

Merged
merged 1 commit into from
Jan 27, 2022

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Jan 24, 2022

Some features in providers can be optional, depending on the
presence of some libraries. Since Providers Manager tries
to import the right classes that are exposed via providers it
should not - in this case - log warning message for those
optional features. Previously, all ImportErrors were turned into
debug log but now we only turn them in debug log when creator
of the provider deliberately raised
an AirflowOptionalProviderFeatureException.

Instructions on how to raise such exception in the way to keep
backwards compatibility were updated in proider's documentation.

Fixes: #20709


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, 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 UPDATING.md.

@potiuk potiuk force-pushed the unhide-provider-import-errors branch 3 times, most recently from f2a254f to 19f2fdf Compare January 26, 2022 21:17
Some features in providers can be optional, depending on the
presence of some libraries. Since Providers Manager tries
to import the right classes that are exposed via providers it
should not - in this case - log warning message for those
optional features. Previously, all ImportErrors were turned into
debug log but now we only turn them in debug log when creator
of the provider deliberately raised
an AirflowOptionalProviderFeatureException.

Instructions on how to raise such exception in the way to keep
backwards compatibility were updated in proider's documentation.

Fixes: apache#20709
@potiuk potiuk force-pushed the unhide-provider-import-errors branch from 19f2fdf to cddad92 Compare January 26, 2022 22:16
@potiuk potiuk closed this Jan 26, 2022
@potiuk potiuk reopened this Jan 26, 2022
@uranusjr
Copy link
Member

log once per app run

That’s what warnings are for :)

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Jan 27, 2022
@github-actions
Copy link

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@potiuk potiuk merged commit cb73053 into apache:main Jan 27, 2022
@potiuk potiuk deleted the unhide-provider-import-errors branch January 27, 2022 12:58
@potiuk
Copy link
Member Author

potiuk commented Jan 27, 2022

That’s what warnings are for :)

Oh yeah.... Unfortunately in our case we have N independent gunicorns processes running and restarting every X seconds when you have kinda busy use of airflow and "restart every x requests" feature of gunicorn enabled (which most people do)

So short of having a separate service for that or storing this in a DB I think we are out of luck :(

BTW. I actually toyed with an idea to add UI notification for that BTW. Maybe that is actually a good idea (but this is the kind of notification that I think we have no support for yet - dismissable (and staying dismissed if user did dismiss them). Or am I wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers full tests needed We need to run full set of tests for this PR to merge kind:documentation provider:google Google (including GCP) related issues type:improvement Changelog: Improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

With hive-provider installed, but can not be recognized from Airflow Connection Web UI?
3 participants