dandi / dandi/dandi-schema

Remove the temporary `Published*` aliases from `models_importstab.py`

Open Beginner friendly
#439 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
7
Forks
15
PR merge metrics
No merged PRs in 30d

Description

Remove these two aliases from `dandischema/models_importstab.py` as part of the #419 follow-up that drops the deprecated aliases from `dandischema/models.py`:

```python
PublishedDandiset = Dandiset
PublishedAsset = Asset
```

The stub carries them only to stay a drop-in replacement for that module, so they should go as soon as it no longer needs to be.

Why the aliases exist

`dandischema/models_importstab.py` on `linkml-conversion` is what the conversion pipeline installs as `dandischema/models.py` on `linkml-auto-converted`. The aliases mirror the deprecated ones #419 left in `dandischema/models.py`, and they are needed because `metadata.SCHEMA_MAP` still names `PublishedDandiset` and `PublishedAsset` while `publish_model_schemata` resolves each key with `getattr(models, class_)`. Without them the `pydantic2json` stage of `./tools/linkml_conversion` fails:

```
AttributeError: module 'dandischema.models' has no attribute 'PublishedDandiset'
```

They were added in 54138ad3 on `linkml-conversion` and confirmed working by the regeneration at 0ce51b35 on `linkml-auto-converted`, where `models_pydantic/published-dandiset.json` and `models_pydantic/published-asset.json` resolve through the aliases and come out byte-identical to `dandiset.json` and `asset.json`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Open dandischema/models_importstab.py and locate the PublishedDandiset and PublishedAsset aliases described in the issue. Remove the temporary compatibility aliases, then run ./tools/linkml_conversion and confirm the pydantic2json stage completes without the missing-attribute error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.