Repository navigation
Conversation
deepujain
force-pushed
the
fix-64258-ssh-provider-py314-sshtunnel
branch
from
March 27, 2026 04:39
250cc06 to
9d7d871
Compare
Contributor
|
I don't think this is the right fix. |
Contributor
|
Closing in favor of #64299 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The SSH provider imported
sshtunnelat module import time, so Python 3.14 environments with the current incompatiblesshtunnelrelease could fail on plain imports likeSFTPHookbefore any tunnel functionality was used. This change defers thesshtunnelimport untilget_tunnel()is called and raises a clear optional-feature error if the dependency is unavailable or syntactically incompatible.Changes
providers/ssh/src/airflow/providers/ssh/hooks/ssh.py-- lazy-loadsshtunnelonly when tunnel creation is requested and raiseAirflowOptionalProviderFeatureExceptionon import/runtime incompatibility.providers/ssh/tests/unit/ssh/hooks/test_ssh.py-- add regression coverage for importingSSHHookwhensshtunnelis broken and for the runtime error path when tunnel support is used.Test plan
uv run --project providers/sftp python - <<'PY'smoke import offrom airflow.providers.sftp.hooks.sftp import SFTPHookuv run --project providers/sftp pytest providers/ssh/tests/unit/ssh/hooks/test_ssh.py -k 'test_tunnel_with_password or test_tunnel_without_password or test_tunnel_with_private_key or test_tunnel_with_private_key_passphrase or test_tunnel_with_private_key_ecdsa or test_can_import_ssh_hook_when_sshtunnel_is_broken or test_tunnel_requires_working_sshtunnel' -xvsFixes #64258