Skip to content

Commit 0719ecf

Browse files
committed
Replace assert with ValueError
1 parent 7131dc0 commit 0719ecf

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

pyiceberg/table/upsert_util.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ def get_rows_to_update(source_table: pa.Table, target_table: pa.Table, join_cols
101101

102102
MARKER_COLUMN_NAME = "__from_target"
103103

104-
assert MARKER_COLUMN_NAME not in join_cols_set
104+
if MARKER_COLUMN_NAME in join_cols_set:
105+
raise ValueError(
106+
f"{MARKER_COLUMN_NAME} is used for joining " f"DataFrames, and cannot be used as column name"
107+
) from None
105108

106109
# Step 1: Prepare source index with join keys and a marker
107110
# Cast to target table schema, so we can do the join

0 commit comments

Comments
 (0)