-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Update SqlToS3Operator to support Polars and deprecate read_pd_kwargs #54195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
7c801e5 to
b6f016a
Compare
eladkal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
providers/amazon/src/airflow/providers/amazon/aws/transfers/sql_to_s3.py
Show resolved
Hide resolved
d1c00c9 to
534761a
Compare
providers/amazon/src/airflow/providers/amazon/aws/transfers/sql_to_s3.py
Outdated
Show resolved
Hide resolved
providers/amazon/src/airflow/providers/amazon/aws/transfers/sql_to_s3.py
Outdated
Show resolved
Hide resolved
534761a to
0ad88af
Compare
| if isinstance(df, pl.DataFrame): | ||
| df = df.to_pandas() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@guan404ming Taking a closer look. Is this right?
This means that user who uses polars must also install pandas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, to_pandas() still need pandas installed. That means it need re-implementation for this function for supporting two libs differently and I would open a PR for it later.
Related PR
#53399
cc @eladkal
Why
How
read_pd_kwargs→read_kwargsfor library-agnostic namingdf_typeparameter supporting "pandas" (default) and "polars"_partition_dataframe()to handle both DataFrame types^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.