From 4e7ace930b5c619e437894cd9d34714feacd6915 Mon Sep 17 00:00:00 2001 From: Natalia Mokeeva Date: Tue, 14 Feb 2023 00:03:54 +0100 Subject: [PATCH 1/5] DOC: fix EX02 errors in docstrings IV --- ci/code_checks.sh | 2 -- pandas/_libs/tslibs/timestamps.pyx | 2 +- pandas/core/groupby/generic.py | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 567ae6da92ae2..2003607e3dd57 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -582,7 +582,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.Series.sparse.density \ pandas.Series.sparse.npoints \ pandas.Series.sparse.sp_values \ - pandas.Timestamp.fromtimestamp \ pandas.api.types.infer_dtype \ pandas.api.types.is_datetime64_any_dtype \ pandas.api.types.is_datetime64_ns_dtype \ @@ -596,7 +595,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.api.types.is_timedelta64_dtype \ pandas.api.types.is_timedelta64_ns_dtype \ pandas.api.types.is_unsigned_integer_dtype \ - pandas.core.groupby.DataFrameGroupBy.take \ pandas.core.groupby.SeriesGroupBy.take \ pandas.io.formats.style.Styler.concat \ pandas.io.formats.style.Styler.export \ diff --git a/pandas/_libs/tslibs/timestamps.pyx b/pandas/_libs/tslibs/timestamps.pyx index 9e9dab155a5cf..b40642a145d0f 100644 --- a/pandas/_libs/tslibs/timestamps.pyx +++ b/pandas/_libs/tslibs/timestamps.pyx @@ -1452,7 +1452,7 @@ class Timestamp(_Timestamp): Examples -------- >>> pd.Timestamp.fromtimestamp(1584199972) - Timestamp('2020-03-14 15:32:52') + Timestamp('2020-03-14 16:32:52') Note that the output may change depending on your local time. """ diff --git a/pandas/core/groupby/generic.py b/pandas/core/groupby/generic.py index 8743f124b033b..fb2f3daeccee5 100644 --- a/pandas/core/groupby/generic.py +++ b/pandas/core/groupby/generic.py @@ -936,7 +936,7 @@ def take( Examples -------- - >>> df = DataFrame([('falcon', 'bird', 389.0), + >>> df = pd.DataFrame([('falcon', 'bird', 389.0), ... ('parrot', 'bird', 24.0), ... ('lion', 'mammal', 80.5), ... ('monkey', 'mammal', np.nan), @@ -2366,7 +2366,7 @@ def take( Examples -------- - >>> df = DataFrame([('falcon', 'bird', 389.0), + >>> df = pd.DataFrame([('falcon', 'bird', 389.0), ... ('parrot', 'bird', 24.0), ... ('lion', 'mammal', 80.5), ... ('monkey', 'mammal', np.nan), From 55cbf75da6fe758d11436f851b304d98d46e25f7 Mon Sep 17 00:00:00 2001 From: Natalia Mokeeva Date: Tue, 14 Feb 2023 23:42:57 +0100 Subject: [PATCH 2/5] add doctest skip --- pandas/_libs/tslibs/timestamps.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/_libs/tslibs/timestamps.pyx b/pandas/_libs/tslibs/timestamps.pyx index b40642a145d0f..33e8344c79d6c 100644 --- a/pandas/_libs/tslibs/timestamps.pyx +++ b/pandas/_libs/tslibs/timestamps.pyx @@ -1451,8 +1451,8 @@ class Timestamp(_Timestamp): Examples -------- - >>> pd.Timestamp.fromtimestamp(1584199972) - Timestamp('2020-03-14 16:32:52') + >>> pd.Timestamp.fromtimestamp(1584199972) # doctest: +SKIP + Timestamp('2020-03-14 15:32:52') Note that the output may change depending on your local time. """ From 33244249f1ae7c2506134dd9ba4933795a9afbb5 Mon Sep 17 00:00:00 2001 From: Natalia Mokeeva Date: Thu, 16 Feb 2023 12:24:46 +0100 Subject: [PATCH 3/5] Resolve merge conflict --- ci/code_checks.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 5ae5d5028a27f..49cb45baea91a 100644 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -576,9 +576,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then $BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX02 --ignore_functions \ pandas.DataFrame.plot.line \ pandas.Series.plot.line \ - pandas.Series.sparse.density \ - pandas.Series.sparse.npoints \ - pandas.Series.sparse.sp_values \ pandas.api.types.infer_dtype \ pandas.api.types.is_datetime64_any_dtype \ pandas.api.types.is_datetime64_ns_dtype \ From 7da751c23d1b8dcd0712017604293b53d2a8ebc0 Mon Sep 17 00:00:00 2001 From: Natalia Mokeeva Date: Thu, 16 Feb 2023 15:32:10 +0100 Subject: [PATCH 4/5] add doctest skip II --- pandas/_libs/tslibs/nattype.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/_libs/tslibs/nattype.pyx b/pandas/_libs/tslibs/nattype.pyx index d9d8ce3bb16d1..ff07f5d799339 100644 --- a/pandas/_libs/tslibs/nattype.pyx +++ b/pandas/_libs/tslibs/nattype.pyx @@ -570,7 +570,7 @@ class NaTType(_NaT): Examples -------- - >>> pd.Timestamp.fromtimestamp(1584199972) + >>> pd.Timestamp.fromtimestamp(1584199972) # doctest: +SKIP Timestamp('2020-03-14 15:32:52') Note that the output may change depending on your local time. From ad95c490ff0da67bc51bba3f445310a7f0be5ff0 Mon Sep 17 00:00:00 2001 From: MarcoGorelli <> Date: Thu, 16 Feb 2023 16:46:40 +0000 Subject: [PATCH 5/5] post-merge fixup --- ci/code_checks.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index add35ffbd3b8e..280375aae9295 100644 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -589,6 +589,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.api.types.is_timedelta64_dtype \ pandas.api.types.is_timedelta64_ns_dtype \ pandas.api.types.is_unsigned_integer_dtype \ + pandas.core.groupby.DataFrameGroupBy.take \ pandas.io.formats.style.Styler.concat \ pandas.io.formats.style.Styler.export \ pandas.io.formats.style.Styler.set_td_classes \