Skip to content

ENH, TST: Add FutureWarning to read_table #51048

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

Merged
merged 6 commits into from
Jan 30, 2023
Merged

ENH, TST: Add FutureWarning to read_table #51048

merged 6 commits into from
Jan 30, 2023

Conversation

kathleenhang
Copy link
Contributor

@kathleenhang kathleenhang changed the title WARN: Add FutureWarning to read_table ENH, TST: Add FutureWarning to read_table Jan 28, 2023
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Thanks for working on this!

I've just left some comments - did you manage to run the test locally?

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

almost there 💪

@MarcoGorelli
Copy link
Member

you'll also need to run the code checks, see here for how to run them https://pandas.pydata.org/docs/dev/development/contributing_codebase.html#pre-commit (and of course do reach out if something doesn't work 🙏 )

@kathleenhang
Copy link
Contributor Author

kathleenhang commented Jan 29, 2023

Confusion is high. Here are the errors I get from running pre-commit: https://gist.github.com/kathleenhang/edf62b27a5510f96ba4c475f98869c12

Things I've tried:

Edit: Figured it out! Had to run pre-commit autoupdate
Looks like it may have been an Apple M1 issue. This article was helpful: https://stackoverflow.com/questions/71291254/pre-commit-giving-error-with-mirrors-mypy-how-do-i-fix-it

@kathleenhang
Copy link
Contributor Author

kathleenhang commented Jan 30, 2023

I ran pre-commit in VSCode which passed all code checks for all modified files. However, it fails the Github code checks.

I also got this complaint when trying to commit my changes: [ERROR] Your pre-commit configuration is unstaged. It wouldn't let me commit without adding the pre-commit configuration file to staging.

I wasn't sure how to override the complaint. If I revert my pre-commit configuration file, it causes pre-commit to break again with the same error.

@MarcoGorelli
Copy link
Member

MarcoGorelli commented Jan 30, 2023

Thanks for sticking with this! We're getting close

Having done pre-commit autoupdate, CI is now getting extra warnings from the updated versions of the tools you've updated

Was it only isort which wasn't working on your Apple? If so, perhaps you could just bump the version of isort in .pre-commit-config.yaml, and keep the others as they are (and we can fix them in a separate PR)

It looks like the black formatter isn't passing though - did you stage and commit it after you'd ran pre-commit? If not, you can just run

pre-commit run --files pandas/tests/io/parser/test_parse_dates.py

and then git add, git commit, git push

@kathleenhang
Copy link
Contributor Author

kathleenhang commented Jan 30, 2023

Correct, it was only isort which was not working. I was on the latest isort 5.12.0. I'm not sure why the black formatter failed, but I reset my staging area and added the files back to the staging area which seems to pass black.

Okay, I've reverted back to the original pre-commit and did as you mentioned. It has passed all checks on my end.

@MarcoGorelli MarcoGorelli added this to the 2.0 milestone Jan 30, 2023
@MarcoGorelli MarcoGorelli added the Warnings Warnings that appear or should be added to pandas label Jan 30, 2023
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Nice, well done @kathleenhang ! Looks good to me pending green

@kathleenhang
Copy link
Contributor Author

@MarcoGorelli Thank you!

plankton-slow-clap

@MarcoGorelli MarcoGorelli merged commit 0d43f68 into pandas-dev:main Jan 30, 2023
@kathleenhang kathleenhang deleted the kathleenhang-51017 branch January 30, 2023 19:45
@phofl
Copy link
Member

phofl commented Jan 30, 2023

We have to deploy the isort fix on 1.5.x as well

@MarcoGorelli
Copy link
Member

you're right, thanks - I should've made a separate PR just for that so we could just have backported it

I've opened #51069

@phofl
Copy link
Member

phofl commented Jan 30, 2023

Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Warnings Warnings that appear or should be added to pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WARN read_table with infer_datetime_format doesn't show FutureWarning
3 participants