We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3f9e7f commit 28fa332Copy full SHA for 28fa332
pandas/io/json/_json.py
@@ -959,11 +959,11 @@ def _read_pyarrow(self) -> DataFrame:
959
960
if isinstance(self.dtype, dict):
961
pa = import_optional_dependency("pyarrow")
962
- fields = [
963
- (field, pandas_dtype(dtype).pyarrow_dtype)
964
- for field, dtype in self.dtype.items()
965
- if isinstance(pandas_dtype(dtype), ArrowDtype)
966
- ]
+ fields = []
+ for field, dtype in self.dtype.items():
+ pd_dtype = pandas_dtype(dtype)
+ if isinstance(pd_dtype, ArrowDtype):
+ fields.append((field, pd_dtype.pyarrow_dtype))
967
968
schema = pa.schema(fields)
969
options = pyarrow_json.ParseOptions(explicit_schema=schema)
0 commit comments