uranusjr commented on a change in pull request #20305:
URL: https://github.com/apache/airflow/pull/20305#discussion_r769247961



##########
File path: airflow/providers/amazon/aws/operators/athena.py
##########
@@ -25,16 +26,27 @@
     from cached_property import cached_property
 
 from airflow.models import BaseOperator
-from airflow.providers.amazon.aws.hooks.athena import AWSAthenaHook
+from airflow.providers.amazon.aws.hooks.athena import AthenaHook
 
 
-class AWSAthenaOperator(BaseOperator):
+class AWSAthenaOperator:
+    """Deprecated Operator"""
+
+    warnings.warn(
+        "This operator is deprecated. Please use "
+        "`airflow.providers.amazon.aws.operators.athena.AthenaOperator`.",
+        DeprecationWarning,
+        stacklevel=2,
+    )

Review comment:
       Same as above.

##########
File path: airflow/providers/amazon/aws/hooks/athena.py
##########
@@ -25,7 +26,17 @@
 from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook
 
 
-class AWSAthenaHook(AwsBaseHook):
+class AWSAthenaHook:
+    """Deprecated Hook"""
+
+    warnings.warn(
+        "This hook is deprecated. Please use 
`airflow.providers.amazon.aws.hooks.athena.AthenaHook`.",
+        DeprecationWarning,
+        stacklevel=2,
+    )

Review comment:
       This would make this warning unconditionally appear, and existing code 
to all break. You should
   
   1. Make `AWSAthenaHook` subclass `AthenaHook` (instead of the other way 
around)
   2. Move the deprecation warning to `__init__`.




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