airflow icon indicating copy to clipboard operation
airflow copied to clipboard

FTPHook doesn't not allow to change port

Open arollet-decathlon opened this issue 1 year ago • 6 comments

Apache Airflow Provider(s)

ftp

Versions of Apache Airflow Providers

3.8.0

Apache Airflow version

2.6.3

Operating System

Ubuntu 20.04

Deployment

Official Apache Airflow Helm Chart

Deployment details

Irrelevant as it is in source code

What happened

When setting up an FTP connection with a custom port (different from 21), the FTP Hook does not read it at all and simply passes the hostname and uses the default port set by FTP_PORT in ftplib.FTP_PORT (used by ftplib.FTP.port), thus preventing any modification of default port 21. PS: The 'connect' function of the FTP class reads port from the self.port attribute;

What you think should happen instead

The FTP Hook should be able to read the port (if set) and pass it to the FTP object created

How to reproduce

Set up any FTP connection with and test it on Airflow UI.

Anything else

No response

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

arollet-decathlon avatar Apr 29 '24 10:04 arollet-decathlon

Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

boring-cyborg[bot] avatar Apr 29 '24 10:04 boring-cyborg[bot]

@Lee-W I could investigate it first, please feel free to assign it to me.

josix avatar Apr 30 '24 11:04 josix

Sure! Just assigned to you.

Lee-W avatar Apr 30 '24 16:04 Lee-W

Hello, I am Velmira and I am a new member. I think I've fixed this bug already. I just need to run tests for the change. If you're still not making progress, I can create a pull request and solve the problem.

VelmiraPetkova avatar May 07 '24 05:05 VelmiraPetkova

Hi @VelmiraPetkova sure, please go for it

josix avatar May 07 '24 06:05 josix

Thanks, @VelmiraPetkova, for offering the help, and @josix, for the quick confirmation! I'll assign this to @VelmiraPetkova instead

Lee-W avatar May 07 '24 06:05 Lee-W

I have this issue fixed in my local setup too. If you need any help, I can guide you @VelmiraPetkova

Bowrna avatar May 07 '24 06:05 Bowrna