DYNOSuprovo opened a new pull request, #77169:
URL: https://github.com/apache/airflow/pull/77169

   <!--
   Thank you for contributing! Please make sure that your PR targets the `main` 
branch.
   -->
   
   ### Description
   
   In `GenericTransfer`, string conversions for templated `page_size` and 
`insert_args["commit_every"]` were previously performed inside a 
`render_template_fields` override. 
   
   When `GenericTransfer` is used in a mapped task (via 
`.partial(...).expand(...)`), `MappedOperator.render_template_fields` unmaps 
the task and renders through `_do_render_template_fields` on the unmapped 
operator. As a result, `GenericTransfer.render_template_fields` was never 
called in mapped tasks, leaving `page_size` and `commit_every` as strings (e.g. 
`"1000"`), which subsequently caused `TypeError: '<' not supported between 
instances of 'int' and 'str'` and `TypeError: unsupported operand type(s) for 
+=: 'int' and 'str'` during pagination.
   
   This mirrors the issue resolved in `SqlToS3Operator` (#77151 / #77153). 
   
   This change:
   1. Moves the integer conversions into `_do_render_template_fields` with a 
guard for `parent is self`, ensuring that both plain and mapped tasks properly 
convert `page_size` and `commit_every` to `int`.
   2. Adds a unit test in `test_generic_transfer.py` verifying that 
`_do_render_template_fields` correctly converts string inputs to integers.
   
   ---
   **^ Add meaningful description above**
   Read the **[Pull Request 
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
 for more information.
   


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