dabla commented on code in PR #77716:
URL: https://github.com/apache/airflow/pull/77716#discussion_r4740329234


##########
providers/ftp/src/airflow/providers/ftp/fs/ftp.py:
##########
@@ -0,0 +1,124 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import ftplib
+from typing import TYPE_CHECKING, Any
+
+from fsspec.implementations.ftp import FTPFileSystem
+
+from airflow.providers.common.compat.sdk import BaseHook
+from airflow.providers.ftp.hooks.ftp import _get_passive_mode
+
+if TYPE_CHECKING:
+    from fsspec import AbstractFileSystem
+
+schemes = ["ftp"]
+
+_LISTINGS_EXPIRY_SECONDS = 10
+
+
+class _AirflowFTPFileSystem(FTPFileSystem):

Review Comment:
   **[nit]** The class name says where the class lives, not what it adds.
   
   `Airflow` repeats what the module path `airflow.providers.ftp.fs.ftp` 
already says, and a reader of a traceback learns nothing from it about why this 
is not fsspec's `FTPFileSystem`. Everything the class adds (the reconnect, the 
expiring listings) is there for one reason, which its docstring gives: Airflow 
keeps the instance for the life of the process, and fsspec's class is not 
written for that. Could the name say so? `_LongLivedFTPFileSystem` names the 
reason, `_ReconnectingFTPFileSystem` the main thing it does; either works for 
me, and so does a better one if you have it. Your pick. Keeping it private is 
right: `get_fs` is the contract, and the class can then go without a 
deprecation once fsspec covers these cases.



-- 
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