Skip to content

Commit 7f9ed16

Browse files
committed
Black pandas modifications
1 parent afdc840 commit 7f9ed16

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

pandas/io/common.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ def urlopen(*args, **kwargs):
150150
"""
151151
import urllib.request
152152

153-
# Request class is only available in Python3, which
153+
# Request class is only available in Python3, which
154154
# allows headers to be specified
155-
if hasattr(urllib.request, 'Request'):
155+
if hasattr(urllib.request, "Request"):
156156
r = urllib.request.urlopen(urllib.request.Request(*args, **kwargs))
157157
else:
158158
r = urllib.request.urlopen(*args, **kwargs)
@@ -183,7 +183,7 @@ def get_filepath_or_buffer(
183183
compression: CompressionOptions = None,
184184
mode: ModeVar = None, # type: ignore[assignment]
185185
storage_options: StorageOptions = None,
186-
headers: dict = {}
186+
headers: dict = {},
187187
) -> IOargs[ModeVar, EncodingVar]:
188188
"""
189189
If the filepath_or_buffer is a url, translate and return the buffer.

pandas/io/json/_json.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ def read_json(
377377
compression: CompressionOptions = "infer",
378378
nrows: Optional[int] = None,
379379
storage_options: StorageOptions = None,
380-
headers: dict = {}
380+
headers: dict = {},
381381
):
382382
"""
383383
Convert a JSON string to pandas object.
@@ -615,7 +615,7 @@ def read_json(
615615
encoding=encoding,
616616
compression=compression,
617617
storage_options=storage_options,
618-
headers=headers
618+
headers=headers,
619619
)
620620

621621
json_reader = JsonReader(

pandas/io/parsers.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,11 @@ def _read(filepath_or_buffer: FilePathOrBuffer, kwds):
435435
headers = kwds.get("headers", {})
436436

437437
ioargs = get_filepath_or_buffer(
438-
filepath_or_buffer, encoding, compression, storage_options=storage_options, headers=headers
438+
filepath_or_buffer,
439+
encoding,
440+
compression,
441+
storage_options=storage_options,
442+
headers=headers,
439443
)
440444
kwds["compression"] = ioargs.compression
441445

@@ -600,7 +604,7 @@ def read_csv(
600604
memory_map=False,
601605
float_precision=None,
602606
storage_options: StorageOptions = None,
603-
headers={}
607+
headers={},
604608
):
605609
# gh-23761
606610
#
@@ -688,7 +692,7 @@ def read_csv(
688692
infer_datetime_format=infer_datetime_format,
689693
skip_blank_lines=skip_blank_lines,
690694
storage_options=storage_options,
691-
headers=headers
695+
headers=headers,
692696
)
693697

694698
return _read(filepath_or_buffer, kwds)

0 commit comments

Comments
 (0)