Skip to content
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

Make union case tags affect union error messages #8001

Merged
merged 6 commits into from Nov 6, 2023

Conversation

dmontagu
Copy link
Contributor

@dmontagu dmontagu commented Nov 2, 2023

This PR makes it so that you can get cleaner error messages when working with unions by providing Tags for union cases, even if you aren't using a discriminated union.

If this is accepted, we'll want to improve the docs related to Tag.

Copy link

cloudflare-pages bot commented Nov 3, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: ba117c3
Status: ✅  Deploy successful!
Preview URL: https://c7833dee.pydantic-docs2.pages.dev
Branch Preview URL: https://dmontagu-tag-union-error-mes.pydantic-docs2.pages.dev

View logs

Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, needs documentation.

docs/concepts/unions.md Outdated Show resolved Hide resolved
Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sydney-runkle sydney-runkle enabled auto-merge (squash) November 6, 2023 20:08
@sydney-runkle sydney-runkle mentioned this pull request Nov 6, 2023
10 tasks
@sydney-runkle sydney-runkle merged commit 1853b6b into main Nov 6, 2023
59 checks passed
@sydney-runkle sydney-runkle deleted the dmontagu/tag-union-error-message-improvements branch November 6, 2023 20:17
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.

None yet

4 participants