Closed ShaharNaveh closed 4 years ago
These are included in #31986
"pandas/tests/scalar/timestamp/test_constructors.py" "pandas/tests/scalar/timestamp/test_rendering.py" "pandas/tests/scalar/timestamp/test_unary_ops.py" "pandas/tests/series/methods/test_nlargest.py" "pandas/tests/series/test_analytics.py" "pandas/tests/series/test_api.py" "pandas/tests/series/test_dtypes.py" "pandas/tests/series/test_ufunc.py"
Added my first pull request with this https://github.com/pandas-dev/pandas/pull/32007: pandas/tests/frame/test_to_csv.py
These are included in #32032
"pandas/tests/test_downstream.py" "pandas/tests/test_multilevel.py" "pandas/tests/tools/test_numeric.py" "pandas/tests/tseries/frequencies/test_inference.py" "pandas/tests/tslibs/test_parse_iso8601.py" "pandas/tests/window/moments/test_moments_rolling.py"
This file is included in #32029:
File included in https://github.com/pandas-dev/pandas/pull/32044
These are included in #32034
"pandas/core/arrays/interval.py" "pandas/core/util/hashing.py" "pandas/io/formats/format.py" "pandas/io/formats/html.py" "pandas/io/formats/latex.py" "pandas/io/formats/printing.py" "pandas/io/parsers.py" "pandas/tests/arrays/categorical/test_dtypes.py" "pandas/tests/arrays/categorical/test_operators.py"
These ones are done...
pandas/core/ops/invalid.py pandas/core/ops/methods.py pandas/core/ops/roperator.py
Files included in #32063:
Hi, I want to take scripts/validate_docstrings.py
File included in the pull request #32189
Is this issue resolved? I have been looking at files unmarked on the list at the top of this thread, it seems like the .format() strings have been converted
pandas//util/_decorators.py is done (the line that fails is a comment)
pandas//core/indexes/base.py should be marked off (failure is from a comment again)
Hi, I started looking at pandas/core/generic.py and quickly realised that changing the string templates from a string interpolated with %
to a string.Template
will require changes in many places where Substitute
+Appender
decorators are used.
Do you aim to remove all usage of %
string interpolation, in which case this work will be necessary, or are you ok with some use of %
interpolation?
@smartvinnetou When it comes to the Appender
and Substitute
we are now trying to replace those with the doc
decorator. see https://github.com/pandas-dev/pandas/issues/31942
@smartvinnetou When it comes to the
Appender
andSubstitute
we are now trying to replace those with thedoc
decorator. see #31942
@MomIsBestFriend do you prefer to skip the upgrade of pandas/core/generic.py
in this ticket and do it under #31942 ? Or should I replace Appender
and Subtitute
decorators in generic.py
with your new doc
decorator under this ticket to remove the old %
interpolation?
@smartvinnetou When it comes to the
Appender
andSubstitute
we are now trying to replace those with thedoc
decorator. see #31942@MomIsBestFriend do you prefer to skip the upgrade of
pandas/core/generic.py
in this ticket and do it under #31942 ? Or should I replaceAppender
andSubtitute
decorators ingeneric.py
with your newdoc
decorator under this ticket to remove the old%
interpolation?
@smartvinnetou Under #31942 in the case of pandas/core/generic.py
(If I understood correctly)
Hi, found quite a lot of files that were either done or needed no changes, but were marked as not done. Just wanted to ask if this issue was solved and been accidentally not marked or you guys are still working on it. If it's not solved, I would like to contribute as well. These were some of the files that were done but not marked
@sachinh35 I have updated the list :)
It got hard to keep track
Thanks for updating the list! @MomIsBestFriend
I would like to contribute with #32939 for files under pandas/core/ops/
. How should one handle the docstrings as for example https://github.com/pandas-dev/pandas/blob/master/pandas/core/ops/docstrings.py#L564 which are sometimes imported in other files as well? Wrapping in functions?
I changed
The two files were modified: pandas/_libs/tslibs/timedeltas.pyx pandas/_libs/tslibs/timestamps.pyx
Note that there was no issues in the following ones. You can mark as done too: pandas/_libs/tslibs/c_timestamp.pyx pandas/_libs/tslibs/frequencies.pyx pandas/_libs/tslibs/parsing.pyx pandas/_libs/tslibs/period.pyx pandas/_libs/tslibs/strptime.pyx
note: this is my first PR ever. Let me know if something need to be improved.
I've went through the topic to update the list + check some files.
(no need to change anything):
I took care of pandas/util/_validators.py
. Many of these other files already seem ok to me too.
Hi Matteo, I'm interested in helping with this effort, but am new to git and contributing to pandas. Would you possibly be able to walk me through the steps ? Perhaps I can setup a screen share this week?
Thanks, Andrew
On Tue, May 26, 2020, 3:12 PM Matteo Santamaria notifications@github.com wrote:
I took care of pandas/util/_validators.py. Many of these other files already seem ok to me too.
- pandas/util/_test_decorators.py
- pandas/tseries/frequencies.py
- pandas/tests/util/test_assert_frame_equal.py
- pandas/tests/tslibs/test_parsing.py
- pandas/tests/tseries/holiday/test_holiday.py
- pandas/tests/tseries/holiday/test_calendar.py
- pandas/tests/tools/test_to_datetime.py
- pandas/tests/test_strings.py
- pandas/tests/series/test_repr.py
- pandas/tests/series/test_datetime_values.py
- pandas/tests/series/test_constructors.py
- pandas/tests/series/test_api.py
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pandas-dev/pandas/issues/29547#issuecomment-634307953, or unsubscribe https://github.com/notifications/unsubscribe-auth/APG73XKAUDLFVVQXUS2SJETRTQ5DDANCNFSM4JLZCU5Q .
Hey @warden706, I'm actually pretty new here too, so I wouldn't have much to show you. I've found this resource very helpful as I've stumbled around, you should check it out.
Hi, pretty new to contributing also here. I'm taking care of
I checked these other files and seem ok to me
i'm also new here. i'll take
i have a question regarding the code change. for instance, in pandas/tests/series/indexing/test_take.py, snippet of the code:
msg = "index {} is out of bounds for( axis 0 with)? size 5"
with pytest.raises(IndexError, match=msg.format(10)):
ser.take([1, 10])
so my suggestion is to replace it to:
msg = lambda x: f"index {x} is out of bounds for( axis 0 with)? size 5"
with pytest.raises(IndexError, match=msg(10)):
ser.take([1, 10])
is that good enough?
Hi,
I'd like to make a PR, so I'm running the test, but I'm having a couple of fails. So I tried to run tests also on master.
Is it normal that running pytest pandas
on unedited forked master returns a couple of fails?
Master should generally pass the tests. Make sure you've pulled the latest commits. Which tests are failing?
@matteosantama I pulled last commits, re-installed the environment an re-run the tests with pytest pandas
. These are the results
================= short test summary info =================
FAILED pandas/tests/io/test_parquet.py::TestParquetFastParquet::test_s3_roundtrip - ValueError: Invalid timestamp "Ven, 29 Mag 2020 07:59:19 GMT": Unknown string format: Ven, 29 Mag 2020 07:59:19 GMT
FAILED pandas/tests/plotting/test_datetimelike.py::TestTSPlot::test_ts_plot_with_tz['UTC'] - AttributeError: 'numpy.datetime64' object has no attribute 'hour'
================= 2 failed, 87804 passed, 1185 skipped, 1005 xfailed, 5637 warnings in 2437.06s (0:40:37) =================
I noticed that if I run tests only on the single directory (for example with pytest pandas/tests/io
), there are no fails:
7273 passed, 344 skipped, 53 xfailed, 5584 warnings in 351.76s (0:05:51)
Since the @OlivierLuG comment, it seems like almost all of the files have been corrected or were already ok without any modification. I'll try to update the list about the "still open" files.
Moreover, I think that also this is already ok
@DanBasson do you have any update?
i keep getting errors which i don't know what they mean. any help will be appreciated
Have you tried to fetch the latest modifications on master? Maybe it will fix some of the failed tests.
it didn't help. if someone else wants to take it, you can
I have a doubt: when we have a situation like in pandas/tests/reshape/test_melt.py
:
msg = "The following '{Var}' are not present in the DataFrame: {Col}"
...
with pytest.raises(KeyError, match=msg.format(Var="value_vars", Col="\\['C'\\]")):
...
with pytest.raises(KeyError, match=msg.format(Var="id_vars", Col="\\['A'\\]")):
...
and so on, should we transform msg
to a function and call it with different values of "Col"? Or is it better to leave it as it is?
@MatteoFelici thanks for that updated list. I checked the last few remaining modules you called out and this looks OK, so I think we can close this issue
Since we no longer support python 3.5, we can now use the new f-strings instead of the old
.format()
( and obviously the%
formatting).Notes:
Don't forget to link this issue in your pull request's body message , simply paste this
https://github.com/pandas-dev/pandas/issues/29547
in your pull request's body message.If any of your changed files are related to #29886 , please make sure to link your pull request to that issue as well, simply paste this
https://github.com/pandas-dev/pandas/issues/29886
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 not marked, please comment letting me know.
To check what files still needs to be fixed in the
pandas
directory:All of the above can also be used as a one liner:
Tip:
If you want to see the line number of the occurrence, replace the
-l
with-n
for example:The current list is:
[ ] pandas/compat/pickle_compat.py
[ ] pandas/_config/config.py
[ ] pandas/core/arrays/datetimelike.py
[ ] pandas/core/arrays/datetimes.py
[ ] pandas/core/arrays/integer.py
[ ] pandas/core/arrays/period.py
[ ] pandas/core/computation/pytables.py
[ ] pandas/core/config_init.py
[ ] pandas/core/frame.py
[ ] pandas/core/generic.py
[ ] pandas/core/groupby/generic.py
[ ] pandas/core/groupby/groupby.py
[ ] pandas/core/indexes/base.py
[ ] pandas/core/indexes/multi.py
[ ] pandas/core/indexes/range.py
[ ] pandas/core/ops/docstrings.py
[ ] pandas/core/ops/__init__.py
[ ] pandas/core/reshape/merge.py
[ ] pandas/core/tools/datetimes.py
[ ] pandas/io/formats/css.py
[ ] pandas/io/formats/excel.py
[ ] pandas/io/formats/format.py
[ ] pandas/io/formats/html.py
[ ] pandas/io/formats/info.py
[ ] pandas/io/formats/latex.py
[ ] pandas/io/formats/printing.py
[ ] pandas/io/formats/style.py
[ ] pandas/io/parsers.py
[ ] pandas/io/pytables.py
[ ] pandas/io/sas/sas_xport.py
[ ] pandas/io/stata.py
[ ] pandas/_libs/tslibs/c_timestamp.pyx
[ ] pandas/_libs/tslibs/frequencies.pyx
[ ] pandas/_libs/tslibs/parsing.pyx
[ ] pandas/_libs/tslibs/period.pyx
[ ] pandas/_libs/tslibs/strptime.pyx
[ ] pandas/_libs/tslibs/timedeltas.pyx
[ ] pandas/plotting/_matplotlib/converter.py
[ ] pandas/tests/arrays/categorical/test_operators.py
[ ] pandas/tests/arrays/test_datetimelike.py
[ ] pandas/tests/dtypes/test_dtypes.py
[ ] pandas/tests/extension/base/setitem.py
[ ] pandas/tests/frame/test_constructors.py
[ ] pandas/tests/frame/test_missing.py
[ ] pandas/tests/frame/test_to_csv.py
[ ] pandas/tests/groupby/aggregate/test_other.py
[ ] pandas/tests/indexes/datetimes/test_date_range.py
[ ] pandas/tests/indexes/datetimes/test_datetime.py
[ ] pandas/tests/indexes/datetimes/test_formats.py
[ ] pandas/tests/indexes/datetimes/test_partial_slicing.py
[ ] pandas/tests/indexes/interval/test_constructors.py
[ ] pandas/tests/indexes/interval/test_interval.py
[ ] pandas/tests/indexes/multi/test_format.py
[ ] pandas/tests/indexes/period/test_formats.py
[ ] pandas/tests/indexes/test_base.py
[ ] pandas/tests/indexes/timedeltas/test_timedelta.py
[ ] pandas/tests/indexing/test_categorical.py
[ ] pandas/tests/indexing/test_coercion.py
[ ] pandas/tests/io/excel/test_openpyxl.py
[ ] pandas/tests/io/excel/test_writers.py
[ ] pandas/tests/io/formats/test_format.py
[ ] pandas/tests/io/formats/test_printing.py
[ ] pandas/tests/io/formats/test_style.py
[ ] pandas/tests/io/formats/test_to_csv.py
[ ] pandas/tests/io/formats/test_to_html.py
[ ] pandas/tests/io/formats/test_to_latex.py
[ ] pandas/tests/io/parser/test_compression.py
[ ] pandas/tests/io/parser/test_encoding.py
[ ] pandas/tests/io/parser/test_header.py
[ ] pandas/tests/io/parser/test_parse_dates.py
[ ] pandas/tests/io/parser/test_usecols.py
[ ] pandas/tests/io/test_html.py
[ ] pandas/tests/io/test_sql.py
[ ] pandas/tests/io/test_stata.py
[ ] pandas/tests/reductions/test_reductions.py
[ ] pandas/tests/reshape/test_concat.py
[ ] pandas/tests/reshape/test_melt.py
[ ] pandas/tests/scalar/period/test_period.py
[ ] pandas/tests/scalar/timedelta/test_timedelta.py
[ ] pandas/tests/scalar/timestamp/test_constructors.py
[ ] pandas/tests/series/indexing/test_numeric.py
[ ] pandas/tests/series/indexing/test_take.py
[ ] pandas/tests/series/indexing/test_where.py
[ ] pandas/tests/series/methods/test_rename.py
[ ] pandas/tests/series/test_api.py
[ ] pandas/tests/series/test_constructors.py
[ ] pandas/tests/series/test_datetime_values.py
[ ] pandas/tests/series/test_repr.py
[ ] pandas/tests/test_strings.py
[ ] pandas/tests/tools/test_to_datetime.py
[ ] pandas/tests/tseries/holiday/test_calendar.py
[ ] pandas/tests/tseries/holiday/test_holiday.py
[ ] pandas/tests/tslibs/test_parsing.py
[ ] pandas/tests/util/test_assert_frame_equal.py
[ ] pandas/tseries/frequencies.py
[ ] pandas/util/_decorators.py
[ ] pandas/util/_test_decorators.py
[ ] pandas/util/_validators.py
[ ] pandas/_version.py
NOTE:
The list may change as files are moved/renamed constantly.
Inhereted files and commands from this PR.