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 9b1fb93 commit d7455a6Copy full SHA for d7455a6
bigframes/core/blocks.py
@@ -724,8 +724,12 @@ def to_pandas_batches(
724
safe_pa_type = bigframes.dtypes._replace_json_arrow_with_string(
725
dtype.pyarrow_dtype
726
)
727
- safe_dtype = pd.ArrowDtype(safe_pa_type)
728
- series_map[col] = pd.Series([], dtype=safe_dtype).astype(dtype)
+ # Create empty array with safe type, but preserve original dtype metadata
+ empty_array = pa.array([], type=safe_pa_type)
729
+ series_map[col] = pd.Series(
730
+ empty_array,
731
+ dtype=dtype, # Use original dtype directly
732
+ )
733
else:
734
# Fallback for other types that might error
735
series_map[col] = pd.Series([], dtype="object").astype(dtype)
0 commit comments