dabla commented on code in PR #42891:
URL: https://github.com/apache/airflow/pull/42891#discussion_r1800545669


##########
airflow/operators/generic_transfer.py:
##########
@@ -68,13 +76,17 @@ def __init__(
         self.sql = sql
         self.destination_table = destination_table
         self.source_conn_id = source_conn_id
+        self.source_hook_params = source_hook_params
         self.destination_conn_id = destination_conn_id
+        self.destination_hook_params = destination_hook_params
         self.preoperator = preoperator
         self.insert_args = insert_args or {}
 
     def execute(self, context: Context):
-        source_hook = BaseHook.get_hook(self.source_conn_id)
-        destination_hook = BaseHook.get_hook(self.destination_conn_id)
+        source_hook = BaseHook.get_hook(conn_id=self.source_conn_id, 
hook_params=self.source_hook_params)

Review Comment:
   I moved the GenericTransfer to the standard provider, I also added a test 
which will start to fail once min airflow version will be 3.0.0 or higher so we 
do not forget to removed the backward compatibility code in GenericTranfer 
regarding the get_hook method.



##########
airflow/operators/generic_transfer.py:
##########
@@ -68,13 +76,17 @@ def __init__(
         self.sql = sql
         self.destination_table = destination_table
         self.source_conn_id = source_conn_id
+        self.source_hook_params = source_hook_params
         self.destination_conn_id = destination_conn_id
+        self.destination_hook_params = destination_hook_params
         self.preoperator = preoperator
         self.insert_args = insert_args or {}
 
     def execute(self, context: Context):
-        source_hook = BaseHook.get_hook(self.source_conn_id)
-        destination_hook = BaseHook.get_hook(self.destination_conn_id)
+        source_hook = BaseHook.get_hook(conn_id=self.source_conn_id, 
hook_params=self.source_hook_params)

Review Comment:
   a) and b) done



-- 
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-unsubscr...@airflow.apache.org

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

Reply via email to