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

Check union args to don't consider Optional fields as complex Union #138

Merged
merged 3 commits into from
Aug 8, 2023

Conversation

hramezani
Copy link
Member

@hramezani hramezani commented Aug 7, 2023

Closes #135
Closes #136

Selected Reviewer: @samuelcolvin

@codecov
Copy link

codecov bot commented Aug 7, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01% 🎉

Comparison is base (04ec4c7) 97.46% compared to head (31990bc) 97.47%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #138      +/-   ##
==========================================
+ Coverage   97.46%   97.47%   +0.01%     
==========================================
  Files           5        5              
  Lines         315      317       +2     
  Branches       68       69       +1     
==========================================
+ Hits          307      309       +2     
  Misses          6        6              
  Partials        2        2              
Files Changed Coverage Δ
pydantic_settings/sources.py 97.73% <100.00%> (+0.01%) ⬆️

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

@hramezani hramezani force-pushed the check-union-is-complex branch 2 times, most recently from 9059838 to 8d2b3d9 Compare August 7, 2023 15:10
@hramezani
Copy link
Member Author

please review

data: Optional[Json[Dict[str, str]]] = Field(default=None)

s = Settings()
print(s.data)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
print(s.data)

@hramezani hramezani merged commit 5933ea6 into main Aug 8, 2023
20 checks passed
@hramezani hramezani deleted the check-union-is-complex branch August 8, 2023 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants