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

   ### What changes were proposed in this PR?
   
   Hash Python strings as Java UTF-16 code units before applying the existing 
Java-compatible string hash.
   
   Before: with two receivers, key `U+1F600` produced Python hash 128543 and 
Scala hash 1772930, selecting different workers.
   
   After: both hashes are 1772930 and both select worker 0.
   
   ### Any related issues, documentation, discussions?
   
   Closes #8181
   
   ### How was this PR tested?
   
   The new Unicode-boundary regression was red before the source change with 
one failure and two passes. After the fix, ASCII, BMP Unicode, and 
supplementary Unicode all pass.
   
   ```text
   python -c "import sys,pytest; 
sys.path[:0]=[r'<worktree>\amber\src\main\python',r'<checkout>\amber\src\main\python'];
 raise 
SystemExit(pytest.main([r'amber/src/test/python/core/models/test_tuple.py::TestTuple::test_string_hash_uses_java_utf16_units','-q','-p','no:cacheprovider']))"
   ```
   
   The remaining tuple tests and complete partitioner suite pass:
   
   ```text
   python -c "import sys,pytest; 
sys.path[:0]=[r'<worktree>\amber\src\main\python',r'<checkout>\amber\src\main\python'];
 raise 
SystemExit(pytest.main([r'amber/src/test/python/core/models/test_tuple.py','-k','not
 test_hash','-q','-p','no:cacheprovider']))"
   python -c "import sys,pytest; 
sys.path[:0]=[r'<worktree>\amber\src\main\python',r'<checkout>\amber\src\main\python'];
 raise 
SystemExit(pytest.main([r'amber/src/test/python/core/models/test_tuple.py::TestTuple::test_hash_treats_none_fields_as_zero',r'amber/src/test/python/core/architecture/sendsemantics/test_partitioners.py','-q','-p','no:cacheprovider']))"
   ```
   
   Results: 104 tuple tests passed, then the separately selected null-hash test 
and all 35 partitioner tests passed. The existing `TestTuple.test_hash` fixture 
is excluded because its naive epoch timestamp fails on Windows; PR #8174 makes 
those timestamps explicitly UTC.
   
   ```text
   ruff check amber/src/main/python amber/src/test/python
   ruff format --check amber/src/main/python amber/src/test/python
   ```
   
   Ruff checked 213 files successfully. The fixed production hash partitioner 
selected receiver A for `U+1F600`, matching Scala bucket 0.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: OpenAI Codex, GPT-5


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