Skip to content

Commit a2e6fb7

Browse files
don't hardcode object dtype
1 parent 2df96bb commit a2e6fb7

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

pandas/tests/io/test_feather.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,17 @@ def test_rw_use_threads(self):
136136
def test_path_pathlib(self):
137137
df = pd.DataFrame(
138138
1.1 * np.arange(120).reshape((30, 4)),
139-
columns=pd.Index(list("ABCD"), dtype=object),
140-
index=pd.Index([f"i-{i}" for i in range(30)], dtype=object),
139+
columns=pd.Index(list("ABCD")),
140+
index=pd.Index([f"i-{i}" for i in range(30)]),
141141
).reset_index()
142142
result = tm.round_trip_pathlib(df.to_feather, read_feather)
143143
tm.assert_frame_equal(df, result)
144144

145145
def test_path_localpath(self):
146146
df = pd.DataFrame(
147147
1.1 * np.arange(120).reshape((30, 4)),
148-
columns=pd.Index(list("ABCD"), dtype=object),
149-
index=pd.Index([f"i-{i}" for i in range(30)], dtype=object),
148+
columns=pd.Index(list("ABCD")),
149+
index=pd.Index([f"i-{i}" for i in range(30)]),
150150
).reset_index()
151151
result = tm.round_trip_localpath(df.to_feather, read_feather)
152152
tm.assert_frame_equal(df, result)

pandas/tests/io/test_parquet.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,7 @@ def fp(request):
111111

112112
@pytest.fixture
113113
def df_compat():
114-
# TODO(infer_string) should this give str columns?
115-
return pd.DataFrame(
116-
{"A": [1, 2, 3], "B": "foo"}, columns=pd.Index(["A", "B"], dtype=object)
117-
)
114+
return pd.DataFrame({"A": [1, 2, 3], "B": "foo"}, columns=pd.Index(["A", "B"]))
118115

119116

120117
@pytest.fixture

0 commit comments

Comments
 (0)