Skip to content

Conversation

kokes
Copy link
Contributor

@kokes kokes commented Feb 21, 2020

Change Summary

As discussed in #1072, the very first example in the docs does not feature valid mypy annotations (nullable datetime is not designated as optional). I suggest fixing this to follow mypy annotations fully.

There was some discussion about adding more narrative to these docs - I have not done so, because I can't quite figure out what to say exactly - if the Optional type hint should be elaborated on or something? I'd welcome suggestions regarding this.

Related issue number

#1072

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)

@codecov
Copy link

codecov bot commented Feb 21, 2020

Codecov Report

Merging #1248 into master will decrease coverage by 0.10%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##            master    #1248      +/-   ##
===========================================
- Coverage   100.00%   99.89%   -0.11%     
===========================================
  Files           21       21              
  Lines         3666     3689      +23     
  Branches       718      726       +8     
===========================================
+ Hits          3666     3685      +19     
- Misses           0        2       +2     
- Partials         0        2       +2     
Impacted Files Coverage Δ
pydantic/utils.py 98.92% <0.00%> (-1.08%) ⬇️
pydantic/schema.py 99.44% <0.00%> (-0.56%) ⬇️
pydantic/color.py 100.00% <0.00%> (ø) ⬆️
pydantic/fields.py 100.00% <0.00%> (ø) ⬆️
pydantic/validators.py 100.00% <0.00%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 645e5fe...3d7f1f8. Read the comment docs.

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.

kokes and others added 2 commits March 3, 2020 08:50
explicit assignment for an optional field

Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>
explicit assignment for an optional field

Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>
@samuelcolvin samuelcolvin merged commit ddc8e5a into pydantic:master Mar 4, 2020
@samuelcolvin
Copy link
Member

thanks so much.

RajatRajdeep pushed a commit to RajatRajdeep/pydantic that referenced this pull request May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants