Skip to content

Some code cleanups #31792

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 1 commit into from
Feb 12, 2020
Merged

Some code cleanups #31792

merged 1 commit into from
Feb 12, 2020

Conversation

ShaharNaveh
Copy link
Member

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry


shape = " x ".join(pprint_thing(s) for s in self.shape)
result = (
f"{name}: {pprint_thing(self.mgr_locs.indexer)}, "
Copy link
Member Author

Choose a reason for hiding this comment

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

AFICT the pprint_thing is just a python2 thing.

@jbrockmendel can you please confirm or explain what it is?

Copy link
Member

Choose a reason for hiding this comment

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

Yes - shouldn’t be needed now py3 only. Worth checking though

Copy link
Member

Choose a reason for hiding this comment

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

can you please confirm or explain what it is?

I think it might matter if you were dealing with nested objects, but for these i think it is just a leftover py2 thing

@alimcmaster1
Copy link
Member

alimcmaster1 commented Feb 7, 2020

Seems to have introduced a few test failures? Generally looks good

if isinstance(slicer, tuple):
axis0_slicer = slicer[0]
else:
axis0_slicer = slicer
Copy link
Member

Choose a reason for hiding this comment

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

i tend to like this version because i can see in coverage output whether both cases are reached

Copy link
Member Author

Choose a reason for hiding this comment

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

@jbrockmendel I can see your point, I like the one-liner version because it's making less noise (IMO).

Anyway I am fine with reverting this one and also others.

Can we open a discussion for it (in a separate issue)? so we will put it in Pandas code style guide

Copy link
Contributor

Choose a reason for hiding this comment

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

@jbrockmendel are you sticking on this one? +/- 0 on this.

Copy link
Member

Choose a reason for hiding this comment

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

not a deal breaker

@jreback jreback added this to the 1.1 milestone Feb 9, 2020
@WillAyd WillAyd merged commit bc6ab05 into pandas-dev:master Feb 12, 2020
@WillAyd
Copy link
Member

WillAyd commented Feb 12, 2020

Thanks @MomIsBestFriend

@ShaharNaveh ShaharNaveh deleted the OCD-COLLECTION branch February 29, 2020 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants