Skip to content

Commit 5a617b1

Browse files
DOC: Enforce Numpy Docstring Validation for pandas.Timestamp.as_unit and pandas.Timedelta.as_unit (#58609)
* DOC: add SA01 for pandas.Timestamp.as_unit * DOC: remove SA01 for pandas.Timestamp.as_unit * DOC: add SA01 for pandas.Timedelta.as_unit * DOC: remove SA01 for pandas.Timedelta.as_unit * DOC: remove SA01 for pandas.Timedelta.as_unit
1 parent 882b228 commit 5a617b1

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
281281
-i "pandas.TimedeltaIndex.nanoseconds SA01" \
282282
-i "pandas.TimedeltaIndex.seconds SA01" \
283283
-i "pandas.TimedeltaIndex.to_pytimedelta RT03,SA01" \
284-
-i "pandas.Timestamp.as_unit SA01" \
285284
-i "pandas.Timestamp.asm8 SA01" \
286285
-i "pandas.Timestamp.astimezone SA01" \
287286
-i "pandas.Timestamp.ceil SA01" \

pandas/_libs/tslibs/nattype.pyx

+8
Original file line numberDiff line numberDiff line change
@@ -1383,6 +1383,14 @@ default 'raise'
13831383
-------
13841384
Timestamp
13851385

1386+
See Also
1387+
--------
1388+
Timestamp.asm8 : Return numpy datetime64 format in nanoseconds.
1389+
Timestamp.to_pydatetime : Convert Timestamp object to a native
1390+
Python datetime object.
1391+
to_timedelta : Convert argument into timedelta object,
1392+
which can represent differences in times.
1393+
13861394
Examples
13871395
--------
13881396
>>> ts = pd.Timestamp('2023-01-01 00:00:00.01')

pandas/_libs/tslibs/timestamps.pyx

+8
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,14 @@ cdef class _Timestamp(ABCTimestamp):
11151115
-------
11161116
Timestamp
11171117
1118+
See Also
1119+
--------
1120+
Timestamp.asm8 : Return numpy datetime64 format in nanoseconds.
1121+
Timestamp.to_pydatetime : Convert Timestamp object to a native
1122+
Python datetime object.
1123+
to_timedelta : Convert argument into timedelta object,
1124+
which can represent differences in times.
1125+
11181126
Examples
11191127
--------
11201128
>>> ts = pd.Timestamp('2023-01-01 00:00:00.01')

0 commit comments

Comments
 (0)