Copying a Python tuple shares mutable field storage
- Dominant language
- Scala
- Stars
- 314
- Forks
- 187
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 214
Description
### Feature Summary
Constructing a `Tuple` from another `Tuple` reuses the same internal ordered dictionary. Assigning a field on either tuple therefore changes the other tuple as well. An operator that creates and edits a derived tuple can silently mutate its input row.
Before: copied tuples share field storage and leak assignments in both directions.
Expected: a tuple copy starts with the same fields but has independent field mapping storage.
Reproduction evidence:
1. Create `original = Tuple({"x": 1})`.
2. Create `copied = Tuple(original)`.
3. Assign `copied["x"] = 2` and observe that `original["x"]` also becomes 2.
Version and commit evidence:
1.3.0-incubating-SNAPSHOT on main
**Commit Hash (Optional)**
50321e403c82df299a13deb50a7f9849dd93bdba
**Relevant log output**
original_x=2 derived_x=2 same_storage=True
### Proposed Solution or Design
Expected: a tuple copy starts with the same fields but has independent field mapping storage.
### Affected Area
Workflow Engine (Amber)
Contributor guide
Assessment
This issue has not been assessed yet.