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

REF: pass dtype explicitly to _from_sequence inside pd.array #59773

Merged
merged 2 commits into from
Sep 25, 2024

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@jbrockmendel jbrockmendel changed the title REF: pass dtype explicitly to _from_sequence REF: pass dtype explicitly to _from_sequence inside pd.array Sep 11, 2024
@@ -358,15 +358,17 @@ def array(
return cls._from_sequence(data, dtype=dtype, copy=copy)

elif data.dtype.kind in "iu":
return IntegerArray._from_sequence(data, copy=copy)
dtype = IntegerArray._dtype_cls._get_dtype_mapping()[data.dtype]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
dtype = IntegerArray._dtype_cls._get_dtype_mapping()[data.dtype]
dtype = NUMPY_INT_TO_DTYPE[data.dtype]

?

Copy link
Member Author

Choose a reason for hiding this comment

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

thatd work too. i chose to do it this way to avoid the extra import

@mroeschke mroeschke added Refactor Internal refactoring of code ExtensionArray Extending pandas with custom dtypes or arrays. labels Sep 25, 2024
@mroeschke mroeschke added this to the 3.0 milestone Sep 25, 2024
@mroeschke mroeschke merged commit a9f76d7 into pandas-dev:main Sep 25, 2024
57 checks passed
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the ref-dtype-explicit-array branch September 25, 2024 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ExtensionArray Extending pandas with custom dtypes or arrays. Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants