-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: tslibs typing, avoid private funcs #34195
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.
Generally looks good, just two small comments
pandas/_libs/tslibs/period.pyx
Outdated
@@ -2194,7 +2194,7 @@ cdef class _Period(ABCPeriod): | |||
return (Period, object_state) | |||
|
|||
def strftime(self, fmt: str) -> str: | |||
""" | |||
r""" |
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 there a reason this is needed? (the docs seem to render fine: https://pandas.pydata.org/docs/dev/reference/api/pandas.Period.strftime.html#pandas.Period.strftime)
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 are \(
in there that are invalid escapes
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.
It might be needed for sphinx (no idea), because as shown, it renders good. Did you check that it still renders fine with this change?
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.
I suppose this is copied from the stdlib docs, and there those escape is also used: https://raw.githubusercontent.com/python/cpython/3.8/Doc/library/datetime.rst
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.
I mainly notice this because the syntax highlighter (sublime text) marks 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.
@jorisvandenbossche do you feel strongly that this should be reverted? i care about this less than the rest of the PR, so would be OK with that
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.
I don't care about whether this should be reverted or not, but if you change it, you need to build the docs to check that it actually works (because just based on guessing, I wouldn't know whether this change is correct or not)
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.
lgtm.
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.
lgtm @jorisvandenbossche
pandas/_libs/tslibs/period.pyx
Outdated
@@ -2194,7 +2194,7 @@ cdef class _Period(ABCPeriod): | |||
return (Period, object_state) | |||
|
|||
def strftime(self, fmt: str) -> str: | |||
""" | |||
r""" |
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.
I don't care about whether this should be reverted or not, but if you change it, you need to build the docs to check that it actually works (because just based on guessing, I wouldn't know whether this change is correct or not)
Reverted the "r"; test failure is in feather |
updated+green |
No description provided.