TheR1sing3un commented on code in PR #7738:
URL: https://github.com/apache/paimon/pull/7738#discussion_r3167051775


##########
paimon-python/pypaimon/common/identifier.py:
##########
@@ -21,37 +21,82 @@
 from pypaimon.common.json_util import json_field
 
 SYSTEM_TABLE_SPLITTER = '$'
-SYSTEM_BRANCH_PREFIX = 'branch-'
+SYSTEM_BRANCH_PREFIX = 'branch_'
 DEFAULT_MAIN_BRANCH = 'main'
+UNKNOWN_DATABASE = 'unknown'
 
 
-@dataclass
+@dataclass(init=False)

Review Comment:
   > I don't know why you need to introduce `_BRANCH_NOT_SET`, Java also has 
many constructors.
   
   You're right — the sentinel was overkill, and the deprecation path it was
     gating is unnecessary if we just match Java's constructor shape directly.
   
     Pushed b17c9464f, which:
   
     * Drops `_BRANCH_NOT_SET` and all `DeprecationWarning`.
     * `__init__(database, object=None, branch=None, system_table=None)`
       mirrors Java's three public constructors in one signature: when
       `branch` / `system_table` is non-None, encode into `object`; otherwise
       treat `object` as the final string (the `@JsonCreator` path).
     * `Identifier.create` keeps its existing kwargs and now just delegates
       to the constructor — Java has only the 2-arg `create`, but keeping
       the multi-arg form here costs nothing and avoids touching every
       caller introduced by the first commit.
   
     Backward compatibility against the pre-PR public surface (the worry
     from your first review) is preserved without warnings:
   
     * `Identifier(db, obj, branch=...)` / `branch=None` — accepted, encodes
       into `object` so the Java REST server now actually sees the branch.
     * `identifier.branch` — read+write property. The setter re-encodes
       `object` so `id.branch = "x"` keeps working for any caller that used
       to assign to the dataclass field.
     * `Identifier.create(db, "tbl$snapshots")` two-arg form — unchanged.
   
     A new `IdentifierBackwardCompatibilityTest` locks these in by asserting
     "the old call sites run without raising" (no warning assertions, no
     shim semantics — these are first-class supported entry points now).
   
     PTAL.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to