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

   `SqlToS3Operator` accepts `df_type="polars"` since #54195, but no polars run 
could write a file: the operator always calls the pandas writers (`to_csv`, 
`to_json`, `to_parquet`), and a polars DataFrame only has `write_csv`, 
`write_json` and `write_parquet`. Every polars run therefore failed with 
`AttributeError` before anything reached S3, whatever the `file_format`.
   
   The tests did not catch it because the mocked hook returned a pandas 
DataFrame even when `df_type="polars"` was asked for. Those tests now get a 
polars DataFrame, and a new test writes one as CSV, gzipped CSV, JSON and 
Parquet and reads each upload back.
   
   `FileOptions` keeps its `function` field for the pandas writer, so code that 
reads `FILE_OPTIONS_MAP` is unaffected.
   
   Tests run: 
`providers/amazon/tests/unit/amazon/aws/transfers/test_sql_to_s3.py`, 46 
passed; with the operator change reverted, the 6 polars cases fail.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Opus 5.5
   
   Generated-by: Claude Opus 5.5 following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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