Skip to content

Conversation

@tbhb
Copy link
Contributor

@tbhb tbhb commented Jan 2, 2026

Summary

  • Add __eq__ and __hash__ methods to Table and Transaction classes
  • Table equality compares resolved path, key specifier, and record state (with auto-reload)
  • Transaction equality compares parent table identity, finalized status, and snapshot state
  • Both classes are not hashable (raise TypeError) since they are mutable

Test plan

  • All 15 new equality tests pass
  • Full test suite passes (720 tests)
  • Type checking passes (basedpyright)
  • Linting passes (ruff)
  • Pre-commit hooks pass

tbhb added 2 commits January 2, 2026 01:35
Implement __eq__ and __hash__ for both Table and Transaction classes:

- Table: value-based equality comparing resolved path, key_specifier,
  and record state. Auto-reloads both tables before comparison.
- Transaction: equality based on parent table identity (is), finalized
  status, and snapshot state.
- Both classes raise TypeError on hash (mutable objects).

Includes comprehensive tests and documentation updates.
@codecov
Copy link

codecov bot commented Jan 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 2, 2026

CodSpeed Performance Report

Merging #16 will not alter performance

Comparing feat/equality-methods (ae3537a) with main (a51a249)

Summary

✅ 173 untouched

@tbhb tbhb merged commit e0ca4b4 into main Jan 2, 2026
30 checks passed
@tbhb tbhb deleted the feat/equality-methods branch January 2, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants