VelmiraPetkova commented on code in PR #39465:
URL: https://github.com/apache/airflow/pull/39465#discussion_r1600545687


##########
airflow/providers/ftp/hooks/ftp.py:
##########
@@ -58,7 +58,11 @@ def get_conn(self) -> ftplib.FTP:
         if self.conn is None:
             params = self.get_connection(self.ftp_conn_id)
             pasv = params.extra_dejson.get("passive", True)
-            self.conn = ftplib.FTP(params.host, params.login, params.password) 
 # nosec: B321
+            self.conn = ftplib.FTP()  # nosec: B321
+            if params.host:
+                self.conn.connect(params.host, params.port)
+                if params.login:
+                    self.conn.login(params.login, params.password)

Review Comment:
   This is implemented in the same way as in the standard library. Plus, 
`params.login` and `params.password` only have a meaning when trying to connect 
to a FTP server for which you need to have a host name supplied (even if it's 
localhost).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to