Skip to content

STYLE/LINT: Set literals #22202

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 4 commits into from
Aug 6, 2018
Merged

Conversation

mroeschke
Copy link
Member

xref #22122

Use {1, 2, 3} instead of set([1, 2, 3]) and enforce with a linting rule.

@pep8speaks
Copy link

pep8speaks commented Aug 5, 2018

Hello @mroeschke! Thanks for updating the PR.

Cheers ! There are no PEP8 issues in this Pull Request. 🍻

Comment last updated on August 06, 2018 at 01:18 Hours UTC

@mroeschke mroeschke changed the title Style: Use set literals STYLE/LINT: Set literals Aug 5, 2018
@codecov
Copy link

codecov bot commented Aug 5, 2018

Codecov Report

Merging #22202 into master will not change coverage.
The diff coverage is 94.73%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #22202   +/-   ##
=======================================
  Coverage   92.06%   92.06%           
=======================================
  Files         169      169           
  Lines       50694    50694           
=======================================
  Hits        46671    46671           
  Misses       4023     4023
Flag Coverage Δ
#multiple 90.47% <94.73%> (ø) ⬆️
#single 42.32% <47.36%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/panel.py 97.89% <100%> (ø) ⬆️
pandas/core/indexes/interval.py 94.16% <100%> (ø) ⬆️
pandas/core/indexes/base.py 96.37% <100%> (ø) ⬆️
pandas/core/arrays/interval.py 92.55% <100%> (ø) ⬆️
pandas/core/strings.py 98.63% <100%> (ø) ⬆️
pandas/io/common.py 70.65% <100%> (ø) ⬆️
pandas/core/groupby/grouper.py 98.16% <100%> (ø) ⬆️
pandas/core/resample.py 96.09% <100%> (ø) ⬆️
pandas/util/testing.py 85.69% <100%> (ø) ⬆️
pandas/core/computation/expressions.py 93.27% <100%> (ø) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 776fed3...9ff0175. Read the comment docs.

@@ -385,7 +385,7 @@ def test_convert_numeric_uint64_nan(self, coerce, arr):

def test_convert_numeric_uint64_nan_values(self, coerce):
arr = np.array([2**63, 2**63 + 1], dtype=object)
na_values = set([2**63])
na_values = {2 ** 63}
Copy link
Member

Choose a reason for hiding this comment

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

What's the convention for whitespace around **? I thought that one usually stays 2**63.

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like there's some ambiguity for the convention around ** specifically: https://stackoverflow.com/questions/36794533/pep8-e226-recommendation

However this was auto-formatted automatically by PyCharm (which probably takes a strict interpretation of whitespace around arithmetic operators). I'll just convert it back to match the rest of this function (and retrigger a failed build).

@jbrockmendel
Copy link
Member

Pending green, LGTM.

@jbrockmendel
Copy link
Member

I think we’re safe taking this off @jreback’s plate. Merging. Thanks @mroeschke.

@jbrockmendel jbrockmendel merged commit 486e626 into pandas-dev:master Aug 6, 2018
@mroeschke mroeschke deleted the set_literal branch August 6, 2018 03:21
@mroeschke
Copy link
Member Author

Thanks!

@gfyoung gfyoung added the Code Style Code style, linting, code_checks label Aug 6, 2018
@gfyoung gfyoung added this to the 0.24.0 milestone Aug 6, 2018
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
* Style: Use set literals:

* flake8:

* Fix empty sets

* Undo spaces
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.

4 participants