Repository navigation
Generated MicrobialCommunity loader fails on inlined TaxonDescriptor and CultureCollectionEnum keys #1703
Description
Finding
Generated MicrobialCommunity loading through linkml_runtime.loaders.yaml_loader
fails for every current record in a local Python 3.13 / linkml-runtime 1.11.1
comparison. This predates schema prerequisite #1692 and the current rebase.
Before: 32423c9184e490bd3692026a337c63a33ec02d19.
After: 345eedc71e173c75dff8d5692ef946aeb3c908de.
The only tree difference is #1692's three schema-related files. The record corpus
is byte-identical. All 460 paths under kb/communities and data/isolates were
discovered with pathlib traversal, including ignored/hidden matches.
Both versions return exactly the same per-path exception type and message:
- 417 records:
TypeError: unhashable type: 'TaxonDescriptor'. - 43 records:
TypeError: unhashable type: 'CultureCollectionEnum'. - 0 generated-model load successes.
tests/test_datamodel.py currently comments out the generated-model imports and
uses plain yaml.safe_load, with an existing comment acknowledging inlined-object
runtime issues. That test cannot catch this loader defect. Schema/strict validation
and the production dictionary-based readers are different paths; this finding is
not a claim that the corpus fails JSON Schema validation.
Reproduce
From either commit, with the stated runtime installed:
from linkml_runtime.loaders import yaml_loader
from communitymech.datamodel.communitymech import MicrobialCommunity
yaml_loader.load(
'data/isolates/Aspergillus_Indium_LED_Recovery.yaml',
target_class=MicrobialCommunity,
)The first exception is raised while _normalize_inlined_as_dict processes
MicrobialCommunity.taxonomy, using an object-valued taxon_term as a dictionary
key. The culture-collection exception is a second observed failure class; fixing
taxonomy alone should not be assumed to repair every record.
Acceptance
- Repair schema-driven collection representation and regenerate the datamodel;
do not hand-edit generated Python or discard taxon/strain information. - Add real generated-model load tests for both exception classes and both roots.
- Verify all records load, and that round trips preserve members, order where
meaningful, repeated strain identities, evidence and graph references. - Retain schema/strict validation and mutation-sensitive negative tests.
- Check the repository-supported dependency versions; this reproduction covers
linkml-runtime 1.11.1 only.
Scope And Deduplication
Found during additional schema-integration checks for #1361 / #1702. The causal
batch patches remain unchanged; this is a separate generated-loader repair, not
a scientific-graph finding or a regression attributed to #1692.
Searched all-state issue titles/bodies through GitHub queries for TaxonDescriptor,
unhashable, yaml_loader, generated datamodel, inlined, datamodel loader and
CultureCollectionEnum. Returned issues were unrelated. Local ignored/hidden
search included the repository except .git, caches, generated docs/site, pyc,
notebooks and logs. Existing test comments acknowledge the limitation; no exact
issue was identified in that searched scope. PRs/comments were not exhaustively
searched.
Activity