Skip to content
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

DEPR: squeeze argument in read_csv/read_table/read_excel #43427

Merged
merged 11 commits into from Sep 10, 2021

Conversation

lithomas1
Copy link
Member

@lithomas1 lithomas1 marked this pull request as draft September 6, 2021 17:15
@lithomas1 lithomas1 marked this pull request as ready for review September 6, 2021 18:00
pandas/io/excel/_base.py Outdated Show resolved Hide resolved
@lithomas1 lithomas1 marked this pull request as draft September 6, 2021 18:55
@jreback jreback added Deprecate Functionality to remove in pandas IO CSV read_csv, to_csv IO Excel read_excel, to_excel labels Sep 6, 2021
@jreback jreback added this to the 1.4 milestone Sep 9, 2021
@lithomas1
Copy link
Member Author

Wanted some feedback on the new approach to verify stacklevel in the tests.

Also, I'm not sure how to deprecate this for ExcelFile.parse. It will probably warn there as well, but IDK if we need to update the ExcelFile docs.

@lithomas1 lithomas1 marked this pull request as ready for review September 9, 2021 00:40
@phofl
Copy link
Member

phofl commented Sep 9, 2021

th.assert_produces_warning should check the stacklevel and raise if is not correct. This should be enough I think?

@jreback
Copy link
Contributor

jreback commented Sep 9, 2021

Wanted some feedback on the new approach to verify stacklevel in the tests.

Also, I'm not sure how to deprecate this for ExcelFile.parse. It will probably warn there as well, but IDK if we need to update the ExcelFile docs.

ok to tackle in a followup

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

lgtm

Co-authored-by: gfyoung <gfyoung17+GitHub@gmail.com>
@jreback jreback merged commit cd61b59 into pandas-dev:master Sep 10, 2021
@jreback
Copy link
Contributor

jreback commented Sep 10, 2021

thanks @lithomas1

@lithomas1 lithomas1 deleted the depr-squeeze branch September 11, 2021 02:30
@lithomas1
Copy link
Member Author

@phofl Are there other comments that I should address in a follow-up? The current approach is using tm.assert_produces_warning in the conftest since thats where the warnings should be raised.

If OK, I will make another PR updating all the other tests, and changing their stacklevels if necessary.

fkiraly pushed a commit to sktime/sktime that referenced this pull request May 26, 2022
…("columns")` in `pd.read_csv` (#2693)

Replace deprecated argument `squeeze` with the method `.squeeze("columns")` in `pd.read_csv`. This argument is deprecated since version `1.4.0` of `pandas` (see https://pandas.pydata.org/docs/whatsnew/v1.4.0.html and pandas-dev/pandas#43427).
zhengruifeng pushed a commit to apache/spark that referenced this pull request Aug 22, 2023
… from `read_csv` & enabling more tests

### What changes were proposed in this pull request?

This PR proposes to remove `squeeze` parameter from `read_csv` to follow the behavior of latest pandas. See pandas-dev/pandas#40413 and pandas-dev/pandas#43427 for detail.

This PR also enables more tests for pandas 2.0.0 and above.

### Why are the changes needed?

To follow the behavior of latest pandas, and increase the test coverage.

### Does this PR introduce _any_ user-facing change?

`squeeze` will be no longer available from `read_csv`. Otherwise, it's test-only.

### How was this patch tested?

Enabling & updating the existing tests.

Closes #42551 from itholic/pandas_remaining_tests.

Authored-by: itholic <haejoon.lee@databricks.com>
Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
valentinp17 pushed a commit to valentinp17/spark that referenced this pull request Aug 24, 2023
… from `read_csv` & enabling more tests

### What changes were proposed in this pull request?

This PR proposes to remove `squeeze` parameter from `read_csv` to follow the behavior of latest pandas. See pandas-dev/pandas#40413 and pandas-dev/pandas#43427 for detail.

This PR also enables more tests for pandas 2.0.0 and above.

### Why are the changes needed?

To follow the behavior of latest pandas, and increase the test coverage.

### Does this PR introduce _any_ user-facing change?

`squeeze` will be no longer available from `read_csv`. Otherwise, it's test-only.

### How was this patch tested?

Enabling & updating the existing tests.

Closes apache#42551 from itholic/pandas_remaining_tests.

Authored-by: itholic <haejoon.lee@databricks.com>
Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
ragnarok56 pushed a commit to ragnarok56/spark that referenced this pull request Mar 2, 2024
… from `read_csv` & enabling more tests

### What changes were proposed in this pull request?

This PR proposes to remove `squeeze` parameter from `read_csv` to follow the behavior of latest pandas. See pandas-dev/pandas#40413 and pandas-dev/pandas#43427 for detail.

This PR also enables more tests for pandas 2.0.0 and above.

### Why are the changes needed?

To follow the behavior of latest pandas, and increase the test coverage.

### Does this PR introduce _any_ user-facing change?

`squeeze` will be no longer available from `read_csv`. Otherwise, it's test-only.

### How was this patch tested?

Enabling & updating the existing tests.

Closes apache#42551 from itholic/pandas_remaining_tests.

Authored-by: itholic <haejoon.lee@databricks.com>
Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas IO CSV read_csv, to_csv IO Excel read_excel, to_excel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DEPR: squeeze() argument in read_csv/read_table
4 participants