Skip to content

use ensure_clean rather than explicit os.remove #34384 #34385

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 61 commits into from
Oct 12, 2020

Conversation

jnecus
Copy link
Contributor

@jnecus jnecus commented May 26, 2020

closes #34384
I have made a start at this issue #34384. Please let me know if I am along the right lines (beginner contributor).

I've left a space in code_checks.sh where I expect to implement the check for instances of 'os.remove' throughout the code.

@jreback jreback added the Testing pandas testing functions or related to the test suite label May 26, 2020
@jnecus
Copy link
Contributor Author

jnecus commented May 26, 2020

This PR seems to have include all commits from a pull-request of mine which has been merged previously. Not sure why, if anybody thinks they know please let me know.

@pep8speaks
Copy link

pep8speaks commented May 26, 2020

Hello @jnecus! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-10-12 09:36:39 UTC

@MarcoGorelli
Copy link
Member

This PR seems to have include all commits from a pull-request of mine which has been merged previously. Not sure why, if anybody thinks they know please let me know.

It looks like you opened your pull request from master. It's advisable to start each new pull request from a new branch, and that (when you start working on it) that branch be synced up with upstream master.

See creating a branch

With how your branch is now, if you don't want your old commits, I think you'd have to do something like (assuming upstream is https://github.com/pandas-dev/pandas)

git fetch upstream master
git rebase -i upstream/master

and then drop the commits from your previous pull request. Once that's done, you'd have to do a forced push.

new_f, keys=keys, propindexes=propindexes, **kwargs
)
tstore = store.copy(
new_f, keys=keys, propindexes=propindexes, **kwargs)
Copy link
Member

Choose a reason for hiding this comment

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

the previous line too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

circle CI tests fail when changing this back, prompting me to correct the linting using 'black'

Copy link
Member

Choose a reason for hiding this comment

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

If I've understood correctly, the issue is that the whole block (lines 4219 - 4221) need moving back an indent, not just the first line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I see thanks. Changed.

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.

small comment, merge master and ping on green-ish

@jbrockmendel
Copy link
Member

LGTM pending green; @jnecus can you merge master

@jreback
Copy link
Contributor

jreback commented Oct 11, 2020

can you merge master again; also ideally would have a check for using these in code_checks.sh (but can be a followon is ok too)

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. would appreciate a followon to add to code_checks.sh as well

@jreback jreback merged commit a470a63 into pandas-dev:master Oct 12, 2020
@jreback
Copy link
Contributor

jreback commented Oct 12, 2020

thanks @jnecus

@jnecus
Copy link
Contributor Author

jnecus commented Oct 12, 2020

@jreback Happy to do a followon code check, what are you suggesting to check for? Instances of os.remove? If so, this was tried originally (the following quote).

i think we may have to remove the code check for this (and just push the patches) as need os.remove in some places (though maybe can check other files and just skip the pytables ones)

@jreback
Copy link
Contributor

jreback commented Oct 12, 2020

yes exactly i think we don't allow os.remove except in the 1 place that we allow it now (so will have to filter the grep a bit)

iow we have a set of cases that we allow it (one for now)

@MarcoGorelli
Copy link
Member

I've opened #37095 as a placeholder for this, @jnecus please reference it if you open a PR for this (and let us know if you want/need any help)

JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Oct 26, 2020
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 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.

TST: use ensure_clean rather than explicit os.remove
6 participants