Skip to content

BUG: Series.to_dict does not return native Python types #37648

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 57 commits into from
Feb 19, 2021
Merged
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
a2e3e55
TST: add GH25969 OP
arw2019 Nov 5, 2020
41f0a4b
ENH: add maybe_box_native
arw2019 Nov 5, 2020
5e4edbe
ENH: use maybe_box_native in Series.to_dict
arw2019 Nov 5, 2020
b6967b7
BUG: add scalar check to maybe_box_native
arw2019 Nov 5, 2020
55919e0
BUG: suppress int conversion ValueError in maybe_box_native
arw2019 Nov 5, 2020
759e091
TST: rewrite existing to_dict tests
arw2019 Nov 6, 2020
6f966f2
CLN: use maybe_box_datetimelike -> maybe_box_native in DataFrame.to_dict
arw2019 Nov 6, 2020
1e058ab
Merge remote-tracking branch 'upstream/master' into maybe_box_native
arw2019 Nov 6, 2020
2ebd673
TYP: maybe_box_native
arw2019 Nov 6, 2020
1dc5935
DOC: add docstring to maybe_box_native
arw2019 Nov 6, 2020
1e5e459
DOC: whatsnew
arw2019 Nov 6, 2020
3c6bd7e
TYP: fix input type hint in maybe_box_native
arw2019 Nov 6, 2020
e3cc18f
TST (feedback): add uint testcases
arw2019 Nov 8, 2020
22819b7
TST (feedback): add uint testcases
arw2019 Nov 8, 2020
fb782df
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
arw2019 Nov 9, 2020
cb389d9
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
arw2019 Nov 9, 2020
249968e
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
arw2019 Nov 10, 2020
1f5d442
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
arw2019 Nov 10, 2020
9686035
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
arw2019 Nov 11, 2020
732fb84
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
arw2019 Nov 23, 2020
ec6cbfc
merge master + move to 1.3
arw2019 Dec 27, 2020
4bb1916
fixups
arw2019 Dec 27, 2020
587e592
fix merge error
arw2019 Dec 27, 2020
9d81f54
whatsnew
arw2019 Dec 27, 2020
673da4e
fix typing
arw2019 Dec 27, 2020
ef639c9
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
arw2019 Dec 27, 2020
4036b63
tests
arw2019 Dec 28, 2020
89a841d
add NumericArray path in to_numeric
arw2019 Dec 28, 2020
68420ea
review: tests
arw2019 Jan 4, 2021
8b83e24
add bool check
arw2019 Jan 4, 2021
86b0e04
review: maybe_box_native takes Scalar arg only
arw2019 Jan 4, 2021
efc95b8
merge master
arw2019 Jan 4, 2021
c3b723a
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
arw2019 Jan 5, 2021
d5a9476
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
arw2019 Jan 31, 2021
3e2ea12
review comments: add unit test
arw2019 Jan 31, 2021
a455fcc
CI failures
arw2019 Jan 31, 2021
5541a35
merge master
arw2019 Jan 31, 2021
fcbf705
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
arw2019 Feb 7, 2021
9282ca3
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
arw2019 Feb 11, 2021
a444ef5
silence NumPy deprecation warning (np.int -> int)
arw2019 Feb 11, 2021
2411a70
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
arw2019 Feb 11, 2021
99d7c55
silence NumPy deprecation warning (np.float -> float)
arw2019 Feb 12, 2021
e009a9e
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
arw2019 Feb 12, 2021
eaeb409
whatsnew
arw2019 Feb 13, 2021
a642a6b
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
arw2019 Feb 13, 2021
0467e1b
review: use is_foo instead of is_foo_dtype
arw2019 Feb 16, 2021
5605bbd
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
arw2019 Feb 16, 2021
39ca508
review: remove suppress in int clause to check if anything fails
arw2019 Feb 16, 2021
7fa7503
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
arw2019 Feb 16, 2021
08567b4
pre-commit failure
arw2019 Feb 16, 2021
7c47df2
merge master
arw2019 Feb 16, 2021
618f8ef
merge master
arw2019 Feb 16, 2021
da620f2
review: more examples in unit test
arw2019 Feb 16, 2021
761b728
skip json test with numpy_dev
arw2019 Feb 17, 2021
49acd25
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
arw2019 Feb 17, 2021
86c6aa7
revert changes to JSON test
arw2019 Feb 18, 2021
4650131
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
arw2019 Feb 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
TYP: maybe_box_native
  • Loading branch information
arw2019 committed Nov 6, 2020
commit 2ebd673b66a3a9da63b9bd2e5b8cc05933d0dc68
3 changes: 2 additions & 1 deletion pandas/core/dtypes/cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def maybe_box_datetimelike(value: Scalar, dtype: Optional[Dtype] = None) -> Scal
return value


def maybe_box_native(value):
# TODO: this should be a TypeVar
def maybe_box_native(value: Union[Series, Scalar]) -> Union[ABCSeries, Scalar]:
if not is_scalar(value):
pass
elif is_datetime_or_timedelta_dtype(value):
Expand Down