Skip to content

TST: Cleanup tests from numeric_only / nuisance deprecation #50133

Open
@rhshadrach

Description

@rhshadrach

In enforcing the numeric_only / silent dropping of nuisance columns deprecations for 2.0, many of our tests now have the following pattern:

df = pd.DataFrame({'a': [1, 2, 3], 'b': ['x', 'y', 'z']})
with pytest.raises(TypeError, match=...):
   df.mean()
result = df.mean(numeric_only=True)
expected = ...
tm.assert_series_equal(result, expected)

I think it would be better to consolidate these into a small group of tests, something like test_op_raises_on_invalid_type, and remove the invalid types from the remainder of the tests.

cc @mroeschke

Metadata

Metadata

Assignees

Labels

CleanNuisance ColumnsIdentifying/Dropping nuisance columns in reductions, groupby.add, DataFrame.applyTestingpandas testing functions or related to the test suite

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions