This is an automated email from the ASF dual-hosted git repository.

eladkal pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new e0eaa604f49 Rename list_jobs method to describe_jobs in GlueJobHook 
(#48904)
e0eaa604f49 is described below

commit e0eaa604f49a612432451910e30e74eaf2563601
Author: Peng-Jui Wang <[email protected]>
AuthorDate: Thu Apr 10 03:21:43 2025 -0700

    Rename list_jobs method to describe_jobs in GlueJobHook (#48904)
    
    * rename list_jobs method to describe_jobs in GlueJobHook
    
    * deprecate list_jobs method in GlueJobHook
    
    * add deprecation warning in list_jobs
    
    Co-authored-by: Vincent <[email protected]>
    
    * fix import
    
    ---------
    
    Co-authored-by: Vincent <[email protected]>
---
 .../src/airflow/providers/amazon/aws/hooks/glue.py    | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/providers/amazon/src/airflow/providers/amazon/aws/hooks/glue.py 
b/providers/amazon/src/airflow/providers/amazon/aws/hooks/glue.py
index 91e69c7745b..b9cd21bffae 100644
--- a/providers/amazon/src/airflow/providers/amazon/aws/hooks/glue.py
+++ b/providers/amazon/src/airflow/providers/amazon/aws/hooks/glue.py
@@ -19,12 +19,13 @@ from __future__ import annotations
 
 import asyncio
 import time
+import warnings
 from functools import cached_property
 from typing import Any
 
 from botocore.exceptions import ClientError
 
-from airflow.exceptions import AirflowException
+from airflow.exceptions import AirflowException, 
AirflowProviderDeprecationWarning
 from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook
 from airflow.providers.amazon.aws.hooks.logs import AwsLogsHook
 
@@ -145,7 +146,7 @@ class GlueJobHook(AwsBaseHook):
 
         return config
 
-    def list_jobs(self) -> list:
+    def describe_jobs(self) -> list:
         """
         Get list of Jobs.
 
@@ -154,6 +155,20 @@ class GlueJobHook(AwsBaseHook):
         """
         return self.conn.get_jobs()
 
+    def list_jobs(self) -> list:
+        """
+        Get list of Jobs.
+
+        .. deprecated::
+            - Use :meth:`describe_jobs` instead.
+        """
+        warnings.warn(
+            "The method `list_jobs` is deprecated. Use the method 
`describe_jobs` instead.",
+            AirflowProviderDeprecationWarning,
+            stacklevel=2,
+        )
+        return self.describe_jobs()
+
     def get_iam_execution_role(self) -> dict:
         try:
             iam_client = self.get_session(region_name=self.region_name).client(

Reply via email to