-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
Cleanup Typing in pandas.core.strings #25904
Conversation
Codecov Report
@@ Coverage Diff @@
## master #25904 +/- ##
==========================================
+ Coverage 91.53% 91.53% +<.01%
==========================================
Files 175 175
Lines 52808 52810 +2
==========================================
+ Hits 48338 48340 +2
Misses 4470 4470
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #25904 +/- ##
==========================================
- Coverage 91.8% 91.8% -0.01%
==========================================
Files 174 174
Lines 52548 52550 +2
==========================================
- Hits 48243 48242 -1
- Misses 4305 4308 +3
Continue to review full report at Codecov.
|
version='') | ||
_shared_docs['casefold'] = dict(type='be casefolded', method='casefold', | ||
version='\n .. versionadded:: 0.25.0\n') | ||
_doc_args = {} # type: Dict[str, Dict[str, str]] |
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.
you renamed this? does this still work?
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.
So to be clear I didn't rename this variable I just created a new one to clarify usage and types. _shared_docs
still exists, but with str types for both keys and values.
It had mixed usage before because some values were also dicts and were being used to update other strings, so somewhat confusing as to the purpose of the variable and was causing typing to fail since the %
operator can't have a dict as an operand
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.
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.
this doesn't make any sense, why did you change the name?
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.
To be clear I didn't change the name. _shared_docs
still exists but now with just a type of Dict[str, str]
so that it only holds docstrings.
Previously the signature was Dict[str, Union[Dict[str, str]]]
because it was holding not only docstrings but also dicts to use for substitution in other docstrings, which was rather convoluted and was failing typing.
Instead of mashing all of those types into one _shared_docs
variable it is arguably cleaner to have one dict containing docstrings (_shared_docs
) and one containing substitution parameters (here _doc_args
).
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.
ok i see what you did. can you put a comment to reflect this fact
version='') | ||
_shared_docs['casefold'] = dict(type='be casefolded', method='casefold', | ||
version='\n .. versionadded:: 0.25.0\n') | ||
_doc_args = {} # type: Dict[str, Dict[str, str]] |
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.
this doesn't make any sense, why did you change the name?
version='') | ||
_shared_docs['casefold'] = dict(type='be casefolded', method='casefold', | ||
version='\n .. versionadded:: 0.25.0\n') | ||
_doc_args = {} # type: Dict[str, Dict[str, str]] |
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.
ok i see what you did. can you put a comment to reflect this fact
@jreback ping on this one - any other changes needed? |
thanks @WillAyd nope this one is good |
git diff upstream/master -u -- "*.py" | flake8 --diff