aglinxinyuan opened a new pull request, #5706:
URL: https://github.com/apache/texera/pull/5706

   Split out of #5700 (loop operators) per [reviewer 
request](https://github.com/apache/texera/pull/4206#pullrequestreview-4482667715)
 to keep that PR reviewable. This is the smallest, fully independent piece.
   
   ## What
   - Add `get_operator_id(worker_id)` — extracts the logical operator id from a 
worker actor name (`Worker:WF<wf>-<op>-<layer>-<idx>`), raising `ValueError` on 
a malformed id.
   - Generalize `worker_name_pattern` to capture the workflow id and operator 
id explicitly, and switch both `get_worker_index` and `get_operator_id` to 
`re.fullmatch`.
   
   ## Why
   `get_operator_id` mirrors the Scala `VirtualIdentityUtils.getPhysicalOpId` 
parse, giving the Python worker one tested place to map a worker id back to its 
operator. `fullmatch` makes a malformed id fail loudly instead of silently 
parsing trailing junk — matching the full-match semantics the docstring already 
claims.
   
   ## Impact
   | case | before | after |
   |---|---|---|
   | `get_worker_index`, well-formed id | worker index | same value |
   | `get_worker_index`, malformed id (trailing junk) | parsed silently | 
raises `ValueError` |
   | `get_operator_id` | — | new helper |
   
   Behavior-preserving for well-formed worker ids. `get_operator_id`'s 
production caller lands with the loop feature; the helper + its test are 
independent and mergeable now.
   
   ## Test
   `pytest src/test/python/core/util/test_virtual_identity.py` — 23 passing; 
`ruff check`/`format` clean.


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