Baptistouille opened a new issue, #49731:
URL: https://github.com/apache/airflow/issues/49731

   ### Apache Airflow Provider(s)
   
   common-sql
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow = {extras = ["mysql", "postgres"], version = "^3.0.0"}
   Running on python 3.11
   
   ### Apache Airflow version
   
   3.0.0
   
   ### Operating System
   
   Debian GNU/Linux 12 (bookworm)
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   _No response_
   
   ### What happened
   
   The operator try to load data from the destination_hook instead  of the 
source one.
   It only appends when the parameter `page_size` is None.
   
   
   ### What you think should happen instead
   
   The source hook should be used [here ](
   
   
https://github.com/apache/airflow/blob/ed06d99c226c92bd7251048686b0ea44cc26b715/providers/common/sql/src/airflow/providers/common/sql/operators/generic_transfer.py#L165)
   
   ### How to reproduce
   
   use a operator as following operator use should lead to an error as far as 
the wrong hook is used
   ```python
   transfer_op = GenericTransfer(
           task_id='transfer',
           sql='SELECT * FROM source_table',
           source_conn_id='source',
           destination_conn_id='destination',
           destination_table='target_table',
       )
   ```
   
   ### Anything else
   
   change proposal 
[here](https://github.com/apache/airflow/blob/ed06d99c226c92bd7251048686b0ea44cc26b715/providers/common/sql/src/airflow/providers/common/sql/operators/generic_transfer.py#L165)
   
   replace :
   ```python
               results = self.destination_hook.get_records(self.sql)
   ```
   
   by:
   ```python
               results = self.source_hook.get_records(self.sql)
   ```
   
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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