Skip to content

Declare pyarrow for Parquet output of SqlToS3Operator - #74691

Merged
dabla merged 1 commit into
apache:mainfrom
Dev-iL:2610/amazon-arrow
Oct 16, 2026
Merged

dabla merged 1 commit into
apache:mainfrom
Dev-iL:2610/amazon-arrow

Conversation

@Dev-iL

@Dev-iL Dev-iL commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

related: #74555

Writing Parquet files and reading with the pyarrow dtype backend both need pyarrow, but the provider never declared it. It only worked when another installed package happened to bring pyarrow in, and otherwise failed at runtime with pandas' "Unable to find a usable engine" error.

A separate extra keeps the roughly 40 MB dependency out of installs that only write CSV or JSON.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Opus 5.5 following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@Dev-iL
Dev-iL force-pushed the 2610/amazon-arrow branch from eb0406c to e5d72f0 Compare October 15, 2026 16:08
@Dev-iL
Dev-iL marked this pull request as ready for review October 15, 2026 16:08
@Dev-iL
Dev-iL requested a review from o-nikolas as a code owner October 15, 2026 16:08

@dabla dabla left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

Nothing since the previous round (first review; no prior reviews or threads on the PR).

Open

  • [1] the docs sentence describes the default pandas path only.
  • [2] optional: an install hint naming the parquet extra when no Parquet engine is installed.
  • Not for this PR: df_type="polars" can't write anything on main. execute calls getattr(df, FILE_OPTIONS_MAP[...].function), which is to_csv / to_json / to_parquet, but a polars DataFrame only has write_csv / write_json / write_parquet, so it raises AttributeError. test_execute_with_df_type hides this because its mocked get_df returns a pandas DataFrame for "polars" too. Fixed separately in #74813.

The change is right: SqlToS3Operator is the only place in the Amazon provider that needs pyarrow (file_format="parquet" and dtype_backend="pyarrow"), the markers and floors match the ones databricks and snowflake already use, the extras table in index.rst follows the pyproject order, and the dev group now guarantees pyarrow for the existing Parquet cases in test_sql_to_s3.py (pyarrow 26.0.0 ships cp315 wheels, so this also holds for the Python 3.15 work in #74555). Diff-based review at e5d72f0c; checked the main-branch operator and tests for every pyarrow/Parquet use in providers/amazon; no tests run locally.

Comment thread providers/amazon/pyproject.toml Resolved
Writing Parquet files and reading with the pyarrow dtype backend both need pyarrow, but the provider never declared it. It only worked when another installed package happened to bring pyarrow in, and otherwise failed at runtime with pandas' "Unable to find a usable engine" error. A separate extra keeps the roughly 40 MB dependency out of installs that only write CSV or JSON.
@Dev-iL
Dev-iL force-pushed the 2610/amazon-arrow branch from e5d72f0 to 47d712e Compare October 15, 2026 21:16
@dabla
dabla merged commit d6d425d into apache:main Oct 16, 2026
76 checks passed
@Dev-iL
Dev-iL deleted the 2610/amazon-arrow branch October 16, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants