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): Fix Array constructor when inner type is another Array #16622

Merged
merged 3 commits into from
May 31, 2024

Conversation

stinodego
Copy link
Member

@stinodego stinodego commented May 31, 2024

Changes

  • Update equality check to check for the shape instead of the size
  • Make sure the shape is correct when the inner dtype is another Array

@github-actions github-actions bot added fix Bug fix python Related to Python Polars labels May 31, 2024
@@ -125,6 +125,13 @@ def test_array_data_type_equality() -> None:
assert pl.Array(pl.Int64, 2) != pl.Array(pl.String, 2)
assert pl.Array(pl.Int64, 2) != pl.List(pl.Int64)

assert pl.Array(pl.Int64, (4, 2)) == pl.Array
assert pl.Array(pl.Array(pl.Int64, 2), 4) == pl.Array(pl.Int64, (4, 2))
Copy link
Member Author

Choose a reason for hiding this comment

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

This case resulted in a shape of (4,) instead of (4, 2).

@stinodego stinodego marked this pull request as ready for review May 31, 2024 10:19
Copy link

codecov bot commented May 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.50%. Comparing base (d7b4f72) to head (39888dc).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16622      +/-   ##
==========================================
- Coverage   81.51%   81.50%   -0.01%     
==========================================
  Files        1414     1414              
  Lines      185906   185907       +1     
  Branches     3027     3027              
==========================================
- Hits       151535   151532       -3     
- Misses      33840    33844       +4     
  Partials      531      531              

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

@stinodego stinodego merged commit 65b8cdc into main May 31, 2024
16 checks passed
@stinodego stinodego deleted the fix-array-eq branch May 31, 2024 11:05
@c-peters c-peters added the accepted Ready for implementation label Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation fix Bug fix python Related to Python Polars
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants