Skip to content

Commit 4b1f294

Browse files
committed
read_json, build_table_schema, json_normalize
1 parent 656c0a7 commit 4b1f294

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

pandas-stubs/__init__.pyi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ from pandas.io.api import (
133133
from pandas.io.api import (
134134
read_orc as read_orc, # pyright: ignore[reportUnknownVariableType]
135135
)
136-
from pandas.io.json._normalize import (
137-
json_normalize as json_normalize, # pyright: ignore[reportUnknownVariableType]
138-
)
136+
from pandas.io.json._normalize import json_normalize as json_normalize
139137
from pandas.tseries import offsets as offsets
140138
from pandas.tseries.api import infer_freq as infer_freq
141139

pandas-stubs/_typing.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ Level: TypeAlias = Hashable
182182
Shape: TypeAlias = tuple[int, ...]
183183
Suffixes: TypeAlias = tuple[str | None, str | None] | list[str | None]
184184
Ordered: TypeAlias = bool | None
185-
JSONSerializable: TypeAlias = PythonScalar | list | dict
185+
JSONSerializable: TypeAlias = PythonScalar | list[Any] | dict[str, Any]
186186
Frequency: TypeAlias = str | BaseOffset
187187
PeriodFrequency: TypeAlias = (
188188
str

pandas-stubs/io/json/__init__.pyi

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
from pandas.io.json._json import (
2-
read_json as read_json,
3-
)
1+
from pandas.io.json._json import read_json as read_json
42

53
# below are untyped imports so commented out
64
# to_json as to_json,; ujson_dumps as ujson_dumps,; ujson_loads as ujson_loads,
7-
from pandas.io.json._table_schema import (
8-
build_table_schema as build_table_schema, # pyright: ignore[reportUnknownVariableType]
9-
)
5+
from pandas.io.json._table_schema import build_table_schema as build_table_schema

pandas-stubs/io/json/_normalize.pyi

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
from collections.abc import (
2+
Mapping,
3+
Sequence,
4+
)
5+
from typing import Any
6+
17
from pandas import DataFrame
28

39
from pandas._typing import IgnoreRaise
410

511
def json_normalize(
6-
data: dict | list[dict],
7-
record_path: str | list | None = None,
12+
data: Mapping[str, Any] | Sequence[Mapping[str, Any]],
13+
record_path: str | list[str] | None = None,
814
meta: str | list[str | list[str]] | None = None,
915
meta_prefix: str | None = None,
1016
record_prefix: str | None = None,

0 commit comments

Comments
 (0)