Skip to content

Conversation

@astei
Copy link
Contributor

@astei astei commented Feb 13, 2025

First-time contributor. I think this change is still ultimately trivial, even though it also requires a change in pydantic-core too (since that's where the UUID validation logic lives).

Change Summary

Adds support for validating v6, v7, and v8 UUIDs. These versions are defined in RFC 9562. To pluck some really low-hanging fruit, implement support for it in pydantic.

Depends on pydantic/pydantic-core#1634 (UUIDv7), pydantic/pydantic-core#1636 (v6 / v8)

Related issue number

n/a

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

Selected Reviewer: @sydney-runkle

@github-actions github-actions bot added the relnotes-fix Used for bugfixes. label Feb 13, 2025
@astei
Copy link
Contributor Author

astei commented Feb 13, 2025

please review

@astei
Copy link
Contributor Author

astei commented Feb 13, 2025

CI failures look to be expected due to the dependent pydantic-core change

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 13, 2025

CodSpeed Performance Report

Merging #11436 will not alter performance

Comparing astei:astei/add-uuid-v7 (f533b69) with main (c8acbec)

Summary

✅ 46 untouched benchmarks

@Viicos
Copy link
Member

Viicos commented Feb 13, 2025

Thanks for the contribution. Could we also add version 6 and 8?

@astei
Copy link
Contributor Author

astei commented Feb 13, 2025

@Viicos I'm happy to do so, but this will require an additional change in pydantic-core. Will submit another PR for that.

@Viicos
Copy link
Member

Viicos commented Feb 13, 2025

Thanks, that would be great.

@sydney-runkle
Copy link
Contributor

This looks great, thanks for the contribution!

@astei astei changed the title Add support for validating v7 UUIDs Add support for validating v6, v7, v8 UUIDs Feb 14, 2025
@astei
Copy link
Contributor Author

astei commented Feb 14, 2025

@sydney-runkle @Viicos

I have added the v6/v8 support, as well as opening pydantic/pydantic-core#1636 to add the required support within pydantic-core.

@sydney-runkle
Copy link
Contributor

Perfect! When we do a pydantic-core patch release later this week, I'll pull this in and get across the line. Thanks!

@sydney-runkle sydney-runkle removed the awaiting author revision awaiting changes from the PR author label Feb 18, 2025
@sydney-runkle sydney-runkle merged commit e226612 into pydantic:main Feb 25, 2025
22 of 50 checks passed
sydney-runkle added a commit that referenced this pull request Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants