Skip to content

Commit f8da6f8

Browse files
fix incompatible clustering check
1 parent 4d51fd2 commit f8da6f8

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

bigframes/session/bq_caching_executor.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -253,15 +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 (
257-
(len(spec.cluster_cols) != 0)
258-
and (table.clustering_fields is not None)
259-
and (tuple(table.clustering_fields) != spec.cluster_cols)
260-
):
261-
raise ValueError(
262-
"Table clustering fields cannot be changed after the table has "
263-
f"been created. Requested clustering fields: {spec.cluster_cols}, existing clustering fields: {table.clustering_fields}"
264-
)
256+
if len(spec.cluster_cols) != 0:
257+
if (table.clustering_fields is None) or (
258+
tuple(table.clustering_fields) != spec.cluster_cols
259+
):
260+
raise ValueError(
261+
"Table clustering fields cannot be changed after the table has "
262+
f"been created. Requested clustering fields: {spec.cluster_cols}, existing clustering fields: {table.clustering_fields}"
263+
)
265264
return table
266265
except google.api_core.exceptions.NotFound:
267266
return None

0 commit comments

Comments
 (0)