nebula-python icon indicating copy to clipboard operation
nebula-python copied to clipboard

feat: add MurmurHash2 hash() and unit+integration tests

Open Fengzdadi opened this issue 6 months ago • 2 comments

What type of PR is this?

  • [ ] bug
  • [x] feature
  • [ ] enhancement

What problem(s) does this PR solve?

Issue(s) number:

  • Closes #355

Description:

  • Add a new murmur_hash function (MurmurHash2 64-bit variant) under nebula3/utils/hash.py
  • Remove ctypes dependency and use int.from_bytes for better performance and readability
  • Support both str (UTF-8) and bytes inputs, with appropriate type checking
  • Add comprehensive unit tests (tests/test_hash.py) covering:
    • Empty input, single byte, exactly 8 bytes, >8 bytes, Unicode strings
    • Seed variation, idempotency, invalid types, large inputs
  • Add integration tests (tests/test_hash_integration.py) to verify client hash() against server YIELD hash(...)

Fengzdadi avatar May 25 '25 10:05 Fengzdadi

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 25 '25 10:05 CLAassistant

looks like our runner's pdm env is dirty, trying to run py310's pdm code on py37, where there are walrus symbol := that's foreign to py37.

wey-gu avatar Jun 09 '25 09:06 wey-gu