Skip to content

Commit e69109d

Browse files
[python] Add file_source assertion in row-tracking commit to fail fast on missing file_source (#7610)
if file_source is None, the condition `None == 0` silently evaluates to False, skipping row ID assignment. This causes nextRowId not to increment, leading to first_row_id conflicts. So this PR add file_source check like java.
1 parent f6cb6c8 commit e69109d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

paimon-python/pypaimon/write/file_store_commit.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,9 @@ def _assign_row_tracking_meta(self, first_row_id_start: int, commit_entries: Lis
697697
blob_start_by_field = {}
698698

699699
for entry in commit_entries:
700+
assert entry.file.file_source is not None, \
701+
f"file_source must be present for row-tracking table, file={entry.file.file_name}"
702+
700703
# Check if this is an append file that needs row ID assignment
701704
if (entry.kind == 0 and # ADD kind
702705
entry.file.file_source == 0 and # APPEND file source

0 commit comments

Comments
 (0)