Skip to content

Commit d5ec5b1

Browse files
committed
Apply pre-commit fixes
1 parent 4885cbe commit d5ec5b1

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

pandas/tests/io/test_compression.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def test_compression_size_fh(obj, method, compression_only, temp_file):
6363
getattr(obj, method)(handles.handle)
6464
assert not handles.handle.closed
6565
compressed_size = os.path.getsize(path)
66-
66+
6767
# Create a new temporary file for uncompressed comparison
6868
path2 = temp_file.parent / f"{temp_file.stem}_uncompressed{temp_file.suffix}"
6969
path2.touch()
@@ -83,7 +83,12 @@ def test_compression_size_fh(obj, method, compression_only, temp_file):
8383
],
8484
)
8585
def test_dataframe_compression_defaults_to_infer(
86-
write_method, write_kwargs, read_method, compression_only, compression_to_extension, temp_file
86+
write_method,
87+
write_kwargs,
88+
read_method,
89+
compression_only,
90+
compression_to_extension,
91+
temp_file,
8792
):
8893
# GH22004
8994
input = pd.DataFrame([[1.0, 0, -4], [3.4, 5, 2]], columns=["X", "Y", "Z"])

pandas/tests/io/test_pickle.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ def compress_file(self, src_path, dest_path, compression):
243243
f.write(fh.read())
244244

245245
def test_write_explicit(self, compression, get_random_path, temp_file):
246-
base = get_random_path
247246
p1 = temp_file.parent / f"{temp_file.stem}.compressed"
248247
p2 = temp_file.parent / f"{temp_file.stem}.raw"
249248
df = DataFrame(
@@ -277,7 +276,6 @@ def test_write_explicit_bad(self, compression, get_random_path, temp_file):
277276
df.to_pickle(path, compression=compression)
278277

279278
def test_write_infer(self, compression_ext, get_random_path, temp_file):
280-
base = get_random_path
281279
p1 = temp_file.parent / f"{temp_file.stem}{compression_ext}"
282280
p2 = temp_file.parent / f"{temp_file.stem}.raw"
283281
compression = self._extension_to_compression.get(compression_ext.lower())
@@ -301,7 +299,6 @@ def test_write_infer(self, compression_ext, get_random_path, temp_file):
301299
tm.assert_frame_equal(df, df2)
302300

303301
def test_read_explicit(self, compression, get_random_path, temp_file):
304-
base = get_random_path
305302
p1 = temp_file.parent / f"{temp_file.stem}.raw"
306303
p2 = temp_file.parent / f"{temp_file.stem}.compressed"
307304
df = DataFrame(
@@ -321,7 +318,6 @@ def test_read_explicit(self, compression, get_random_path, temp_file):
321318
tm.assert_frame_equal(df, df2)
322319

323320
def test_read_infer(self, compression_ext, get_random_path, temp_file):
324-
base = get_random_path
325321
p1 = temp_file.parent / f"{temp_file.stem}.raw"
326322
p2 = temp_file.parent / f"{temp_file.stem}{compression_ext}"
327323
compression = self._extension_to_compression.get(compression_ext.lower())

pandas/tests/io/xml/test_to_xml.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,7 @@ def test_index_false_rename_row_root(xml_books, parser, temp_file):
287287
df_file = read_xml(xml_books, parser=parser)
288288

289289
path = temp_file.parent / "test.xml"
290-
df_file.to_xml(
291-
path, index=False, root_name="books", row_name="book", parser=parser
292-
)
290+
df_file.to_xml(path, index=False, root_name="books", row_name="book", parser=parser)
293291
with open(path, "rb") as f:
294292
output = f.read().decode("utf-8").strip()
295293

@@ -1303,9 +1301,9 @@ def test_compression_output(parser, compression_only, geom_df, temp_file):
13031301
with get_handle(
13041302
path,
13051303
"r",
1306-
compression=compression_only,
1307-
) as handle_obj:
1308-
output = handle_obj.handle.read()
1304+
compression=compression_only,
1305+
) as handle_obj:
1306+
output = handle_obj.handle.read()
13091307

13101308
output = equalize_decl(output)
13111309

@@ -1323,8 +1321,8 @@ def test_filename_and_suffix_comp(
13231321
path,
13241322
"r",
13251323
compression=compression_only,
1326-
) as handle_obj:
1327-
output = handle_obj.handle.read()
1324+
) as handle_obj:
1325+
output = handle_obj.handle.read()
13281326

13291327
output = equalize_decl(output)
13301328

0 commit comments

Comments
 (0)