Skip to content

Commit 8de5922

Browse files
KhemkaranKhemkaran
authored andcommitted
changed the default return type to None in convert_json_field_to_pandas_type
1 parent e84d1db commit 8de5922

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pandas/io/json/_table_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def convert_json_field_to_pandas_type(field) -> str | CategoricalDtype:
195195
"""
196196
typ = field["type"]
197197
if typ == "string":
198-
return field.get("extDtype", "object")
198+
return field.get("extDtype", None)
199199
elif typ == "integer":
200200
return field.get("extDtype", "int64")
201201
elif typ == "number":

pandas/tests/io/json/test_json_table_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ def test_convert_pandas_type_to_json_field_categorical(self, kind, ordered):
547547
},
548548
CategoricalDtype(categories=["a", "b", "c"], ordered=True),
549549
),
550-
({"type": "string"}, "object"),
550+
({"type": "string"}, None),
551551
],
552552
)
553553
def test_convert_json_field_to_pandas_type(self, inp, exp):

0 commit comments

Comments
 (0)