SFTP hook to prefer the SSH paramiko key over the key file path#18988
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
|
|
Could you address the review comment in the original PR? Namely https://github.com/apache/airflow/pull/16338/files#r649058789 |
Done! |
|
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. |
This reverts commit e610576.
Remove the link to pysftp. SFTP Connection's private_key is the key content, while pysftp's private_key is a file path. Readers should look at the documentation for SFTP Connection for argument definitions
Since private_key is now the actual private key content, and key_file is not the path to the private key file
|
Awesome work, congrats on your first merged pull request! |
Related issue: #16323
The SFTP hook does not allow for a SSH private key string to be used, only a private key file path. As it is based on the SSH hook, which does allow for a private key string to be used, a small change could align these two hooks.
This change first checks if a paramiko object is present after the SSH hook has been initialised, and the prefers that rather than the ssh key file path.
This PR replaces stale PR #16338