-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: clean core.construction._extract_index #49930
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, good to see this fixing a typing issue!
else: | ||
index = default_index(lengths[0]) | ||
if have_series: | ||
assert index is not None # for mypy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the # for mypy
comment still necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, the whole line is actually unnecessary as index
is never None
here. I'll remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄 yeah sorry I meant the whole line
c0b998d
to
85cb4c6
Compare
Updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @topper-123 !
Return early in the case of len(data) == 0, thereby avoiding needing a long
else
clause. Also clean type hints.EDIT: The PR looks a bit messy at first sight, but it's mostly just dedenting stuff. Checking "Hide whitespace" makes the PR much clearer, as suggested by @MarcoGorelli in #49921.