Skip to content

Commit 7ad3a04

Browse files
committed
Revert: Revert incorrect fix for empty index in _pd_index_to_array_value
1 parent a53c645 commit 7ad3a04

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

bigframes/core/blocks.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3474,27 +3474,7 @@ def _pd_index_to_array_value(
34743474
Create an ArrayValue from a list of label tuples.
34753475
The last column will be row offsets.
34763476
"""
3477-
if index.empty:
3478-
id_gen = bigframes.core.identifiers.standard_id_strings()
3479-
col_ids = [next(id_gen) for _ in range(index.nlevels + 1)]
3480-
3481-
data_dict = {}
3482-
if isinstance(index, pd.MultiIndex):
3483-
dtypes = index.dtypes.values.tolist()
3484-
else:
3485-
dtypes = [index.dtype]
34863477

3487-
for col_id, dtype in zip(col_ids[:-1], dtypes):
3488-
try:
3489-
bf_dtype = bigframes.dtypes.bigframes_type(dtype)
3490-
pa_type = bigframes.dtypes.bigframes_dtype_to_arrow_dtype(bf_dtype)
3491-
except TypeError:
3492-
pa_type = pa.string()
3493-
data_dict[col_id] = pa.array([], type=pa_type)
3494-
3495-
data_dict[col_ids[-1]] = pa.array([], type=pa.int64())
3496-
table = pa.Table.from_pydict(data_dict)
3497-
return core.ArrayValue.from_pyarrow(table, session=session)
34983478
rows = []
34993479
labels_as_tuples = utils.index_as_tuples(index)
35003480
for row_offset in range(len(index)):

0 commit comments

Comments
 (0)