You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/06/06 15:49:37 UTC

[GitHub] [airflow] josh-fell commented on a diff in pull request #23881: Generic S3 to SQL

josh-fell commented on code in PR #23881:
URL: https://github.com/apache/airflow/pull/23881#discussion_r890289609


##########
airflow/providers/amazon/aws/transfers/s3_to_sql.py:
##########
@@ -0,0 +1,115 @@
+#
+# 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 typing import List, Optional, Sequence, Union
+
+import numpy
+import pandas
+
+from airflow.exceptions import AirflowException
+from airflow.hooks.base import BaseHook
+from airflow.models import BaseOperator
+from airflow.providers.amazon.aws.hooks.s3 import S3Hook
+from airflow.utils.context import Context

Review Comment:
   Unfortunately this module was not available until Airflow 2.2.3. Using this direct import will force an implicit dependency on Airflow 2.2.3. The current minimum required Airflow version for providers is 2.1.0 (and soon to be 2.2.0).
   
   Can you update the import to be available during `TYPE_CHECKING` only?
   
   ```python
   from typing import TYPE_CHECKING, ...
   
   if TYPE_CHECKING:
       from airflow.utils.context import Context
   ```
   
   Then for the operator's `execute()` method:
   ```python
   def execute(self, context: "Context"):
   ...
   ```
   
   



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org