Skip to content

Commit

Permalink
DOC: Fixing SA01 issues for DatetimeIndex: date and tz (#58377)
Browse files Browse the repository at this point in the history
* DOC: Fixing SA01 issues for DatetimeIndex: date and tz

* fixing: XPECTED TO FAIL, BUT NOT FAILING error
  • Loading branch information
KeiOshima committed Apr 22, 2024
1 parent 963ce7a commit 0cafd10
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 0 additions & 4 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.DataFrame.to_markdown SA01" \
-i "pandas.DataFrame.to_parquet RT03" \
-i "pandas.DataFrame.var PR01,RT03,SA01" \
-i "pandas.DatetimeIndex.date SA01" \
-i "pandas.DatetimeIndex.day_of_year SA01" \
-i "pandas.DatetimeIndex.dayofyear SA01" \
-i "pandas.DatetimeIndex.freqstr SA01" \
Expand All @@ -115,7 +114,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.DatetimeIndex.std PR01,RT03" \
-i "pandas.DatetimeIndex.to_period RT03" \
-i "pandas.DatetimeIndex.to_pydatetime RT03,SA01" \
-i "pandas.DatetimeIndex.tz SA01" \
-i "pandas.DatetimeIndex.tz_convert RT03" \
-i "pandas.DatetimeTZDtype SA01" \
-i "pandas.DatetimeTZDtype.tz SA01" \
Expand Down Expand Up @@ -270,7 +268,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Series.dt.as_unit PR01,PR02" \
-i "pandas.Series.dt.ceil PR01,PR02" \
-i "pandas.Series.dt.components SA01" \
-i "pandas.Series.dt.date SA01" \
-i "pandas.Series.dt.day_name PR01,PR02" \
-i "pandas.Series.dt.day_of_year SA01" \
-i "pandas.Series.dt.dayofyear SA01" \
Expand All @@ -290,7 +287,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Series.dt.strftime PR01,PR02" \
-i "pandas.Series.dt.to_period PR01,PR02,RT03" \
-i "pandas.Series.dt.total_seconds PR01" \
-i "pandas.Series.dt.tz SA01" \
-i "pandas.Series.dt.tz_convert PR01,PR02,RT03" \
-i "pandas.Series.dt.tz_localize PR01,PR02" \
-i "pandas.Series.dt.unit GL08" \
Expand Down
15 changes: 15 additions & 0 deletions pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,13 @@ def tz(self) -> tzinfo | None:
datetime.tzinfo, pytz.tzinfo.BaseTZInfo, dateutil.tz.tz.tzfile, or None
Returns None when the array is tz-naive.
See Also
--------
DatetimeIndex.tz_localize : Localize tz-naive DatetimeIndex to a
given time zone, or remove timezone from a tz-aware DatetimeIndex.
DatetimeIndex.tz_convert : Convert tz-aware DatetimeIndex from
one time zone to another.
Examples
--------
For Series:
Expand Down Expand Up @@ -1476,6 +1483,14 @@ def date(self) -> npt.NDArray[np.object_]:
Namely, the date part of Timestamps without time and
timezone information.
See Also
--------
DatetimeIndex.time : Returns numpy array of :class:`datetime.time` objects.
The time part of the Timestamps.
DatetimeIndex.year : The year of the datetime.
DatetimeIndex.month : The month as January=1, December=12.
DatetimeIndex.day : The day of the datetime.
Examples
--------
For Series:
Expand Down

0 comments on commit 0cafd10

Please sign in to comment.