Skip to content

TST/CLN: Remove unnecessary copies in tests #56749

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
merged 4 commits into from
Jan 8, 2024

Conversation

mroeschke
Copy link
Member

AFAICT these copies are not necessary or related to whats being tested

@mroeschke mroeschke added Testing pandas testing functions or related to the test suite Clean labels Jan 5, 2024
@mroeschke mroeschke added this to the 3.0 milestone Jan 6, 2024
@@ -177,7 +177,7 @@ def test_nlargest_nullable(self, any_numeric_ea_dtype):
arr = np.random.default_rng(2).standard_normal(10)
arr = arr.astype(dtype.lower(), copy=False)

ser = Series(arr.copy(), dtype=dtype)
Copy link
Member

Choose a reason for hiding this comment

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

This could be dangerous

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure sounds good. Added copy=True to the constructor

@phofl phofl merged commit b293fac into pandas-dev:main Jan 8, 2024
@phofl
Copy link
Member

phofl commented Jan 8, 2024

thx @mroeschke

@mroeschke mroeschke deleted the cln/test/copy branch January 8, 2024 23:46
pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants