-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Replace "foo!r" to "repr(foo)" syntax #29886
Comments
Another option that we use in quite a few places is single quotes |
@jbrockmendel I'm kinda obligated about how to find them systemically, meaning what if there's is a change to the |
I'll take:
|
working on :
currently if no one has taken it yet. |
Working on: |
As described in the following issue pandas-dev#29886 , usage of !r is currently redundant and so changing to f strings in place of it.
hi @kvn219 , actually i am already working on three files one of which is what you have also mentioned , can you please work on some other file. |
I`ll take pandas/pandas/io/parsers.py pandas/pandas/io/html.py |
…s.py" This reverts commit 182c68b.
Hi to everyone, I will take:
|
done - thanks! |
It's perfectly fine :) |
pandas/tests/test_strings.py was checked and already uses f-strings. If possible, it would be great to update the master list. |
TY, really appreciate it |
@jreback Can you please reopen this issue? The PR was suppose to contain two test cases, but it only contained one. This should be reopen. |
Thanks @jreback |
pandas/core/arrays/datetimelike.py Both of the above are free of the old style strings. |
Fixed the remaining files. Signed-off-by: nbonnin <[email protected]>
I tackled the remaining files. Did not implement a test though. |
…ndexing-1row-df * upstream/master: (333 commits) CI: troubleshoot Web_and_Docs failing (pandas-dev#30534) WARN: Ignore NumbaPerformanceWarning in test suite (pandas-dev#30525) DEPR: camelCase in offsets, get_offset (pandas-dev#30340) PERF: implement scalar ops blockwise (pandas-dev#29853) DEPR: Remove Series.compress (pandas-dev#30514) ENH: Add numba engine for rolling apply (pandas-dev#30151) [ENH] Add to_markdown method (pandas-dev#30350) DEPR: Deprecate pandas.np module (pandas-dev#30386) ENH: Add ignore_index for df.drop_duplicates (pandas-dev#30405) BUG: The setting xrot=0 in DataFrame.hist() doesn't work with by and subplots pandas-dev#30288 (pandas-dev#30491) CI: Fix GBQ Tests (pandas-dev#30478) Bug groupby quantile listlike q and int columns (pandas-dev#30485) ENH: Add ignore_index for df.sort_values and series.sort_values (pandas-dev#30402) TYP: Typing hints in pandas/io/formats/{css,csvs}.py (pandas-dev#30398) BUG: raise on non-hashable Index name, closes pandas-dev#29069 (pandas-dev#30335) Replace "foo!r" to "repr(foo)" syntax pandas-dev#29886 (pandas-dev#30502) BUG: preserve EA dtype in transpose (pandas-dev#30091) BLD: add check to prevent tempita name error, clsoes pandas-dev#28836 (pandas-dev#30498) REF/TST: method-specific files for test_append (pandas-dev#30503) marked unused parameters (pandas-dev#30504) ...
So the only remaining item is a code check test for |
Actually, it looks like we have a check for that. @MomIsBestFriend is there anything else to do here? |
@TomAugspurger I think not 😃 Thank you all for helping ❤️ |
Since we are moving to f-strings and dropping old strings formats (
%
and.format()
), we no longer need to have the redundant%r
and!r
specifiers, instead we use therepr()
format.Notes:
Don't forget to link this issue in your PR, paste this
https://github.com/pandas-dev/pandas/issues/29886
in your PR.If any of your changed files are related to Replace old string formatting syntax with f-strings #29547 , please make sure to link your pull request to that issue as well, simply paste this
https://github.com/pandas-dev/pandas/issues/29547
in your pull request's body message as well.Please comment what you are planning to work on, so we won't do double work.
If a file/files that should be marked as done, is'nt marked, please comment letting me know.
To check what files still needs to be fixed in the "pandas" directory:
Tip:
If you want to see the line number of the occurrence, replace the
-l
with-n
for example:
The current list is:
ci/print_skipped.py
pandas/_config/config.py
pandas/conftest.py
pandas/core/accessor.py
pandas/core/algorithms.py
pandas/core/arrays/categorical.py
pandas/core/arrays/datetimelike.py
pandas/core/arrays/period.py
pandas/core/arrays/numpy_.py
pandas/core/computation/align.py
pandas/core/computation/eval.py
pandas/core/computation/expressions.py
pandas/core/computation/expr.py
pandas/core/computation/ops.py
pandas/core/computation/pytables.py
pandas/core/dtypes/common.py
pandas/core/dtypes/dtypes.py
pandas/core/frame.py
pandas/core/generic.py
pandas/core/groupby/grouper.py
pandas/core/indexes/base.py
pandas/core/indexes/datetimelike.py
pandas/core/indexes/interval.py
pandas/core/indexes/numeric.py
pandas/core/internals/concat.py
pandas/core/internals/managers.py
pandas/core/missing.py
pandas/core/nanops.py
pandas/core/reshape/concat.py
pandas/core/reshape/merge.py
pandas/core/reshape/tile.py
pandas/core/series.py
pandas/core/sorting.py
pandas/core/strings.py
pandas/core/window/rolling.py
pandas/__init__.py
pandas/io/formats/css.py
pandas/io/formats/excel.py
pandas/io/formats/style.py
pandas/io/html.py
pandas/io/parsers.py
pandas/_libs/interval.pyx
pandas/plotting/_core.py
pandas/tests/computation/test_eval.py
pandas/tests/frame/test_alter_axes.py
pandas/tests/frame/test_analytics.py
pandas/tests/frame/test_query_eval.py
pandas/tests/groupby/test_whitelist.py
pandas/tests/indexes/datetimes/test_datetime.py
pandas/tests/indexes/multi/test_integrity.py
pandas/tests/indexes/period/test_period.py
pandas/tests/indexes/test_common.py
pandas/tests/indexes/timedeltas/test_timedelta.py
pandas/tests/io/msgpack/test_case.py
pandas/tests/io/msgpack/test_extension.py
pandas/tests/io/parser/test_unsupported.py
pandas/tests/io/test_html.py
pandas/tests/test_expressions.py
pandas/tests/test_strings.py
pandas/tests/io/test_sql.py
pandas/tests/reshape/test_concat.py
pandas/tests/scalar/timedelta/test_timedelta.py
pandas/tests/series/test_missing.py
pandas/tests/tseries/offsets/test_fiscal.py
pandas/tests/tseries/offsets/test_offsets.py
pandas/tseries/offsets.py
pandas/util/_decorators.py
pandas/util/_test_decorators.py
pandas/util/testing.py
pandas/_version.py
/scripts/tests/test_validate_docstrings.py
Lastly:
The text was updated successfully, but these errors were encountered: