-
-
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
DEPR: Deprecate from_csv in favor of read_csv #17812
Conversation
Codecov Report
@@ Coverage Diff @@
## master #17812 +/- ##
==========================================
- Coverage 91.24% 91.22% -0.02%
==========================================
Files 163 163
Lines 49994 49995 +1
==========================================
- Hits 45615 45607 -8
- Misses 4379 4388 +9
Continue to review full report at Codecov.
|
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 ok
pandas/tests/frame/test_to_csv.py
Outdated
assert_frame_equal(np.isinf(self.frame), | ||
np.isinf(recons), check_names=False) | ||
with tm.assert_produces_warning(FutureWarning, | ||
check_stacklevel=False): |
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 would fix almost all of these to just call read_csv (maybe leave a couple which catch the warning)
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.
Yeah, that makes sense.
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.
also any test that is not for to_csv could be moved to the parsers testing
prob are duplicates (of existing tests)
can be done in a follow up if u want (make an issue in that case)
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.
These are all for to_csv
. They are round-trip checks mostly.
pandas/tests/series/test_io.py
Outdated
check_stacklevel=False): | ||
self.ts.to_csv(path) | ||
ts = Series.from_csv(path) | ||
assert_series_equal(self.ts, ts, check_names=False) |
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.
same
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.
Done.
pandas/tests/series/test_io.py
Outdated
|
||
assert_series_equal(s, s2) | ||
with tm.assert_produces_warning(FutureWarning, | ||
check_stacklevel=False): |
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.
same
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.
Done.
@jreback : I took out all but a few instances of |
need a whatsnew note |
Oops. Added. |
@jreback : Added |
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.
minor comment, looks good!
pandas/tests/frame/test_to_csv.py
Outdated
assert_frame_equal(self.tsframe, recons) | ||
|
||
with tm.assert_produces_warning(FutureWarning, | ||
check_stacklevel=False): |
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.
the check_stacklevel=False
should not be needed
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.
True, fixed.
pandas/tests/frame/test_to_csv.py
Outdated
with tm.assert_produces_warning(FutureWarning, | ||
check_stacklevel=False): | ||
depr_recons = DataFrame.from_csv(path) | ||
assert_frame_equal(self.tsframe, depr_recons) |
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.
maybe move this round-trip out to a separate test function (just the to_csv/from_csv), easier to read (it will be obvious then why you defined self.read_csv
then and easier to remove later
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.
Done.
assert ts.name is None | ||
assert ts.index.name is None | ||
|
||
# GH10483 | ||
with tm.assert_produces_warning(FutureWarning, | ||
check_stacklevel=False): |
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.
same
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.
Done.
pls add |
deee0f3
to
3cf0e69
Compare
Yep, done as well. |
3cf0e69
to
28f8097
Compare
lgtm. merge on green. |
Title is self-explanatory. Closes #4191.