Skip to content

STYLE: dont use pd api types in tests #39293

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

nofarm3
Copy link
Contributor

@nofarm3 nofarm3 commented Jan 20, 2021

I didn't add a whatsnew entry since it's only style fixes.
I'll open a new issue regarding @jreback suggestion to ban this with a precommit style rule.
I prefer it to be done in a different PR.

@jreback jreback changed the title Issue 39203 dont use pd api types in tests STYLE: dont use pd api types in tests Jan 20, 2021
@jreback jreback added the Code Style Code style, linting, code_checks label Jan 20, 2021
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

lgtm. one comment. ping on green. you can add a precommit rule in this PR or as a followup.

@simonjayhawkins simonjayhawkins added this to the 1.3 milestone Jan 20, 2021
@MarcoGorelli
Copy link
Member

Thanks @nofarm3

I'll open a new issue regarding @jreback suggestion to ban this with a precommit style rule.
I prefer it to be done in a different PR.

Any chance this could be done in the same PR, so that it can be seen to be fixed? This is analogous to adding tests in the same PR in which one fixes a bug

@nofarm3
Copy link
Contributor Author

nofarm3 commented Jan 20, 2021

@MarcoGorelli
Yes it make sense. no problem I'll add this to this PR.

@MarcoGorelli
Copy link
Member

sure - do ask if it's not something you're familiar with, I think it should be enough to just add a line to the non-standard-imports-in-tests hook

@nofarm3
Copy link
Contributor Author

nofarm3 commented Jan 20, 2021

@MarcoGorelli
I added a hook that validates there is no usage in pd.api.types under pandas/tests/.
Do you think it's good enough for now?

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.

Nice, thanks @nofarm3 ! Just one small comment, then I think it's good to go

jorisvandenbossche and others added 25 commits January 21, 2021 11:29
* CLN: avoid pd import in computation/expr.py

* CLN: avoid pd import in computation/pytables
…s-in-tests' into issue-39203-dont-use-pd-api-types-in-tests

# Conflicts:
#	.pre-commit-config.yaml
@jreback jreback merged commit cb0d339 into pandas-dev:master Jan 21, 2021
@jreback
Copy link
Contributor

jreback commented Jan 21, 2021

thanks @nofarm3

@nofarm3 nofarm3 deleted the issue-39203-dont-use-pd-api-types-in-tests branch January 21, 2021 17:30
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.

STYLE: dont' use pd.api.types anywhere in tests