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

fix(python): Address indexing edge-case with numpy arrays #19895

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

alexander-beedie
Copy link
Collaborator

@alexander-beedie alexander-beedie commented Nov 20, 2024

Closes #19882.

  • Resolves indexing error/edge-case with np.array(n) on DataFrame and Series __getitem__.
  • Adds some extra coverage (and splits out the numpy indexing into its own test).

Also:

  • Drive-by fix for an overnight update that triggers some new mypy lint errors (in "test_constructors").

@github-actions github-actions bot added fix Bug fix python Related to Python Polars labels Nov 20, 2024
@alexander-beedie alexander-beedie force-pushed the numpy-indexing branch 3 times, most recently from 162a8a3 to 8830ff5 Compare November 21, 2024 04:39
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 79.43%. Comparing base (f718909) to head (3f45cfb).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
py-polars/polars/_utils/getitem.py 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #19895      +/-   ##
==========================================
- Coverage   79.44%   79.43%   -0.01%     
==========================================
  Files        1554     1554              
  Lines      215609   215613       +4     
  Branches     2452     2454       +2     
==========================================
- Hits       171281   171279       -2     
- Misses      43770    43775       +5     
- Partials      558      559       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@ritchie46
Copy link
Member

A rebase away.

@alexander-beedie
Copy link
Collaborator Author

A rebase away.

Ahh, @nameexhaustion beat me to the lint drive-by fix; rebasing now :)

@ritchie46 ritchie46 merged commit e9a66e3 into pola-rs:main Nov 22, 2024
14 checks passed
@alexander-beedie alexander-beedie deleted the numpy-indexing branch November 22, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

_select_column, getitem misinterprets 0d numpy array as multi-dimensional array
2 participants