Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 03249a1

Browse files
fix cluster col comparison
1 parent 31853d4 commit 03249a1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

bigframes/session/bq_caching_executor.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,12 +253,14 @@ def _maybe_find_existing_table(
253253
if spec.if_exists == "fail":
254254
raise ValueError(f"Table already exists: {spec.table.__str__()}")
255255

256-
if (len(spec.cluster_cols) != 0) and (
257-
table.clustering_fields != spec.cluster_cols
256+
if (
257+
(len(spec.cluster_cols) != 0)
258+
and (table.clustering_fields is not None)
259+
and (tuple(table.clustering_fields) != spec.cluster_cols)
258260
):
259261
raise ValueError(
260262
"Table clustering fields cannot be changed after the table has "
261-
f"been created. Existing clustering fields: {table.clustering_fields}"
263+
f"been created. Requested clustering fields: {spec.cluster_cols}, existing clustering fields: {table.clustering_fields}"
262264
)
263265
return table
264266
except google.api_core.exceptions.NotFound:

0 commit comments

Comments
 (0)