uranusjr commented on a change in pull request #20305:
URL: https://github.com/apache/airflow/pull/20305#discussion_r769307537
##########
File path: airflow/providers/amazon/aws/hooks/athena.py
##########
@@ -260,3 +261,16 @@ def stop_query(self, query_execution_id: str) -> Dict:
:return: dict
"""
return
self.get_conn().stop_query_execution(QueryExecutionId=query_execution_id)
+
+
+class AWSAthenaHook(AthenaHook):
+ """
+ This hook is deprecated.
+ Please use :class:`airflow.providers.amazon.aws.hooks.athena.AthenaHook`.
+ """
+
+ warnings.warn(
+ "This hook is deprecated. Please use
`airflow.providers.amazon.aws.hooks.athena.AthenaHook`.",
+ DeprecationWarning,
+ stacklevel=2,
+ )
Review comment:
```suggestion
class AWSAthenaHook(AthenaHook):
"""
This hook is deprecated.
Please use :class:`airflow.providers.amazon.aws.hooks.athena.AthenaHook`.
"""
def __init__(self, *args, **kwargs):
warnings.warn(
"This hook is deprecated. Please use
`airflow.providers.amazon.aws.hooks.athena.AthenaHook`.",
DeprecationWarning,
stacklevel=2,
)
super().__init__(*args, **kwargs)
```
Having the warning directly in the class body would cause the message to be
emitted _on import time_, which is not correct.
--
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]