Skip to content

CLN: Clean frame/test_constructors.py #32610

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 2 commits into from
Mar 14, 2020
Merged

CLN: Clean frame/test_constructors.py #32610

merged 2 commits into from
Mar 14, 2020

Conversation

dsaxton
Copy link
Member

@dsaxton dsaxton commented Mar 11, 2020

I think these classes are all imported directly so don't need to reference the pandas namespace

@WillAyd
Copy link
Member

WillAyd commented Mar 11, 2020

OK as a one off, though @jorisvandenbossche I think and I generally prefer the way things are here.

I know @jreback disagrees and prefers what you've done, but we don't have a consensus to do things like this generally

@dsaxton
Copy link
Member Author

dsaxton commented Mar 11, 2020

OK as a one off, though @jorisvandenbossche I think and I generally prefer the way things are here.

I know @jreback disagrees and prefers what you've done, but we don't have a consensus to do things like this generally

I was thinking the tests might run ever so slightly faster if we refer to (for example) Series instead of pd.Series when it's already imported

@jreback
Copy link
Contributor

jreback commented Mar 11, 2020

what I don't want are mixed uses in a single file, IOW pd.Series and Series are not good. slight preference to using Series, but wouldn't wholesale change things.

@jreback
Copy link
Contributor

jreback commented Mar 11, 2020

I was thinking the tests might run ever so slightly faster if we refer to (for example) Series instead of pd.Series when it's already imported

this is not a consideration at all. In testing its all about coverage and clarity, while being as concise as possible.

@jreback jreback added the Testing pandas testing functions or related to the test suite label Mar 11, 2020
@jorisvandenbossche
Copy link
Member

OK as a one off, though @jorisvandenbossche I think and I generally prefer the way things are here.

That's correct
(in general we should for sure try to use the public namespeace where possible in tests. Of course, from pandas import Series and import pandas as pd are both perfectly fine public ways to access Series in this case (on constract to eg from pandas.core.series import Series). But using pd for top-level objects is closer to how I (and I think most contributors) typically code, and avoids long imports)

Also agreed with @jreback that consistency within a file is more important.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

having stated above this lgtm

@jreback jreback added this to the 1.1 milestone Mar 14, 2020
@jreback jreback merged commit d691633 into pandas-dev:master Mar 14, 2020
@jreback
Copy link
Contributor

jreback commented Mar 14, 2020

thanks @dsaxton

@dsaxton dsaxton deleted the clean-test branch March 14, 2020 19:44
SeeminSyed pushed a commit to CSCD01-team01/pandas that referenced this pull request Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants