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

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

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

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.

2 participants