Skip to content

Commit 8765192

Browse files
committed
solved errors related to typing of args and linting issues
1 parent 028d398 commit 8765192

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

pandas/io/json/_json.py

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from io import StringIO
44
from itertools import islice
55
import os
6-
from typing import Any, Callable, Optional, Type, Iterator
6+
from typing import Any, Callable, Iterator, Optional, Type
77

88
import numpy as np
99

@@ -350,20 +350,20 @@ def _write(
350350
)
351351
def read_json(
352352
path_or_buf=None,
353-
orient: str = None,
354-
typ: str = "frame",
353+
orient=None,
354+
typ="frame",
355355
dtype=None,
356-
convert_axes: bool = None,
356+
convert_axes=None,
357357
convert_dates=True,
358358
keep_default_dates: bool = True,
359359
numpy: bool = False,
360360
precise_float: bool = False,
361-
date_unit: str = None,
362-
encoding: str = None,
361+
date_unit=None,
362+
encoding=None,
363363
lines: bool = False,
364364
chunksize: Optional[int] = None,
365-
compression: str = "infer",
366-
nrows: int = None,
365+
compression="infer",
366+
nrows: Optional[int] = None,
367367
):
368368
"""
369369
Convert a JSON string to pandas object.
@@ -495,20 +495,19 @@ def read_json(
495495
This can only be passed if `lines=True`.
496496
If this is None, the file will be read into memory all at once.
497497
498-
nrows : int, default None
499-
The number of lines from the line-delimited jsonfile that has to be read.
500-
This can only be passed if `lines=True`.
501-
If this is None, all the rows will be returned.
502-
.. versionadded:: 1.1
503-
504-
505498
compression : {'infer', 'gzip', 'bz2', 'zip', 'xz', None}, default 'infer'
506499
For on-the-fly decompression of on-disk data. If 'infer', then use
507500
gzip, bz2, zip or xz if path_or_buf is a string ending in
508501
'.gz', '.bz2', '.zip', or 'xz', respectively, and no decompression
509502
otherwise. If using 'zip', the ZIP file must contain only one data
510503
file to be read in. Set to None for no decompression.
511504
505+
nrows : int, optional
506+
The number of lines from the line-delimited jsonfile that has to be read.
507+
This can only be passed if `lines=True`.
508+
If this is None, all the rows will be returned.
509+
.. versionadded:: 1.1
510+
512511
Returns
513512
-------
514513
Series or DataFrame
@@ -634,20 +633,20 @@ class JsonReader(abc.Iterator):
634633
def __init__(
635634
self,
636635
filepath_or_buffer,
637-
orient: str,
638-
typ: str,
636+
orient,
637+
typ,
639638
dtype,
640-
convert_axes: bool,
639+
convert_axes,
641640
convert_dates,
642641
keep_default_dates: bool,
643642
numpy: bool,
644643
precise_float: bool,
645-
date_unit: str,
646-
encoding: str,
644+
date_unit,
645+
encoding,
647646
lines: bool,
648647
chunksize: Optional[int],
649-
compression: str,
650-
nrows: int,
648+
compression,
649+
nrows: Optional[int],
651650
):
652651

653652
self.path_or_buf = filepath_or_buffer

0 commit comments

Comments
 (0)