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

Add a hypothesis test for __getitem__ #1098

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sjdenny
Copy link

@sjdenny sjdenny commented Sep 30, 2024

Compares polars __getitem__ calls with pandas & pyarrow.

What type of PR is this? (check all applicable)

  • πŸ’Ύ Refactor
  • ✨ Feature
  • πŸ› Bug Fix
  • πŸ”§ Optimization
  • πŸ“ Documentation
  • βœ… Test
  • 🐳 Other

Related issues

Checklist

  • Code follows style guide (ruff)
  • Tests added
  • Documented the changes

If you have comments or can explain your changes, please do so below.

Putting this up for initial feedback - there's a bunch of cases which pyarrow doesn't support (documented in the test). Do we want to support these cases, or should be instead tighten the test (on pandas as well) and declare these unsupported for now?

Cases:

  • pyarrow: doesn't support negative indexes
  • pyarrow: pairs of slices unsupported, e.g. df[0:1, 'a':'b'] (trivial pairs such as df[:, 'a':'b'] where one slice is : are an exception).
  • pyarrow: empty edge case, e.g. df[[], "a":] fails.
  • pyarrow & pandas: df[..., ::step] is unsupported, ie slice(None, None, <something>)

@sjdenny sjdenny marked this pull request as ready for review September 30, 2024 11:05
Compares polars with pandas & pyarrow.
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.

this is awesome, thanks @sjdenny !

looks like there's a failure in the "random versions" CI job (specifically, pandas==2.0.3)

if we can address that, then I think we can merge this can then gradually address the rest

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.

test: add hypothesis test for DataFrame.__getitem__
2 participants