From 6427808a51bb8248327abd8e1f6d2c43dcba321d Mon Sep 17 00:00:00 2001 From: ivonastojanovic <80911834+ivonastojanovic@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:18:12 +0000 Subject: [PATCH 1/2] Add docstrings to fixtures in /series/methods/test_drop_duplicates.py --- .../series/methods/test_drop_duplicates.py | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/pandas/tests/series/methods/test_drop_duplicates.py b/pandas/tests/series/methods/test_drop_duplicates.py index 31ef8ff896bcc..ed2502be12296 100644 --- a/pandas/tests/series/methods/test_drop_duplicates.py +++ b/pandas/tests/series/methods/test_drop_duplicates.py @@ -75,10 +75,22 @@ class TestSeriesDropDuplicates: params=["int_", "uint", "float64", "str_", "timedelta64[h]", "datetime64[D]"] ) def dtype(self, request): + """ + Fixture that provides different data types for testing. + The parameterized fixture returns various numpy data types including + integer, unsigned integer, float, string, timedelta, and datetime. + """ return request.param @pytest.fixture def cat_series_unused_category(self, dtype, ordered): + """ + Fixture that creates a Categorical Series with some unused categories. + This fixture creates a Categorical Series based on the given dtype and + ordered parameters. The input series contains some categories that are + not used in the actual data, allowing the testing of categorical + behavior with unused categories. + """ # Test case 1 cat_array = np.array([1, 2, 3, 4, 5], dtype=np.dtype(dtype)) @@ -141,7 +153,13 @@ def test_drop_duplicates_categorical_non_bool_keepfalse( @pytest.fixture def cat_series(self, dtype, ordered): - # no unused categories, unlike cat_series_unused_category + """ + Fixture that creates a Categorical Series with no unused categories. + This fixture creates a Categorical Series based on the given dtype and + ordered parameters. The input series contains categories that are all + used in the actual data, allowing the testing of categorical behavior + without unused categories. + """ cat_array = np.array([1, 2, 3, 4, 5], dtype=np.dtype(dtype)) input2 = np.array([1, 2, 3, 5, 3, 2, 4], dtype=np.dtype(dtype)) From 9745485960525b4c93a74fbb54ed56cf38ce5afe Mon Sep 17 00:00:00 2001 From: ivonastojanovic <80911834+ivonastojanovic@users.noreply.github.com> Date: Thu, 18 Jul 2024 20:13:16 +0000 Subject: [PATCH 2/2] fixup! Add docstrings to fixtures in /series/methods/test_drop_duplicates.py --- pandas/tests/series/methods/test_drop_duplicates.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/pandas/tests/series/methods/test_drop_duplicates.py b/pandas/tests/series/methods/test_drop_duplicates.py index ed2502be12296..2dbd61530dc41 100644 --- a/pandas/tests/series/methods/test_drop_duplicates.py +++ b/pandas/tests/series/methods/test_drop_duplicates.py @@ -77,8 +77,6 @@ class TestSeriesDropDuplicates: def dtype(self, request): """ Fixture that provides different data types for testing. - The parameterized fixture returns various numpy data types including - integer, unsigned integer, float, string, timedelta, and datetime. """ return request.param @@ -86,10 +84,6 @@ def dtype(self, request): def cat_series_unused_category(self, dtype, ordered): """ Fixture that creates a Categorical Series with some unused categories. - This fixture creates a Categorical Series based on the given dtype and - ordered parameters. The input series contains some categories that are - not used in the actual data, allowing the testing of categorical - behavior with unused categories. """ # Test case 1 cat_array = np.array([1, 2, 3, 4, 5], dtype=np.dtype(dtype)) @@ -155,10 +149,6 @@ def test_drop_duplicates_categorical_non_bool_keepfalse( def cat_series(self, dtype, ordered): """ Fixture that creates a Categorical Series with no unused categories. - This fixture creates a Categorical Series based on the given dtype and - ordered parameters. The input series contains categories that are all - used in the actual data, allowing the testing of categorical behavior - without unused categories. """ cat_array = np.array([1, 2, 3, 4, 5], dtype=np.dtype(dtype))