Skip to content

DOC: Add docstrings to fixtures in /series/methods/test_drop_duplicates.py #59265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion pandas/tests/series/methods/test_drop_duplicates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you ensure these docstrings just fit on one line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean to write a shorter description or the same description in just one line?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both I would say. These docstrings aren't entirely critical so it's best to be succinct.

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))

Expand Down Expand Up @@ -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))
Expand Down