fix: make TaskInstance and Realization hashable#26
Conversation
|
@jeqcho have a look |
|
@Adityakk9031 Hi, happy to review again if the failing tests are fixed. |
|
Thanks @Adityakk9031! On the red CI: the macOS py3.12 failure was our infrastructure, not you — setup-uv got rate-limited before anything of yours ran, and I've re-run that job. The lint failure is real but trivial: |
|
@jeqcho have a look |
|
@jeqcho check latest commit |
|
Merged, thanks @Adityakk9031. The part I want to call out: relying on Review surfaced two small follow-ups, written up as #30: an equal-objects-equal-hash test (the current test passes even under identity hashing), and the |
closes:#4
Summary:
TaskInstance and Realization are decorated as frozen dataclasses, but they contain dictionary fields. By default, Python's generated hash method attempts to hash these mutable dictionaries, raising a TypeError. This PR implements custom hash methods for both classes to convert their dictionary fields into sorted tuples of items, resolving the unhashable type error and allowing them to be used in sets or as dictionary keys.
Changes:
Verification: