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

DOC: Enforce Numpy Docstring Validation - Timestamp.strftime and Timestamp.isoformat #58677

Merged
merged 2 commits into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Timestamp.hour GL08" \
-i "pandas.Timestamp.is_leap_year SA01" \
-i "pandas.Timestamp.isocalendar SA01" \
-i "pandas.Timestamp.isoformat SA01" \
-i "pandas.Timestamp.isoweekday SA01" \
-i "pandas.Timestamp.max PR02" \
-i "pandas.Timestamp.microsecond GL08" \
Expand All @@ -305,7 +304,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Timestamp.resolution PR02,PR07,SA01" \
-i "pandas.Timestamp.round SA01" \
-i "pandas.Timestamp.second GL08" \
-i "pandas.Timestamp.strftime SA01" \
-i "pandas.Timestamp.strptime PR01,SA01" \
-i "pandas.Timestamp.time SA01" \
-i "pandas.Timestamp.timestamp SA01" \
Expand Down
6 changes: 6 additions & 0 deletions pandas/_libs/tslibs/nattype.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,12 @@ class NaTType(_NaT):
See strftime documentation for more information on the format string:
https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior.

See Also
--------
Timestamp.isoformat : Return the time formatted according to ISO 8601.
pd.to_datetime : Convert argument to datetime.
Period.strftime : Format a single Period.

Examples
--------
>>> ts = pd.Timestamp('2020-03-14T15:32:52.192548651')
Expand Down
12 changes: 12 additions & 0 deletions pandas/_libs/tslibs/timestamps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,12 @@ cdef class _Timestamp(ABCTimestamp):
-------
str

See Also
--------
Timestamp.strftime : Return a formatted string.
Timestamp.isocalendar : Return a tuple containing ISO year, week number and
weekday.

Examples
--------
>>> ts = pd.Timestamp('2020-03-14T15:32:52.192548651')
Expand Down Expand Up @@ -1543,6 +1549,12 @@ class Timestamp(_Timestamp):
See strftime documentation for more information on the format string:
https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior.

See Also
--------
Timestamp.isoformat : Return the time formatted according to ISO 8601.
pd.to_datetime : Convert argument to datetime.
Period.strftime : Format a single Period.

Examples
--------
>>> ts = pd.Timestamp('2020-03-14T15:32:52.192548651')
Expand Down