Follow-up from #419, which consolidated PublishedDandiset into Dandiset and PublishedAsset into Asset but kept the old names in dandischema/models.py as deprecated aliases so that consumers would keep importing successfully:
PublishedDandiset = Dandiset
PublishedAsset = Asset
Getting rid of them takes, in order:
Findings as of filing (recheck before implementing)
dandi-cli is clear. Verified at e982b3bc: it uses BareAsset, which stays, but neither deprecated alias.
dandi-archive uses both, in four places. api/views/schema.py and api/tests/test_schema.py are the two #419 called out: each builds its mapping from model.__name__, so both already collapse from four entries to two silently rather than failing.
The other two are load-bearing and fail at call time rather than at import, because they pass the name as a string:
dandiapi/api/services/publish/__init__.py:196 — validate(..., schema_key='PublishedDandiset', json_validation=True)
dandiapi/api/services/metadata/__init__.py:65,151 — the same with 'PublishedAsset' and 'PublishedDandiset'
validate resolves the key with getattr(models, schema_key) (dandischema/metadata.py:234 and :296), and both call sites sit on the publish path, so the breakage would surface at publication rather than at startup.
The SCHEMA_MAP question. Since #419 the published-*.json files have been byte-identical to dandiset.json and asset.json, so emitting them buys nothing, and the linkml-conversion branch has already stopped generating them on the LinkML side (7ed984e9). But SCHEMA_MAP is also the accepted schema_key vocabulary, and _get_jsonschema_validator builds a URL into a released schema version from it, so dropping the keys outright would also drop the ability to validate older published metadata under its historical key.
Follow-up from #419, which consolidated
PublishedDandisetintoDandisetandPublishedAssetintoAssetbut kept the old names indandischema/models.pyas deprecated aliases so that consumers would keep importing successfully:Getting rid of them takes, in order:
dandischema/models.py, together with the remaining in-repo uses into_dataciteand the tests.PublishedDandiset/PublishedAssetkeys ofSCHEMA_MAP, sincepublish_model_schemataresolves each key withgetattr(models, class_).models_importstab.pyon thelinkml-conversionbranch (tracked separately in Remove the temporaryPublished*aliases frommodels_importstab.py#439).Findings as of filing (recheck before implementing)
dandi-cli is clear. Verified at
e982b3bc: it usesBareAsset, which stays, but neither deprecated alias.dandi-archive uses both, in four places.
api/views/schema.pyandapi/tests/test_schema.pyare the two #419 called out: each builds its mapping frommodel.__name__, so both already collapse from four entries to two silently rather than failing.The other two are load-bearing and fail at call time rather than at import, because they pass the name as a string:
dandiapi/api/services/publish/__init__.py:196—validate(..., schema_key='PublishedDandiset', json_validation=True)dandiapi/api/services/metadata/__init__.py:65,151— the same with'PublishedAsset'and'PublishedDandiset'validateresolves the key withgetattr(models, schema_key)(dandischema/metadata.py:234and:296), and both call sites sit on the publish path, so the breakage would surface at publication rather than at startup.The
SCHEMA_MAPquestion. Since #419 thepublished-*.jsonfiles have been byte-identical todandiset.jsonandasset.json, so emitting them buys nothing, and thelinkml-conversionbranch has already stopped generating them on the LinkML side (7ed984e9). ButSCHEMA_MAPis also the acceptedschema_keyvocabulary, and_get_jsonschema_validatorbuilds a URL into a released schema version from it, so dropping the keys outright would also drop the ability to validate older published metadata under its historical key.