Skip to content

Fix url serialization for unions#11233

Merged
sydney-runkle merged 1 commit intov2.10-patchesfrom
add-url-fix
Jan 8, 2025
Merged

Fix url serialization for unions#11233
sydney-runkle merged 1 commit intov2.10-patchesfrom
add-url-fix

Conversation

@sydney-runkle
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Will merge pending tests passing.

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

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%

@github-actions
Copy link
Copy Markdown
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