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

Handle cases of reset_index level being None or an empty list #865

Merged
merged 2 commits into from
Aug 1, 2022

Conversation

mheguy
Copy link
Contributor

@mheguy mheguy commented May 26, 2022

Closes #863

As I was writing the test for None, I thought about the case of an empty list.

I wasn't sure how it should be handled, but thankfully I don't have to break my head over it. I simply asked: wwpd? (what would pandas do?)

image

@mheguy mheguy changed the base branch from master to dev May 26, 2022 14:24
@codecov
Copy link

codecov bot commented May 26, 2022

Codecov Report

Merging #865 (8ad7664) into dev (4f111ba) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev     #865      +/-   ##
==========================================
- Coverage   97.30%   97.30%   -0.01%     
==========================================
  Files          43       43              
  Lines        4118     4116       -2     
==========================================
- Hits         4007     4005       -2     
  Misses        111      111              
Impacted Files Coverage Δ
pandera/schemas.py 99.24% <100.00%> (+<0.01%) ⬆️
pandera/schema_components.py 99.53% <0.00%> (-0.01%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4f111ba...8ad7664. Read the comment docs.

@mheguy
Copy link
Contributor Author

mheguy commented May 26, 2022

Quite a few CIs failing. I'm comparing to the output from #862 which was just a doc fix: I see that black isn't happy.
I have 21.12b0 and 22.3.0.
22.3.0 makes no changes to either file.
21.12b0 changes both files.

I'm not sure what version is running in CI.

@cosmicBboy
Copy link
Collaborator

cosmicBboy commented May 26, 2022

CI uses 22.3.0 https://github.com/pandera-dev/pandera/blob/master/.pre-commit-config.yaml#L37-L41, I'd recommend using pre-commit hooks locally so that it aligns with CI

also, breaks in the unit tests are due to protobuf==4.21.0 which has been yanked but somehow still being install by CI.

Will perhaps have to pin it to <4.21.0 as a quickfix (I can handle this in another PR and then you can rebase on top of that)

@mheguy
Copy link
Contributor Author

mheguy commented Jun 5, 2022

Black is now happy. Thanks for pointing me to the pre-commit config. It was the custom line-length that was creating the difference. :)
For the issue with protobuf, I'll wait on you for next steps.

Copy link
Collaborator

@cosmicBboy cosmicBboy left a comment

Choose a reason for hiding this comment

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

thanks @plague006 !

@cosmicBboy cosmicBboy merged commit 50fbb89 into unionai-oss:dev Aug 1, 2022
jeffzi pushed a commit to jeffzi/pandera that referenced this pull request Aug 1, 2022
…i-oss#865)

* Handle cases of reset_index level being None or an empty list

* Run black with custom line length
cosmicBboy added a commit that referenced this pull request Aug 2, 2022
* add base support for pandas_engine.Date

* fix modin validation for pandas_engine.Date

* reduce modin tests verbosity

* delete print statement

* ignore date in pyspark tests

* add test for pandas_engine.Date.coerce_value

* fix black

* add default 0 scale for Decimal

* fix test_inferred_dtype

* fix test_strategies

* fix black

* fix documentation

* fix typo (#895)

* fix for Index of type category fails on validation #840 (#856)

* fix for - Index of type category fails on validation #840

* Update schema_components.py

* clean up index schema component code

Co-authored-by: Niels Bantilan <niels.bantilan@gmail.com>

* Handle cases of reset_index level being None or an empty list (#865)

* Handle cases of reset_index level being None or an empty list

* Run black with custom line length

* increase codecov

* increase codecov

Co-authored-by: Jon Wiggins <35540058+jonwiggins@users.noreply.github.com>
Co-authored-by: Kumar Utsav <krum.utsav@gmail.com>
Co-authored-by: Niels Bantilan <niels.bantilan@gmail.com>
Co-authored-by: Matthew <plague006@users.noreply.github.com>
@mheguy mheguy deleted the fix/#863 branch August 2, 2022 20:26
cosmicBboy pushed a commit that referenced this pull request Aug 10, 2022
* Handle cases of reset_index level being None or an empty list

* Run black with custom line length
cosmicBboy added a commit that referenced this pull request Aug 10, 2022
* add base support for pandas_engine.Date

* fix modin validation for pandas_engine.Date

* reduce modin tests verbosity

* delete print statement

* ignore date in pyspark tests

* add test for pandas_engine.Date.coerce_value

* fix black

* add default 0 scale for Decimal

* fix test_inferred_dtype

* fix test_strategies

* fix black

* fix documentation

* fix typo (#895)

* fix for Index of type category fails on validation #840 (#856)

* fix for - Index of type category fails on validation #840

* Update schema_components.py

* clean up index schema component code

Co-authored-by: Niels Bantilan <niels.bantilan@gmail.com>

* Handle cases of reset_index level being None or an empty list (#865)

* Handle cases of reset_index level being None or an empty list

* Run black with custom line length

* increase codecov

* increase codecov

Co-authored-by: Jon Wiggins <35540058+jonwiggins@users.noreply.github.com>
Co-authored-by: Kumar Utsav <krum.utsav@gmail.com>
Co-authored-by: Niels Bantilan <niels.bantilan@gmail.com>
Co-authored-by: Matthew <plague006@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants