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

BUG: to_numeric casting to ea for new string dtype #56179

Merged
merged 3 commits into from
Nov 30, 2023

Conversation

phofl
Copy link
Member

@phofl phofl commented Nov 26, 2023

  • 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.

@phofl phofl added this to the 2.1.4 milestone Nov 26, 2023
@@ -234,7 +234,8 @@ def to_numeric(
set(),
coerce_numeric=coerce_numeric,
convert_to_masked_nullable=dtype_backend is not lib.no_default
or isinstance(values_dtype, StringDtype),
or isinstance(values_dtype, StringDtype)
Copy link
Member

Choose a reason for hiding this comment

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

This is not an issue for the pyarrow storage either?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, we want nullable dtype in this case, the mapping is as follows:

  • storage=pyarrow_numpy -> NumPy backed
  • storage=payrrow -> Nullable
  • ArrowDtype string -> PyArrow backed numerics

@mroeschke mroeschke added Dtype Conversions Unexpected or buggy dtype conversions Strings String extension data type and string data labels Nov 27, 2023
@mroeschke mroeschke merged commit d47ad02 into pandas-dev:main Nov 30, 2023
42 checks passed
@mroeschke
Copy link
Member

Thanks @phofl

@phofl phofl deleted the to_numeric_conversion branch November 30, 2023 17:47
meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Nov 30, 2023
mroeschke pushed a commit that referenced this pull request Nov 30, 2023
… new string dtype) (#56263)

Backport PR #56179: BUG: to_numeric casting to ea for new string dtype

Co-authored-by: Patrick Hoefler <61934744+phofl@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions Strings String extension data type and string data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants