Skip to content

Fix url serialization for unions #11233

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

Merged
merged 1 commit into from
Jan 8, 2025
Merged

Fix url serialization for unions #11233

merged 1 commit into from
Jan 8, 2025

Conversation

sydney-runkle
Copy link
Contributor

Cherry picking 5d92c05

Specifically, we've made the serialization for url types more strict. If a non-url type is passed into the serializer, we raise an unexpected value warning instead of just blindly attempting to stringify the input. This results in more intuitive behavior for serializing unions with url types.
@github-actions github-actions bot added the relnotes-fix Used for bugfixes. label Jan 8, 2025
@sydney-runkle
Copy link
Contributor Author

Will merge pending tests passing.

@sydney-runkle sydney-runkle merged commit 6e585f9 into v2.10-patches Jan 8, 2025
52 checks passed
@sydney-runkle sydney-runkle deleted the add-url-fix branch January 8, 2025 16:06
Copy link

codspeed-hq bot commented Jan 8, 2025

CodSpeed Performance Report

Merging #11233 will degrade performances by 5.6%

Comparing add-url-fix (5f1ecdc) with main (5d92c05)

Summary

❌ 1 regressions
✅ 43 untouched benchmarks
⁉️ 2 dropped benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main add-url-fix Change
⁉️ test_getattr 53.9 µs N/A N/A
⁉️ test_setattr 85.9 µs N/A N/A
test_tagged_union_with_callable_discriminator_schema_generation 1.8 ms 1.9 ms -5.6%

Copy link
Contributor

github-actions bot commented Jan 8, 2025

Coverage report

This PR does not seem to contain any modification to coverable code.

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

Successfully merging this pull request may close these issues.

2 participants