Skip to content

Conversation

ezegomez
Copy link
Contributor

@ezegomez ezegomez commented Aug 25, 2021

Change Summary

Allow ellipsis on Fields inside Annotated.

The usecase is TypedDicts, which can't have default values otherwise.
Meaning that adding Optionals to Annotated drops them from the list of
required fields, which the patch fixes.

I believe the change is minor enough to not deserve its own issue.

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes where applicable
  • changes/<pull request or issue id>-<github username>.md file added describing change
    (see changes/README.md for details)
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

Ezequiel Lara Gomez added 3 commits August 25, 2021 18:18
The usecase is TypedDicts, which can't have default values otherwise.
Meaning that adding Optionals to Annotated drops them from the list of
required fields, which the patch fixes.
Clarifies what's required with TypedDicts schemas.
@ezegomez
Copy link
Contributor Author

please review. I don't think this needs documentation changes (in fact documentation does not cover not allowing ellipses on annotated fields, since this is an edge case).

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.

Otherwise LGTM.

Almost scary how small this change was 😕

@samuelcolvin
Copy link
Member

please update.

@github-actions github-actions bot added awaiting author revision awaiting changes from the PR author and removed ready for review labels Dec 8, 2021
@github-actions github-actions bot assigned ezegomez and unassigned samuelcolvin and PrettyWood Dec 8, 2021
@ezegomez
Copy link
Contributor Author

please update.

should be done (dunno how to remove the "needs author revision" tag)

@samuelcolvin
Copy link
Member

please update.

should be done (dunno how to remove the "needs author revision" tag)

As per the note in the body of this PR, you can just add "please review".

I'm looking now.

@github-actions github-actions bot added ready for review and removed awaiting author revision awaiting changes from the PR author labels Aug 4, 2022
@samuelcolvin samuelcolvin enabled auto-merge (squash) August 4, 2022 14:11
@samuelcolvin
Copy link
Member

Good catch, thanks so much.

@samuelcolvin samuelcolvin merged commit 2ac10af into pydantic:master Aug 4, 2022
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.

4 participants