Skip to content

BUG: Coerce to native types to_dict list and index (#46751) #46752

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

Merged
merged 2 commits into from
Apr 22, 2022

Conversation

RogerThomas
Copy link
Contributor

@RogerThomas RogerThomas commented Apr 12, 2022

@RogerThomas RogerThomas changed the title BUG: Coerce to native types to_dict list and index BUG: Coerce to native types to_dict list and index (#46751) Apr 12, 2022
@RogerThomas
Copy link
Contributor Author

@rhshadrach PR for fix

Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

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

Looks great - very nice test. Small nits on the whatsnew.

@@ -500,6 +500,7 @@ Conversion
- Bug in :func:`array` with ``FloatingDtype`` and values containing float-castable strings incorrectly raising (:issue:`45424`)
- Bug when comparing string and datetime64ns objects causing ``OverflowError`` exception. (:issue:`45506`)
- Bug in metaclass of generic abstract dtypes causing :meth:`DataFrame.apply` and :meth:`Series.apply` to raise for the built-in function ``type`` (:issue:`46684`)
- Bug in :meth:`DataFrame.to_dict` for ``orient=="list"`` or ``orient=="index"`` was not returning native types. (:issue:`46751`)
Copy link
Member

Choose a reason for hiding this comment

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

nit: specify as the user would when calling the method; e.g. orient="list". Also no period before the issue #.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

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

lgtm

@rhshadrach rhshadrach added IO Data IO issues that don't fit into a more specific label Bug Dtype Conversions Unexpected or buggy dtype conversions labels Apr 19, 2022
@rhshadrach rhshadrach added this to the 1.5 milestone Apr 19, 2022
@RogerThomas
Copy link
Contributor Author

@rhshadrach looks like there are 2 tests failing that don't seem in any way related to my code, how should I proceed?

@rhshadrach
Copy link
Member

It's actually just one; the pandas-dev.pandas will fail anytime one of the Azure pipeline build fails, so it's just the py38_32bit. This build is failing on all PRs for reasons I haven't been able to figure out; okay to ignore.

@rhshadrach rhshadrach merged commit e6fd3db into pandas-dev:main Apr 22, 2022
@rhshadrach
Copy link
Member

Thanks @RogerThomas!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions IO Data IO issues that don't fit into a more specific label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: to_dict("index") and to_dict("list") don't coerce to native types
2 participants