Skip to content

Fix URL definition to adapt to new version of pydantic #326

@chaen

Description

@chaen

From pydantic 2.10, URL should be defined a bit differently

https://pydantic.dev/articles/pydantic-v2-10-release#migrate-to-subclassing-instead-of-annotated-approach-for-pydantic-url-types

while doing the change, they broke the existing (but are already fixing it): pydantic/pydantic#10914

For us, this translate into the tests failing with stacktrace looking like

                    forbid_inf_nan_check,
                    schema,
                )
            else:
                # It's rare that we'd get here, but it's possible if we add a new constraint and forget to handle it
                # Most constraint errors are caught at runtime during attempted application
>               raise RuntimeError(f"Unable to apply constraint '{constraint}' to schema of type '{schema_type}'")
E               RuntimeError: Unable to apply constraint 'host_required' to schema of type 'function-wrap'

../../../miniforge3/envs/diracx-dev/lib/python3.11/site-packages/pydantic/_internal/_known_annotated_metadata.py:285: RuntimeError

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