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

rom 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 47c71108a8 Changed type hinting for handler function (#42275)
47c71108a8 is described below

commit 47c71108a8d0c1dcddc027554ec2747070f8f6ad
Author: Ariel Grosh <[email protected]>
AuthorDate: Sun Sep 22 21:34:01 2024 +0300

    Changed type hinting for handler function (#42275)
    
    * Changed type hinting for handler function
    
    * Fixed ruff type hinting
    
    * Changed from iterable to list
    
    * Update sql.pyi for IDE support
    
    * Complied to the fetch_all_handler signature
    
    * Changed signature in pyi
    
    * Fixed import error
    
    * Fixed missing import
    
    * Reordered imports
    
    * Reordered imports
    
    * Removed plus sign
    
    * Removed plus sign
    
    * Conformed to pep8
    
    * Update sql.pyi
    
    * Fixed bad type error
    
    * Update sql.pyi
    
    Co author: rom sharon @romsharon
    
    ---------
    
    Co-authored-by: rom sharon <[email protected]>
---
 airflow/providers/common/sql/operators/sql.py  | 2 +-
 airflow/providers/common/sql/operators/sql.pyi | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/airflow/providers/common/sql/operators/sql.py 
b/airflow/providers/common/sql/operators/sql.py
index f8b4080d66..fa1539e725 100644
--- a/airflow/providers/common/sql/operators/sql.py
+++ b/airflow/providers/common/sql/operators/sql.py
@@ -221,7 +221,7 @@ class SQLExecuteQueryOperator(BaseSQLOperator):
         sql: str | list[str],
         autocommit: bool = False,
         parameters: Mapping | Iterable | None = None,
-        handler: Callable[[Any], Any] = fetch_all_handler,
+        handler: Callable[[Any], list[tuple] | None] = fetch_all_handler,
         conn_id: str | None = None,
         database: str | None = None,
         split_statements: bool | None = None,
diff --git a/airflow/providers/common/sql/operators/sql.pyi 
b/airflow/providers/common/sql/operators/sql.pyi
index f8fa23c37e..0a63ccaa7c 100644
--- a/airflow/providers/common/sql/operators/sql.pyi
+++ b/airflow/providers/common/sql/operators/sql.pyi
@@ -89,7 +89,7 @@ class SQLExecuteQueryOperator(BaseSQLOperator):
         sql: str | list[str],
         autocommit: bool = False,
         parameters: Mapping | Iterable | None = None,
-        handler: Callable[[Any], Any] = ...,
+        handler: Callable[[Any], list[tuple] | None] = ...,
         conn_id: str | None = None,
         database: str | None = None,
         split_statements: bool | None = None,

Reply via email to