Skip to content

Revert "Fix default port for mongosrv DSNs (#6827)"#7116

Merged
Kludex merged 2 commits intomainfrom
revert-union-mongodsn-2
Aug 14, 2023
Merged

Revert "Fix default port for mongosrv DSNs (#6827)"#7116
Kludex merged 2 commits intomainfrom
revert-union-mongodsn-2

Conversation

@Kludex
Copy link
Copy Markdown
Member

@Kludex Kludex commented Aug 14, 2023

Since we are reverting that PR, the idea is that we recommend doing the following for #6774:

from typing import Annotated

from pydantic.networks import UrlConstraints
from pydantic_core import MultiHostUrl

MongoSRVDsn = Annotated[MultiHostUrl, UrlConstraints(allowed_schemes=['mongodb+srv'])]

Related issue number

Notes

@dmontagu mentioned that we should keep the tests that were added. So I'll add on the next commit... Added.

Selected Reviewer: @davidhewitt

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Aug 14, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: a815afc
Status: ✅  Deploy successful!
Preview URL: https://114fd311.pydantic-docs2.pages.dev
Branch Preview URL: https://revert-union-mongodsn-2.pydantic-docs2.pages.dev

View logs

@Kludex
Copy link
Copy Markdown
Member Author

Kludex commented Aug 14, 2023

please review

@kikones34
Copy link
Copy Markdown

What was the reasoning for this reversion? Without the fix, the MongoDsn validator produces invalid mongo URIs when given a mongo+srv URI.

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.

MongoDsn.build gives AttributeError

4 participants