Skip to content

CLN: clean TODOs in csv test #44113

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

Merged
merged 1 commit into from
Oct 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions pandas/tests/frame/methods/test_to_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ def test_to_csv_from_csv4(self):

result = read_csv(path, index_col="dt_index")
result.index = pd.to_timedelta(result.index)
# TODO: remove renaming when GH 10875 is solved
result.index = result.index.rename("dt_index")
result["dt_data"] = pd.to_timedelta(result["dt_data"])

tm.assert_frame_equal(df, result, check_index_type=True)
Expand Down Expand Up @@ -479,11 +477,8 @@ def test_to_csv_from_csv_w_some_infs(self, float_frame):
float_frame.to_csv(path)
recons = self.read_csv(path)

# TODO to_csv drops column name
tm.assert_frame_equal(float_frame, recons, check_names=False)
tm.assert_frame_equal(
np.isinf(float_frame), np.isinf(recons), check_names=False
)
tm.assert_frame_equal(float_frame, recons)
tm.assert_frame_equal(np.isinf(float_frame), np.isinf(recons))

def test_to_csv_from_csv_w_all_infs(self, float_frame):

Expand All @@ -495,11 +490,8 @@ def test_to_csv_from_csv_w_all_infs(self, float_frame):
float_frame.to_csv(path)
recons = self.read_csv(path)

# TODO to_csv drops column name
tm.assert_frame_equal(float_frame, recons, check_names=False)
tm.assert_frame_equal(
np.isinf(float_frame), np.isinf(recons), check_names=False
)
tm.assert_frame_equal(float_frame, recons)
tm.assert_frame_equal(np.isinf(float_frame), np.isinf(recons))

def test_to_csv_no_index(self):
# GH 3624, after appending columns, to_csv fails
Expand Down Expand Up @@ -868,8 +860,7 @@ def test_to_csv_stringio(self, float_frame):
float_frame.to_csv(buf)
buf.seek(0)
recons = read_csv(buf, index_col=0)
# TODO to_csv drops column name
tm.assert_frame_equal(recons, float_frame, check_names=False)
tm.assert_frame_equal(recons, float_frame)

def test_to_csv_float_format(self):

Expand Down