Skip to content

Commit b23b7cc

Browse files
committed
black formatting
1 parent 0028df7 commit b23b7cc

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

pandas/io/common.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -403,20 +403,18 @@ def get_handle(
403403
# GZ Compression
404404
if compression == "gzip":
405405
if is_path:
406-
f = gzip.open(
407-
path_or_buf, mode, **compression_args) # type: ignore
406+
f = gzip.open(path_or_buf, mode, **compression_args) # type: ignore
408407
else:
409408
f = gzip.GzipFile(
410-
fileobj=path_or_buf, **compression_args) # type: ignore
409+
fileobj=path_or_buf, **compression_args
410+
) # type: ignore
411411

412412
# BZ Compression
413413
elif compression == "bz2":
414414
if is_path:
415-
f = bz2.BZ2File(
416-
path_or_buf, mode, **compression_args) # type: ignore
415+
f = bz2.BZ2File(path_or_buf, mode, **compression_args) # type: ignore
417416
else:
418-
f = bz2.BZ2File(
419-
path_or_buf, **compression_args) # type: ignore
417+
f = bz2.BZ2File(path_or_buf, **compression_args) # type: ignore
420418

421419
# ZIP Compression
422420
elif compression == "zip":

pandas/tests/io/test_compression.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,11 @@ def test_with_missing_lzma_runtime():
157157
)
158158
@pytest.mark.parametrize("method", ["to_pickle", "to_json", "to_csv"])
159159
def test_gzip_compression_level(obj, method):
160-
#GH33196
160+
# GH33196
161161
with tm.ensure_clean() as path:
162162
getattr(obj, method)(path, compression="gzip")
163163
compressed_size_default = os.path.getsize(path)
164-
getattr(obj, method)(
165-
path, compression={ "method": "gzip", "compresslevel": 1})
164+
getattr(obj, method)(path, compression={"method": "gzip", "compresslevel": 1})
166165
compressed_size_fast = os.path.getsize(path)
167166
assert compressed_size_default < compressed_size_fast
168167

@@ -184,5 +183,4 @@ def test_bzip_compression_level(obj, method):
184183
compression is passed as a dict.
185184
"""
186185
with tm.ensure_clean() as path:
187-
getattr(obj, method)(
188-
path, compression={ "method": "bz2", "compresslevel": 1})
186+
getattr(obj, method)(path, compression={"method": "bz2", "compresslevel": 1})

0 commit comments

Comments
 (0)