You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Baptistouille (via GitHub)" <gi...@apache.org> on 2025/04/24 14:56:31 UTC

[I] wrong hook on SQL operator GenericTransfert [airflow]

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: commits-unsubscribe@airflow.apache.org.apache.org

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


Re: [I] wrong hook on SQL operator GenericTransfert [airflow]

Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal closed issue #49731: wrong hook on SQL operator GenericTransfert
URL: https://github.com/apache/airflow/issues/49731


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

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


Re: [I] wrong hook on SQL operator GenericTransfert [airflow]

Posted by "dabla (via GitHub)" <gi...@apache.org>.
dabla commented on issue #49731:
URL: https://github.com/apache/airflow/issues/49731#issuecomment-2830410631

   Will fix it


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

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


Re: [I] wrong hook on SQL operator GenericTransfert [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #49731:
URL: https://github.com/apache/airflow/issues/49731#issuecomment-2827946956

   Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
   


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

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


Re: [I] wrong hook on SQL operator GenericTransfert [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #49731:
URL: https://github.com/apache/airflow/issues/49731#issuecomment-2828368493

   go ahead


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

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


Re: [I] wrong hook on SQL operator GenericTransfert [airflow]

Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal commented on issue #49731:
URL: https://github.com/apache/airflow/issues/49731#issuecomment-2830269242

   cc @dabla 


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

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