-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
used f-strings in docs #32133
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
used f-strings in docs #32133
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.
some comments for your consideration
doc/source/whatsnew/v0.10.0.rst
Outdated
@@ -297,7 +297,7 @@ Updated PyTables support | |||
|
|||
.. code-block:: ipython | |||
|
|||
In [41]: store = pd.HDFStore('store.h5') | |||
In [41]: store = pd.HDFStore('store.h5') |
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.
undo this change, remove the whitespace
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
thanks for the input
I think this is correct as is - isn't this supposed to show how the single quote doesn't get escaped? See text immediately following |
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.
as mentioned let's revert the change to the string, but can use f-strings if you'd like to make a change
doc/source/user_guide/io.rst
Outdated
.. code-block:: ipython | ||
|
||
string = "HolyMoly'" | ||
string = "HolyMoly" | ||
store.select('df', 'index == %s' % string) |
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 can update this to use an f-string if you'd like to change something
Yup, my bad - sorry @PSY27 . Though as Will said, if you change line 3818 to use an f-string, that would be good. In that case, you could add
to the pull request description instead of
|
doc/source/user_guide/io.rst
Outdated
.. code-block:: ipython | ||
|
||
string = "HolyMoly'" | ||
string = "HolyMoly" |
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.
Revert this change as well
@WillAyd @MarcoGorelli please review it now |
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.
Looks good, thanks @PSY27!
While we're here, there's some other .format
s which could be changed within this file - for example, this one on line 3828:
store.select('df', f'index == {string!r}')
Else I think it's fine as is, I realise the requirement for this PR wasn't clear upfront :)
EDIT
Though if you do make this extra change (line 3828) please also change the line
If you *must* interpolate, use the ``'%r'`` format specifier
to
If you *must* interpolate, use the ``!r`` conversion flag
thanks @PSY27 |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff