aglinxinyuan commented on code in PR #5706:
URL: https://github.com/apache/texera/pull/5706#discussion_r3409077774


##########
amber/src/main/python/core/util/virtual_identity.py:
##########
@@ -24,16 +24,32 @@
     ActorVirtualIdentity,
 )
 
-worker_name_pattern = re.compile(r"Worker:WF\d+-.+-(\w+)-(\d+)")
+worker_name_pattern = re.compile(r"Worker:WF(\d+)-(.+)-(\w+)-(\d+)")
 
 MATERIALIZATION_READER_ACTOR_PREFIX = "MATERIALIZATION_READER_"
 
 
 def get_worker_index(worker_id: str) -> int:
-    match = worker_name_pattern.match(worker_id)
+    match = worker_name_pattern.fullmatch(worker_id)
     if match:
-        return int(match.group(2))
-    raise ValueError("Invalid worker ID format")
+        return int(match.group(4))
+    raise ValueError(f"Invalid worker ID format: {worker_id}")
+
+
+def get_operator_id(worker_id: str) -> str:

Review Comment:
   Done in `0c8a7e73` — renamed on both sides so the logical-vs-physical 
distinction is explicit at the call site:
   
   - **Scala**: `VirtualIdentityUtils.getOperatorId` → `getLogicalOpId` 
(parallels the existing `getPhysicalOpId`); the `ErrorUtils` caller and 
`VirtualIdentityUtilsSpec` are updated too.
   - **Python**: `get_operator_id` → `get_logical_op_id`; test class + cases 
updated.
   
   Each keeps its original miss semantics — Scala returns the `__DummyOperator` 
sentinel, Python raises `ValueError` — noted in the cross-language docstrings. 
Verified green: `VirtualIdentityUtilsSpec` (17) and `test_virtual_identity` 
(25).



-- 
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