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

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

Closed
chaen opened this issue Nov 21, 2024 · 1 comment · Fixed by #325
Closed

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

chaen opened this issue Nov 21, 2024 · 1 comment · Fixed by #325

Comments

@chaen
Copy link
Contributor

chaen commented Nov 21, 2024

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
@martynia
Copy link
Contributor

OK, so I was not the only one affected. (#269)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants