Skip to content

SFTPHook requires param 'ftp_conn_id' to be passed even for ssh connections #20144

@saveriogzz

Description

@saveriogzz

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 to localhost, whereas if I am passing ftp_conn_id, I obtain the desired connection.

def __init__(self, ftp_conn_id: str = 'sftp_default', *args, **kwargs) -> None:
kwargs['ssh_conn_id'] = ftp_conn_id
super().__init__(*args, **kwargs)

What you expected to happen

I would expect to be able to instantiate an sftp conection using the parameter ssh_conn_id instead of ftp_conn_id.

How to reproduce

No response

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions