File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -125,9 +125,7 @@ def to_flat(self, fields: list[str] | None = None) -> pd.DataFrame:
125
125
flat_series = {}
126
126
for field , chunks in flat_chunks .items ():
127
127
dtype = self ._series .dtype .field_dtype (field )
128
- if len (chunks ) == 0 :
129
- chunks = [pa .array ([])]
130
- chunked_array = pa .chunked_array (chunks )
128
+ chunked_array = pa .chunked_array (chunks , type = self ._series .dtype .fields [field ])
131
129
flat_series [field ] = pd .Series (
132
130
chunked_array ,
133
131
index = index ,
@@ -433,7 +431,7 @@ def get_flat_series(self, field: str) -> pd.Series:
433
431
flat_array = list_array .flatten ()
434
432
flat_chunks .append (flat_array )
435
433
436
- flat_chunked_array = pa .chunked_array (flat_chunks )
434
+ flat_chunked_array = pa .chunked_array (flat_chunks , type = self . _series . dtype . fields [ field ] )
437
435
438
436
return pd .Series (
439
437
flat_chunked_array ,
You can’t perform that action at this time.
0 commit comments