File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed
Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -957,19 +957,13 @@ def _read_pyarrow(self) -> DataFrame:
957957 pyarrow_json = import_optional_dependency ("pyarrow.json" )
958958 options = None
959959
960- if isinstance (self .dtype , dict ):
961- pa = import_optional_dependency ("pyarrow" )
962- fields = []
963- for field , dtype in self .dtype .items ():
964- pd_dtype = pandas_dtype (dtype )
965- if isinstance (pd_dtype , ArrowDtype ):
966- fields .append ((field , pd_dtype .pyarrow_dtype ))
967-
968- schema = pa .schema (fields )
969- options = pyarrow_json .ParseOptions (explicit_schema = schema )
970-
971- pa_table = pyarrow_json .read_json (self .data , parse_options = options )
972- return arrow_table_to_pandas (pa_table , dtype_backend = self .dtype_backend )
960+ pa_table = pyarrow_json .read_json (self .data )
961+ df = arrow_table_to_pandas (pa_table , dtype_backend = self .dtype_backend )
962+
963+ if self .dtype :
964+ df = df .astype (self .dtype )
965+
966+ return df
973967
974968 def _read_ujson (self ) -> DataFrame | Series :
975969 """
You can’t perform that action at this time.
0 commit comments