Skip to content

Commit bfe5a22

Browse files
authored
DOC: Enforce Numpy Docstring Validation - Timestamp.strftime and Timestamp.isoformat (#58677)
* DOC: add See also section to Timestamp.strftime and Timestamp.isoformat * ensure NaT.strftime docstring matches Timestamp.strftime
1 parent 3ecf177 commit bfe5a22

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

ci/code_checks.sh

-2
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
283283
-i "pandas.Timestamp.hour GL08" \
284284
-i "pandas.Timestamp.is_leap_year SA01" \
285285
-i "pandas.Timestamp.isocalendar SA01" \
286-
-i "pandas.Timestamp.isoformat SA01" \
287286
-i "pandas.Timestamp.isoweekday SA01" \
288287
-i "pandas.Timestamp.max PR02" \
289288
-i "pandas.Timestamp.microsecond GL08" \
@@ -299,7 +298,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
299298
-i "pandas.Timestamp.resolution PR02,PR07,SA01" \
300299
-i "pandas.Timestamp.round SA01" \
301300
-i "pandas.Timestamp.second GL08" \
302-
-i "pandas.Timestamp.strftime SA01" \
303301
-i "pandas.Timestamp.strptime PR01,SA01" \
304302
-i "pandas.Timestamp.time SA01" \
305303
-i "pandas.Timestamp.timestamp SA01" \

pandas/_libs/tslibs/nattype.pyx

+6
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,12 @@ class NaTType(_NaT):
692692
See strftime documentation for more information on the format string:
693693
https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior.
694694
695+
See Also
696+
--------
697+
Timestamp.isoformat : Return the time formatted according to ISO 8601.
698+
pd.to_datetime : Convert argument to datetime.
699+
Period.strftime : Format a single Period.
700+
695701
Examples
696702
--------
697703
>>> ts = pd.Timestamp('2020-03-14T15:32:52.192548651')

pandas/_libs/tslibs/timestamps.pyx

+12
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,12 @@ cdef class _Timestamp(ABCTimestamp):
10081008
-------
10091009
str
10101010

1011+
See Also
1012+
--------
1013+
Timestamp.strftime : Return a formatted string.
1014+
Timestamp.isocalendar : Return a tuple containing ISO year, week number and
1015+
weekday.
1016+
10111017
Examples
10121018
--------
10131019
>>> ts = pd.Timestamp('2020-03-14T15:32:52.192548651')
@@ -1549,6 +1555,12 @@ class Timestamp(_Timestamp):
15491555
See strftime documentation for more information on the format string:
15501556
https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior.
15511557
1558+
See Also
1559+
--------
1560+
Timestamp.isoformat : Return the time formatted according to ISO 8601.
1561+
pd.to_datetime : Convert argument to datetime.
1562+
Period.strftime : Format a single Period.
1563+
15521564
Examples
15531565
--------
15541566
>>> ts = pd.Timestamp('2020-03-14T15:32:52.192548651')

0 commit comments

Comments
 (0)