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

Change ComputeSSH to throw provider import error instead paramiko #23035

Merged
merged 1 commit into from
Apr 21, 2022

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Apr 15, 2022

The paramiko import should be done after ssh provider to properly
detect it as an optional Google Provider feature.

Part of: #23033


^ 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.

@mik-laj
Copy link
Member

mik-laj commented Apr 15, 2022

It also required ssh provider

from airflow.providers.ssh.hooks.ssh import SSHHook

Should we add it to additional extras?
additional-extras:
apache.beam: apache-beam[gcp]
leveldb: plyvel
facebook: apache-airlfow-providers-facebook>=2.2.0
amazon: apache-airlfow-providers-facebook>=2.6.0

@potiuk
Copy link
Member Author

potiuk commented Apr 15, 2022

Not needed. This happens automatically

@potiuk
Copy link
Member Author

potiuk commented Apr 15, 2022

See - https://airflow.apache.org/docs/apache-airflow-providers-google/stable/index.html#cross-provider-package-dependencies there is an ssh extra. But indeed - this should be done differently.

Paramiko should be added "after" importing provider - then it will be handled as "optional feature" automatically - and we do not need to change setup.py.

Good comment @mik-laj !

@potiuk
Copy link
Member Author

potiuk commented Apr 15, 2022

I will add some testing harness for such imports soon :)

@potiuk potiuk force-pushed the add-paramiko-to-google-dependencies branch from 214aec4 to c916ecd Compare April 15, 2022 13:07
@potiuk potiuk requested a review from turbaszek as a code owner April 15, 2022 13:07
@potiuk potiuk changed the title Google Providers (ComputeSSH) depends on paramiko. Change ComputeSSH to throw provider import error instead paramiko Apr 15, 2022
@potiuk potiuk requested a review from mik-laj April 15, 2022 13:08
@potiuk
Copy link
Member Author

potiuk commented Apr 15, 2022

I fixed it differently now. Together with #23037 changing import errors should fix it as we will get just info message that SSH provider is not available so the Hook won't work.

The paramiko import should be done after ssh provider to properly
detect it as an optional Google Provider feature.

Part of: apache#23033
@potiuk potiuk force-pushed the add-paramiko-to-google-dependencies branch from c916ecd to 2f65c84 Compare April 20, 2022 17:47
@github-actions
Copy link

The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions bot added the okay to merge It's ok to merge this PR as it does not require more tests label Apr 21, 2022
@potiuk potiuk merged commit 07a13bb into apache:main Apr 21, 2022
@potiuk potiuk deleted the add-paramiko-to-google-dependencies branch April 21, 2022 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
okay to merge It's ok to merge this PR as it does not require more tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants