feat: migrate DSN types from pydantic.networks#368
Merged
yezz123 merged 1 commit intopydantic:mainfrom Mar 1, 2026
Merged
Conversation
Collaborator
|
Hello @bBlazewavE you can complete the work on this pr i will be happy to merge it as soon as everything migrated and all the tests passed |
e576ae1 to
bbf948d
Compare
Contributor
Author
Hi @yezz123 I have fixed the test on this PR, it's ready for review ! : ) |
Migrates all DSN types (PostgresDsn, RedisDsn, MongoDsn, MySQLDsn, MariaDBDsn, KafkaDsn, CockroachDsn, AmqpDsn, NatsDsn, ClickHouseDsn, SnowflakeDsn) from pydantic.networks to pydantic-extra-types as prep for pydantic V3. Closes pydantic/pydantic#9071
bbf948d to
41103f3
Compare
yezz123
approved these changes
Mar 1, 2026
Collaborator
yezz123
left a comment
There was a problem hiding this comment.
Looks clean 👍🏻
I will merge it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates all DSN types from
pydantic.networkstopydantic-extra-typesas preparation for pydantic V3.Closes pydantic/pydantic#9071
Types Migrated
PostgresDsnMultiHostUrlCockroachDsnUrlAmqpDsnUrlRedisDsnUrlMongoDsnMultiHostUrlKafkaDsnUrlNatsDsnMultiHostUrlMySQLDsnUrlMariaDBDsnUrlClickHouseDsnUrlSnowflakeDsnUrlImplementation
Each type uses
Annotated[Url/MultiHostUrl, UrlConstraints(...)]pattern, consistent with pydantic-core types. Multi-host types (Postgres, Mongo, NATS) useMultiHostUrlbase.Files
pydantic_extra_types/dsn.py— All 11 DSN type definitions with docstrings and examplestests/test_dsn.py— Comprehensive test suite covering valid URLs, invalid scheme rejection, and host-required validationTesting
All 13 test cases pass. Tests cover: