Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Cleanup Typing in pandas.core.strings #25904
Changes from all commits
0a83814
f612278
590f50c
2dddb6e
a54c73c
f4f4162
ad70ed2
33c2278
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 operandThere 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.
Here's a screenshot of the output of
lower
locally, which is of the items that was moved to the new variable here: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 ofDict[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