Skip to content

Remove pd_array from tests #40267

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

Conversation

olgarithms
Copy link
Contributor

@MarcoGorelli MarcoGorelli self-requested a review March 6, 2021 15:07
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Thanks @olgarithms looks good

I forgot to mention this when I wrote the issue, but now we can make the relevant CI check stricter. Could you please also:

  • in pandas/tests/frame/test_constructors.py, change test_constructor_stdlib_array test so it has from array import stdlib_array instead of import array (and then use stdlib_array instead of array.array in that little test)
  • in scripts/check_for_inconsistent_pandas_namespace.py, line 32, remove array
  • run pre-commit run inconsistent-namespace-usage --all-files and check it passes

Then this should be good to go 👍

cc @jorisvandenbossche @jbrockmendel as you'd both commented on pd_array usage (in #40150 it seemed there was agreement on using pd_array internally in core, and the public API pd.array in tests)

@olgarithms
Copy link
Contributor Author

Thanks for looking @MarcoGorelli !

As for the changes, I understand the one for the pre-commit, but can you explain what stdlib_array is and where it is supposed to live? I do not see where it is defined.

When I do the change as you mention, I get this error:
ImportError: cannot import name 'stdlib_array' from 'array'

@MarcoGorelli MarcoGorelli self-requested a review March 6, 2021 20:16
@MarcoGorelli
Copy link
Member

Hey @olgarithms - sorry, I mistyped, I mean to write from array import array as stdlib_array (array is a standard library module)

@MarcoGorelli MarcoGorelli added the Code Style Code style, linting, code_checks label Mar 6, 2021
@MarcoGorelli MarcoGorelli added this to the 1.3 milestone Mar 6, 2021
@MarcoGorelli MarcoGorelli merged commit 4810d74 into pandas-dev:master Mar 7, 2021
@MarcoGorelli
Copy link
Member

Thanks @olgarithms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants