From b9d829361223a4b5df55fffecfcdfd683929c915 Mon Sep 17 00:00:00 2001 From: William Joshua King Date: Thu, 15 Feb 2024 18:51:20 -0500 Subject: [PATCH 1/3] DOC: fix SA05 errors in docstrings for pandas.core.window Expanding and Rolling, and SeriesGroupBy --- ci/code_checks.sh | 8 -------- pandas/core/window/expanding.py | 4 ++-- pandas/core/window/rolling.py | 8 ++++---- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index f3666647f47e1..ea69ab3abe038 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -3182,14 +3182,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.util.hash_pandas_object # There should be no backslash in the final line, please keep this comment in the last ignored function RET=$(($RET + $?)) ; echo $MSG "DONE" - MSG='Partially validate docstrings (SA05)' ; echo $MSG - $BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=SA05 --ignore_functions \ - pandas.core.groupby.SeriesGroupBy.first\ - pandas.core.groupby.SeriesGroupBy.last\ - pandas.core.window.expanding.Expanding.aggregate\ - pandas.core.window.rolling.Rolling.aggregate # There should be no backslash in the final line, please keep this comment in the last ignored function - RET=$(($RET + $?)) ; echo $MSG "DONE" - fi ### DOCUMENTATION NOTEBOOKS ### diff --git a/pandas/core/window/expanding.py b/pandas/core/window/expanding.py index c048c4a506629..c3ee53c1b4551 100644 --- a/pandas/core/window/expanding.py +++ b/pandas/core/window/expanding.py @@ -139,8 +139,8 @@ def _get_window_indexer(self) -> BaseIndexer: """ See Also -------- - pandas.DataFrame.aggregate : Similar DataFrame method. - pandas.Series.aggregate : Similar Series method. + DataFrame.aggregate : Similar DataFrame method. + Series.aggregate : Similar Series method. """ ), examples=dedent( diff --git a/pandas/core/window/rolling.py b/pandas/core/window/rolling.py index 9e42a9033fb66..aa55dd41f0997 100644 --- a/pandas/core/window/rolling.py +++ b/pandas/core/window/rolling.py @@ -1216,8 +1216,8 @@ def calc(x): """ See Also -------- - pandas.DataFrame.aggregate : Similar DataFrame method. - pandas.Series.aggregate : Similar Series method. + DataFrame.aggregate : Similar DataFrame method. + Series.aggregate : Similar Series method. """ ), examples=dedent( @@ -1906,8 +1906,8 @@ def _raise_monotonic_error(self, msg: str): """ See Also -------- - pandas.Series.rolling : Calling object with Series data. - pandas.DataFrame.rolling : Calling object with DataFrame data. + Series.rolling : Calling object with Series data. + DataFrame.rolling : Calling object with DataFrame data. """ ), examples=dedent( From 43209e798dd86237a39b667932b4ec438a4ae059 Mon Sep 17 00:00:00 2001 From: William Joshua King Date: Thu, 15 Feb 2024 20:32:41 -0500 Subject: [PATCH 2/3] Reverted changes on removing SA05 check --- ci/code_checks.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index ea69ab3abe038..9a4ef86981c75 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -3182,6 +3182,10 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.util.hash_pandas_object # There should be no backslash in the final line, please keep this comment in the last ignored function RET=$(($RET + $?)) ; echo $MSG "DONE" + MSG='Partially validate docstrings (SA05)' ; echo $MSG + $BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=SA05 + RET=$(($RET + $?)) ; echo $MSG "DONE" + fi ### DOCUMENTATION NOTEBOOKS ### From 4f031767119f056d92bf0829d3c8facf058d73e1 Mon Sep 17 00:00:00 2001 From: William Joshua King Date: Thu, 15 Feb 2024 21:08:46 -0500 Subject: [PATCH 3/3] Added SA05 to list of errors for validate docstrings --- ci/code_checks.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 9a4ef86981c75..231d40e17c0c0 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -65,8 +65,8 @@ fi ### DOCSTRINGS ### if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then - MSG='Validate docstrings (EX01, EX03, EX04, GL01, GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, PR03, PR04, PR05, PR06, PR08, PR09, PR10, RT01, RT02, RT04, RT05, SA02, SA03, SA04, SS01, SS02, SS03, SS04, SS05, SS06)' ; echo $MSG - $BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX01,EX03,EX04,GL01,GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,PR03,PR04,PR05,PR06,PR08,PR09,PR10,RT01,RT02,RT04,RT05,SA02,SA03,SA04,SS01,SS02,SS03,SS04,SS05,SS06 + MSG='Validate docstrings (EX01, EX03, EX04, GL01, GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, PR03, PR04, PR05, PR06, PR08, PR09, PR10, RT01, RT02, RT04, RT05, SA02, SA03, SA04, SA05, SS01, SS02, SS03, SS04, SS05, SS06)' ; echo $MSG + $BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX01,EX03,EX04,GL01,GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,PR03,PR04,PR05,PR06,PR08,PR09,PR10,RT01,RT02,RT04,RT05,SA02,SA03,SA04,SA05,SS01,SS02,SS03,SS04,SS05,SS06 RET=$(($RET + $?)) ; echo $MSG "DONE" MSG='Partially validate docstrings (PR02)' ; echo $MSG @@ -3182,10 +3182,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.util.hash_pandas_object # There should be no backslash in the final line, please keep this comment in the last ignored function RET=$(($RET + $?)) ; echo $MSG "DONE" - MSG='Partially validate docstrings (SA05)' ; echo $MSG - $BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=SA05 - RET=$(($RET + $?)) ; echo $MSG "DONE" - fi ### DOCUMENTATION NOTEBOOKS ###