Skip to content

Commit

Permalink
DOC: Enforce Numpy Docstring Validation for pandas.Timestamp.utcnow (#…
Browse files Browse the repository at this point in the history
…58629)

* DOC: add SA01 pandas.Timestamp.utcnow

* DOC: remove SA01 pandas.Timestamp.utcnow

* DOC: add SA01 to nattype
  • Loading branch information
tuhinsharma121 authored May 8, 2024
1 parent 96ef51e commit 99e6938
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Timestamp.tzname SA01" \
-i "pandas.Timestamp.unit SA01" \
-i "pandas.Timestamp.utcfromtimestamp PR01,SA01" \
-i "pandas.Timestamp.utcnow SA01" \
-i "pandas.Timestamp.utcoffset SA01" \
-i "pandas.Timestamp.utctimetuple SA01" \
-i "pandas.Timestamp.value GL08" \
Expand Down
12 changes: 12 additions & 0 deletions pandas/_libs/tslibs/nattype.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,18 @@ class NaTType(_NaT):
Return a new Timestamp representing UTC day and time.
See Also
--------
Timestamp : Constructs an arbitrary datetime.
Timestamp.now : Return the current local date and time, which
can be timezone-aware.
Timestamp.today : Return the current local date and time with
timezone information set to None.
to_datetime : Convert argument to datetime.
date_range : Return a fixed frequency DatetimeIndex.
Timestamp.utctimetuple : Return UTC time tuple, compatible with
time.localtime().
Examples
--------
>>> pd.Timestamp.utcnow() # doctest: +SKIP
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 @@ -1460,6 +1460,18 @@ class Timestamp(_Timestamp):
Return a new Timestamp representing UTC day and time.
See Also
--------
Timestamp : Constructs an arbitrary datetime.
Timestamp.now : Return the current local date and time, which
can be timezone-aware.
Timestamp.today : Return the current local date and time with
timezone information set to None.
to_datetime : Convert argument to datetime.
date_range : Return a fixed frequency DatetimeIndex.
Timestamp.utctimetuple : Return UTC time tuple, compatible with
time.localtime().
Examples
--------
>>> pd.Timestamp.utcnow() # doctest: +SKIP
Expand Down

0 comments on commit 99e6938

Please sign in to comment.