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 data type initialization #11907

Merged
merged 9 commits into from
Oct 21, 2023
Merged

fix(python): Fix Array data type initialization #11907

merged 9 commits into from
Oct 21, 2023

Conversation

stinodego
Copy link
Member

@stinodego stinodego commented Oct 20, 2023

Fixes

  • Fix the __hash__ and __repr__ implementations of Array - they were missing the "width" component
  • Add Array to the NESTED_DTYPES set
  • Fix the unpack_dtypes util to also work on Arrays

Deprecations

  • Deprecate the default value for the inner argument. Just like List and Field, there should be no default. Defining a List/Array without the inner dtype makes no sense.
  • The order of the arguments needs to be switched - first inner, then width. Just like the DataType::Array definition on the Rust side. It makes much more sense in that order to me.
    • This deprecation is quite ugly because importing deprecation utils in this module leads to circular imports 😕

@github-actions github-actions bot added deprecation Add a deprecation warning to outdated functionality python Related to Python Polars labels Oct 20, 2023
@stinodego stinodego changed the title depr(python): Fix Array data type initialization fix(python): Fix Array data type initialization Oct 20, 2023
@github-actions github-actions bot added the fix Bug fix label Oct 20, 2023
@stinodego stinodego marked this pull request as ready for review October 21, 2023 08:52
@stinodego stinodego merged commit 492a3c1 into main Oct 21, 2023
17 checks passed
@stinodego stinodego deleted the fix-array branch October 21, 2023 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecation Add a deprecation warning to outdated functionality fix Bug fix python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants