Skip to content

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

@candleindark

Description

@candleindark

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions