From e8110e8bffa97402bfa59eeea30d315be2a64a37 Mon Sep 17 00:00:00 2001 From: Anh Trinh Date: Sat, 13 Jan 2024 06:49:10 +0100 Subject: [PATCH 1/3] DOC: fix EX03 errors in docstrings --- pandas/core/indexes/base.py | 3 ++- pandas/core/indexes/multi.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index a2666cd6cb229..1663a5a78225f 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -2124,7 +2124,8 @@ def droplevel(self, level: IndexLabel = 0): Examples -------- >>> mi = pd.MultiIndex.from_arrays( - ... [[1, 2], [3, 4], [5, 6]], names=['x', 'y', 'z']) + ... [[1, 2], [3, 4], [5, 6]], names=['x', 'y', 'z'] + ... ) >>> mi MultiIndex([(1, 3, 5), (2, 4, 6)], diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index 25bcc1f307082..6bcfaa6d26fc2 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -1638,7 +1638,8 @@ def _set_names(self, names, *, level=None, validate: bool = True) -> None: Examples -------- >>> mi = pd.MultiIndex.from_arrays( - ... [[1, 2], [3, 4], [5, 6]], names=['x', 'y', 'z']) + ... [[1, 2], [3, 4], [5, 6]], names=['x', 'y', 'z'] + ... ) >>> mi MultiIndex([(1, 3, 5), (2, 4, 6)], From 0c0982004d6c80adcd65c35499c18e9f6257fcc9 Mon Sep 17 00:00:00 2001 From: Anh Trinh Date: Mon, 15 Jan 2024 23:57:48 +0100 Subject: [PATCH 2/3] Fix CI not raised when there's an error --- ci/code_checks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 145be3e52f2c0..c90645374b2f3 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -95,7 +95,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.DataFrame.groupby \ pandas.DataFrame.sort_values \ pandas.DataFrame.plot.hexbin \ - pandas.DataFrame.plot.line \ + pandas.DataFrame.plot.line RET=$(($RET + $?)) ; echo $MSG "DONE" fi From 421d25ae757aac67390cc0d7264da38abed785fe Mon Sep 17 00:00:00 2001 From: Anh Trinh Date: Tue, 16 Jan 2024 00:00:10 +0100 Subject: [PATCH 3/3] DOC: Fix EX03 errors --- pandas/core/arrays/datetimes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py index cd6689e9f1ce2..e251bd28245e7 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -213,7 +213,10 @@ class DatetimeArray(dtl.TimelikeOps, dtl.DatelikeOps): # type: ignore[misc] Examples -------- >>> pd.arrays.DatetimeArray._from_sequence( - ... pd.DatetimeIndex(['2023-01-01', '2023-01-02'], freq='D')) + ... pd.DatetimeIndex( + ... ["2023-01-01", "2023-01-02"], freq="D" + ... ) + ... ) ['2023-01-01 00:00:00', '2023-01-02 00:00:00'] Length: 2, dtype: datetime64[ns]