Skip to content

fix: restore __hash__ on OOFieldInfo to prevent TypeError in typing m…#13

Merged
simontaurus merged 2 commits intomainfrom
dev
Apr 5, 2026
Merged

fix: restore __hash__ on OOFieldInfo to prevent TypeError in typing m…#13
simontaurus merged 2 commits intomainfrom
dev

Conversation

@simontaurus
Copy link
Copy Markdown
Contributor

…odule

OOFieldInfo overrides eq for query building, which makes Python set hash = None. This breaks third-party libraries (e.g. prefect) that process Union/Annotated types containing FieldInfo metadata, since typing needs to hash them. Restore id()-based hashing matching the original object.hash behavior.

…odule

OOFieldInfo overrides __eq__ for query building, which makes Python set
__hash__ = None. This breaks third-party libraries (e.g. prefect) that
process Union/Annotated types containing FieldInfo metadata, since
typing needs to hash them. Restore id()-based hashing matching the
original object.__hash__ behavior.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 5, 2026

📊 Benchmark Results

Click to see benchmark comparison
📊 Benchmark Comparison (threshold: 1.3x)
============================================================

⚠️  Performance Regressions:
  ❌ test_enum_docstrings: 0.0465s → 0.0618s (+32.8%, ratio: 1.33x)

➖ Unchanged (within threshold):
  ➖ test_simple_dict_document_store: 0.0015s → 0.0015s (+1.3%)
  ➖ test_sqlite_document_store: 0.0030s → 0.0031s (+2.5%)
  ➖ test_local_sparql_store: 0.0374s → 0.0372s (-0.6%)
  ➖ test_oneof_subschema: 0.0514s → 0.0516s (+0.5%)
  ➖ test_subclass_inheritance: 0.0455s → 0.0463s (+1.6%)
  ➖ test_class_hierarchy: 0.0436s → 0.0491s (+12.7%)
  ➖ test_core[v1]: 0.0325s → 0.0370s (+13.9%)
  ➖ test_core[v2]: 0.0442s → 0.0413s (-6.5%)
  ➖ test_schema_generation[v1]: 0.0016s → 0.0019s (+15.5%)
  ➖ test_schema_generation[v2]: 0.0029s → 0.0029s (+1.9%)

============================================================
Summary: 1 regressions, 0 improvements, 10 unchanged
============================================================

⚠️  Regressions detected but not failing build (informational only)

Threshold: 1.3x (30% slower triggers a regression warning)

Note: Benchmarks are informational only and won't fail the build.

💡 Tip: Download the benchmark-results artifact for detailed JSON data

Previously only uppercase *-keys (type mappings) were nullified in the
first compact step, leaving lowercase *-keys like name* to compete with
internal _-prefixed terms for the same IRI. pyld 3.0.0 removed
_compare_shortest_least which changed term selection priority, causing
*-keys to win over _-prefixed names and breaking the alias collapse.

Nullify all *-keys so the algorithm does not depend on pyld's internal
term ranking order.

Refs: digitalbazaar/pyld#247
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 5, 2026

📊 Benchmark Results

Click to see benchmark comparison
📊 Benchmark Comparison (threshold: 1.3x)
============================================================

⚠️  New benchmark: test_simple_json
⚠️  New benchmark: test_complex_graph
⚠️  Performance Regressions:
  ❌ test_enum_docstrings: 0.0500s → 0.0770s (+54.0%, ratio: 1.54x)

➖ Unchanged (within threshold):
  ➖ test_simple_dict_document_store: 0.0015s → 0.0015s (+1.6%)
  ➖ test_sqlite_document_store: 0.0029s → 0.0032s (+6.9%)
  ➖ test_local_sparql_store: 0.0376s → 0.0373s (-0.9%)
  ➖ test_oneof_subschema: 0.0553s → 0.0557s (+0.9%)
  ➖ test_subclass_inheritance: 0.0519s → 0.0570s (+9.8%)
  ➖ test_class_hierarchy: 0.0446s → 0.0544s (+21.8%)
  ➖ test_core[v1]: 0.0372s → 0.0352s (-5.4%)
  ➖ test_core[v2]: 0.0420s → 0.0468s (+11.5%)
  ➖ test_schema_generation[v1]: 0.0017s → 0.0017s (+1.9%)
  ➖ test_schema_generation[v2]: 0.0033s → 0.0030s (-11.1%)

============================================================
Summary: 1 regressions, 0 improvements, 10 unchanged
============================================================

⚠️  Regressions detected but not failing build (informational only)

Threshold: 1.3x (30% slower triggers a regression warning)

Note: Benchmarks are informational only and won't fail the build.

💡 Tip: Download the benchmark-results artifact for detailed JSON data

@simontaurus simontaurus merged commit 2c90244 into main Apr 5, 2026
8 checks passed
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.

1 participant