This is an automated email from the ASF dual-hosted git repository.

lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git


The following commit(s) were added to refs/heads/master by this push:
     new e69109d122 [python] Add file_source assertion in row-tracking commit 
to fail fast on missing file_source (#7610)
e69109d122 is described below

commit e69109d1229ad1bda8f8d529ef047c3c1acd277f
Author: littlecoder04 <[email protected]>
AuthorDate: Thu Apr 9 13:26:25 2026 +0800

    [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.
---
 paimon-python/pypaimon/write/file_store_commit.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/paimon-python/pypaimon/write/file_store_commit.py 
b/paimon-python/pypaimon/write/file_store_commit.py
index 829bcaa0b7..a4099ac1db 100644
--- a/paimon-python/pypaimon/write/file_store_commit.py
+++ b/paimon-python/pypaimon/write/file_store_commit.py
@@ -697,6 +697,9 @@ class FileStoreCommit:
         blob_start_by_field = {}
 
         for entry in commit_entries:
+            assert entry.file.file_source is not None, \
+                f"file_source must be present for row-tracking table, 
file={entry.file.file_name}"
+
             # Check if this is an append file that needs row ID assignment
             if (entry.kind == 0 and  # ADD kind
                     entry.file.file_source == 0 and  # APPEND file source

Reply via email to