Skip to content

Commit 94c8af9

Browse files
committed
fix test_default_index_warning_not_raised_by_read_gbq_primary_key
1 parent 5d40d0a commit 94c8af9

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

bigframes/session/_io/bigquery/read_gbq_table.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,10 @@ def get_index_cols(
250250
column(s), then return those too so that ordering generation can be
251251
avoided.
252252
"""
253+
# Transform index_col -> index_cols so we have a variable that is
254+
# always a list of column names (possibly empty).
255+
schema_len = len(table.schema)
256+
253257
index_cols: List[str] = []
254258
if isinstance(index_col, bigframes.enums.DefaultIndexKind):
255259
if index_col == bigframes.enums.DefaultIndexKind.SEQUENTIAL_INT64:
@@ -265,14 +269,7 @@ def get_index_cols(
265269
raise NotImplementedError(
266270
f"Got unexpected index_col {repr(index_col)}. {constants.FEEDBACK_LINK}"
267271
)
268-
elif isinstance(index_col, Iterable) and len(list(index_col)) == 0:
269-
return []
270-
271-
# Transform index_col -> index_cols so we have a variable that is
272-
# always a list of column names (possibly empty).
273-
schema_len = len(table.schema)
274-
275-
if isinstance(index_col, str):
272+
elif isinstance(index_col, str):
276273
if rename_to_schema is not None:
277274
index_col = rename_to_schema.get(index_col, index_col)
278275
index_cols = [index_col]

0 commit comments

Comments
 (0)