-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
SFTPHook requires param 'ftp_conn_id' to be passed even for ssh connections #20144
Comments
Why? |
To be consistent with the SFTPOperator and not to mislead the type of connection to be used since there are both FTP and SFTP connections! |
OK. Works for me. Sftp is really ssh under-the-hood indeed. But you should make sure to keep deprecated previous option working too. Assigning you :D |
I would say rather than deprecating, allow both as it is quite common to use SSH for get and send files |
It's really about the "iniit" parameter name of Hook, so I am not sure if we should have two variants :). One should be blesssed. |
And there is disconnect which one is used between the Operator and Hook. |
Oh yes this is regarding the Hook, I am fine with that. The SftpOperator uses the SSHHook anyway so all |
Food is good 🥫 |
:D |
fixed by #20164 |
Apache Airflow Provider(s)
sftp
Versions of Apache Airflow Providers
apache-airflow-providers-sftp==2.2.0
Apache Airflow version
2.2.2 (latest released)
Operating System
Ubuntu 20.04.3 LTS
Deployment
Docker-Compose
Deployment details
No response
What happened
When instantiating an SFTPHook in order to create a connection to an sftp server, I noticed that if I was passing the parameter
ssh_conn_id
, the hook was trying to connect tolocalhost
, whereas if I am passingftp_conn_id
, I obtain the desired connection.airflow/airflow/providers/sftp/hooks/sftp.py
Lines 67 to 69 in 35be8bd
What you expected to happen
I would expect to be able to instantiate an sftp conection using the parameter
ssh_conn_id
instead offtp_conn_id
.How to reproduce
No response
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: