Skip to content

PERF: extract_array -> _values #40150

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 1, 2021

Conversation

jbrockmendel
Copy link
Member

Found that grepping for uses of pd.array is a PITA, so went through and changed them all (inside core) to pd_array. @MarcoGorelli would it be feasible to make a code check for this?

@MarcoGorelli
Copy link
Member

Should we then also use consistently pd_array in tests and remove the line

"array", # `import array` and `pd.array` should both be allowed

? cc @jorisvandenbossche as you're commented on pd_array previously

@jbrockmendel
Copy link
Member Author

Should we then also use consistently pd_array in tests and remove the line

another option would be to define it pd_array in core.construction and import it into the pd namespace as array

@jorisvandenbossche
Copy link
Member

Should we then also use consistently pd_array in tests and remove the line

For me this PR doesn't change what I said previously about it. In tests we should prefer to use public API where possible, this PR is about internal imports.

another option would be to define it pd_array in core.construction and import it into the pd namespace as array

That doesn't solve the issue that I want it as pd.array in the tests, though ;)

@MarcoGorelli
Copy link
Member

understood - thanks for explaining!

@jreback jreback added the Performance Memory or execution speed performance label Mar 1, 2021
@jreback jreback added this to the 1.3 milestone Mar 1, 2021
@jreback jreback merged commit bc0bcae into pandas-dev:master Mar 1, 2021
@jreback
Copy link
Contributor

jreback commented Mar 1, 2021

any non-trivial perf impact?

and should we have a rule for internal tests? (to use pd_array)?

@jbrockmendel
Copy link
Member Author

another option would be to define it pd_array in core.construction and import it into the pd namespace as array

That doesn't solve the issue that I want it as pd.array in the tests, though ;)

Maybe I communicated poorly. The ideas was that pd.__init__ could have from pandas.core.construction import pd_array as array, so tests could still use pd.array or from pandas import array

@jbrockmendel jbrockmendel deleted the perf-extract_array branch March 1, 2021 22:50
@jorisvandenbossche
Copy link
Member

@jbrockmendel I understood that correctly ;) (but so then it doesn't matter for tests, and since you were replying to Marco's comment about tests, I thought it was related to that)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Performance Memory or execution speed performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants