Skip to content

DOC: update DatetimeTZDtype unit limitation #58213

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 12, 2024
Merged
Changes from 1 commit
Commits
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
2 changes: 1 addition & 1 deletion pandas/core/dtypes/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ class DatetimeTZDtype(PandasExtensionDtype):
----------
unit : str, default "ns"
The precision of the datetime data. Currently limited
Copy link
Member

Choose a reason for hiding this comment

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

I think we should consider deleting "Currently limited" since there are 4 possible options now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Aloqeely thank you for your review.

How about

The precision of the datetime data. Only supports
``"s"``, ``"ms"``, ``"us"``, ``"ns"``.

as same as error message?

if unit not in ["s", "ms", "us", "ns"]:
    raise ValueError("DatetimeTZDtype only supports s, ms, us, ns units")

Copy link
Member

Choose a reason for hiding this comment

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

Yes sure, Only supports and Valid options are both sound good to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated!

483b9cc

to ``"ns"``.
to ``"s"``, ``"ms"``, ``"us"``, ``"ns"``.
tz : str, int, or datetime.tzinfo
The timezone.

Expand Down