Skip to content

Conversation

a-gardner1
Copy link
Contributor

@a-gardner1 a-gardner1 commented Sep 11, 2024

What does this PR do?

This PR fixes inference of required and missing keys in TypedDicts.

Closes #570

Before submitting

  • Did you read the contributing guideline?
  • Did you update the documentation? (readme and public docstrings)
  • Did you write unit tests such that there is 100% coverage on related code? (required for bug fixes and new features)
  • Did you verify that new and existing tests pass locally?
  • Did you make sure that all changes preserve backward compatibility?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

@a-gardner1 a-gardner1 marked this pull request as draft September 11, 2024 17:39
@a-gardner1
Copy link
Contributor Author

You may note that this can be considered either a bug fix or the addition of a new feature. I've added changelog entries for both; please let me know your preference.

@a-gardner1 a-gardner1 marked this pull request as ready for review September 11, 2024 17:56
Copy link

codecov bot commented Sep 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (88c0387) to head (0fb67cc).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #571   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines         6439      6462   +23     
=========================================
+ Hits          6439      6462   +23     
Flag Coverage Δ
py3.10 85.75% <87.09%> (+0.01%) ⬆️
py3.10_all 98.73% <100.00%> (+0.03%) ⬆️
py3.10_pydantic1 48.90% <77.41%> (+0.15%) ⬆️
py3.10_pydantic2 48.68% <77.41%> (+0.15%) ⬆️
py3.10_types 98.74% <100.00%> (+0.03%) ⬆️
py3.11 85.74% <93.54%> (+0.05%) ⬆️
py3.11_all 98.69% <100.00%> (+0.03%) ⬆️
py3.11_types 98.71% <100.00%> (+0.03%) ⬆️
py3.12 85.88% <93.54%> (+0.05%) ⬆️
py3.12_all 98.69% <100.00%> (+0.03%) ⬆️
py3.12_types 98.71% <100.00%> (+0.03%) ⬆️
py3.7 86.35% <93.54%> (+0.20%) ⬆️
py3.7_all 99.32% <93.54%> (+0.15%) ⬆️
py3.7_types 99.37% <93.54%> (+0.15%) ⬆️
py3.8 86.36% <87.09%> (+0.01%) ⬆️
py3.8_all 99.33% <100.00%> (+<0.01%) ⬆️
py3.8_types 99.36% <100.00%> (+<0.01%) ⬆️
py3.9 86.28% <87.09%> (+0.01%) ⬆️
py3.9_all 99.28% <100.00%> (+<0.01%) ⬆️
py3.9_types 99.30% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@a-gardner1
Copy link
Contributor Author

@mauvilsa It is actually ready now

Copy link
Member

@mauvilsa mauvilsa left a comment

Choose a reason for hiding this comment

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

It is looking good!

Please extend DOCUMENTATION.rst#L403-L405 to mention the support for NotRequired and Required.

a-gardner1 and others added 3 commits September 12, 2024 11:22
Co-authored-by: Mauricio Villegas <5780272+mauvilsa@users.noreply.github.com>
Co-authored-by: Mauricio Villegas <5780272+mauvilsa@users.noreply.github.com>
Copy link

@mauvilsa mauvilsa merged commit 27137b5 into omni-us:main Sep 13, 2024
29 checks passed
@mauvilsa mauvilsa added the enhancement New feature or request label Sep 13, 2024
@a-gardner1 a-gardner1 deleted the wip-not-required-keys branch September 17, 2024 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NotRequired keys of TypedDict are incorrectly inferred as required
2 participants