Migrate get_pandas_df to get_df in provider test#49339
Conversation
2449640 to
84979e9
Compare
|
Hi @eladkal after my investigation, I found that the cursor execution logic is different for https://github.com/pola-rs/polars/blob/5c114f0f32a62bf796629e4ccf01b93146ae22c4/py-polars/polars/io/database/functions.py#L247-L256 and the executer https://github.com/pola-rs/polars/blob/main/py-polars/polars/io/database/_executor.py Thus we have also need to mock the execution abstraction for |
|
I currently removed the test for polars for |
6cf4613 to
5d498dc
Compare
5d498dc to
314dd76
Compare
|
I do not think we should base it on polars importability. We should not check for Airflow 3 here, but instead we should put minimum common.sql version (to the new version that will be released ) in all providers that are going to use the new feature. This is a "common.sql" not airflow feature, so theoretically when you install the new provider and they have Or am I missing something?. |
8383a71 to
3012315
Compare
|
There is still one problem left - compat tests - because there In this script : https://github.com/apache/airflow/blob/main/scripts/in_container/install_airflow_and_providers.py#L720 we are looping through providers available in |
|
I agree with you. Initially, I wanted to bump the Apache Airflow version to >= 3.1.0 in the providers. However, it seems like that is not the best approach because it will break compatibility. Considering this is not "really" incompatible but lack of package for test, I thought we can proceed with that. |
Head branch was pushed to by a user without write access
Nice.. Looks good. Let's see if CI agrees with this approach :) |
|
It works!! 🎉 |
Co-authored-by: Elad Kalif <[email protected]> Co-authored-by: Jarek Potiuk <[email protected]>
0c063c6 to
9704c04
Compare
🎉 |
Nice!!!! |
|
Thanks for the review and suggestions! |
Backport failed to create: v3-0-test. View the failure log Run details
You can attempt to backport this manually by running: cherry_picker c6ca8a2 v3-0-testThis should apply the commit to the v3-0-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continue |
…est (apache#49339) * test: migrate get_pandas_df to get_df in provider test Co-authored-by: Elad Kalif <[email protected]> Co-authored-by: Jarek Potiuk <[email protected]> * chore: add polars in deps * fix: install polars in ci --------- Co-authored-by: Elad Kalif <[email protected]> Co-authored-by: Jarek Potiuk <[email protected]> Co-authored-by: Wesley Chiu <[email protected]> (cherry picked from commit c6ca8a2)
…est (#49339) (#49885) * test: migrate get_pandas_df to get_df in provider test * chore: add polars in deps * fix: install polars in ci --------- (cherry picked from commit c6ca8a2) Co-authored-by: Guan Ming(Wesley) Chiu <[email protected]> Co-authored-by: Elad Kalif <[email protected]> Co-authored-by: Wesley Chiu <[email protected]>
…49339) * test: migrate get_pandas_df to get_df in provider test Co-authored-by: Elad Kalif <[email protected]> Co-authored-by: Jarek Potiuk <[email protected]> * chore: add polars in deps * fix: install polars in ci --------- Co-authored-by: Elad Kalif <[email protected]> Co-authored-by: Jarek Potiuk <[email protected]> Co-authored-by: Wesley Chiu <[email protected]>
…49339) * test: migrate get_pandas_df to get_df in provider test Co-authored-by: Elad Kalif <[email protected]> Co-authored-by: Jarek Potiuk <[email protected]> * chore: add polars in deps * fix: install polars in ci --------- Co-authored-by: Elad Kalif <[email protected]> Co-authored-by: Jarek Potiuk <[email protected]> Co-authored-by: Wesley Chiu <[email protected]>
…49339) * test: migrate get_pandas_df to get_df in provider test Co-authored-by: Elad Kalif <[email protected]> Co-authored-by: Jarek Potiuk <[email protected]> * chore: add polars in deps * fix: install polars in ci --------- Co-authored-by: Elad Kalif <[email protected]> Co-authored-by: Jarek Potiuk <[email protected]> Co-authored-by: Wesley Chiu <[email protected]>
…49339) * test: migrate get_pandas_df to get_df in provider test Co-authored-by: Elad Kalif <[email protected]> Co-authored-by: Jarek Potiuk <[email protected]> * chore: add polars in deps * fix: install polars in ci --------- Co-authored-by: Elad Kalif <[email protected]> Co-authored-by: Jarek Potiuk <[email protected]> Co-authored-by: Wesley Chiu <[email protected]>
get_pandas_df to get_df in provider testget_pandas_df to get_df in provider test
Related Issue
get_pandas_dftoget_dfinproviders#49334Why
get_pandas and get_pandas_by_chunks is deprecated in #48875, which would be replaced by get_df. Thus, we need to migrate them in providers.
How
This PR is focus on migration of test migration only case as they are more simple and general. Thus I thought that put them together would be better.
In this test, the original
get_pandas_dfwould still be tested since it's implemented likeairflow/providers/common/sql/src/airflow/providers/common/sql/hooks/sql.py
Lines 387 to 400 in 438220f
and get_df is like this
airflow/providers/common/sql/src/airflow/providers/common/sql/hooks/sql.py
Lines 433 to 436 in 438220f
thus it still handled the backwards compatibility.
cc: @eladkal
^ 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.