Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-47769: Refactor Wobbly schema to support Pydantic #11

Merged
merged 1 commit into from
Nov 25, 2024
Merged

Commits on Nov 23, 2024

  1. Refactor Wobbly schema to support Pydantic

    Instead of writing an explicit object conversion function, rework
    the Wobbly schema so that ORM objects can be converted directly to
    Pydantic objects using `model_validate`. This requires moving the
    ordering of results into the ORM rather than doing it manually,
    moving the error attributes into a table and allowing more than one
    error, and reworking the schema for results to avoid an autogenerated
    key that clashes with the client-provided result ID.
    
    UWS does not allow multiple errors in the current schema, but any
    revision of the standard should ideally support multiple errors.
    For now, we can follow the convention of storing at most one error
    and not use this schema functionality, but since it makes the
    Pydantic integration easier, it seemed better to future-proof now.
    
    Change the cascade configuration of the job ORM model to ensure that
    any orphaned result or error objects are deleted, which was already
    required by the schema.
    rra committed Nov 23, 2024
    Configuration menu
    Copy the full SHA
    233247e View commit details
    Browse the repository at this point in the history