dandi / dandi/dandi-schema

Handle LinkML migration issue of `pydantic2linkml: Unable to translate the logic contained in the after validation function`

Open
#391 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

pydantic2linkml complains about not able to translate the logic in validation function as in

Image

or via `grep -n -A1 "Unable to translate the logic contained in the after validation" dandischema/models.yaml`.

## Cause
These are the result of pydantic2linkml not able translate runtime logic in Pydantic validation functions to LinkML.

## Stats

The validation functions that are causing the complains:

| Function | Count | Lines in `models.yaml` the complain appears|
|----------|-------|-------|
| `AccessRequirements.open_or_embargoed` | 1 | 331 |
| `Contributor.ensure_contact_person_has_email` | 5 | 419, 423, 719, 732, 736 |
| `dandischema.models.BareAsset.digest_check` | 1 | 461 |
| `dandischema.models.DandiBaseModel.ensure_schemakey` | 1 | 658 |
| `dandischema.models.PropertyValue.ensure_value` | 1 | 703 |
| `pydantic.networks.EmailStr._validate` | 1 | 487 |
| `pydantic.types.ByteSize._validate` | 1 | 395 |
| `Resource.identifier_or_url` | 1 | 631 |

Total complains: 12

## Solution

The runtime logic in each Pydantic validation function has to be evaluated individually for translation.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.