Skip to content

Conversation

samuelcolvin
Copy link
Member

fix #295

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes
  • No performance deterioration (if applicable)
  • HISTORY.rst has been updated
    • if this is the first change since a release, please add a new section
    • include the issue number or this pull request number #<number>
    • if you're not a regular contributer please include your github username @whatever

@codecov
Copy link

codecov bot commented Nov 15, 2018

Codecov Report

Merging #298 into master will not change coverage.
The diff coverage is 100%.

@@          Coverage Diff          @@
##           master   #298   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          12     12           
  Lines        1515   1517    +2     
  Branches      280    281    +1     
=====================================
+ Hits         1515   1517    +2

@samuelcolvin samuelcolvin merged commit ef14005 into master Nov 15, 2018
@samuelcolvin samuelcolvin deleted the fix-date-parsing branch November 15, 2018 12:21
@@ -90,7 +90,10 @@ def parse_date(value: Union[date, StrIntFloat]) -> date:
Raise ValueError if the input isn't well formatted.
"""
if isinstance(value, date):
return value
if isinstance(value, datetime):
Copy link

Choose a reason for hiding this comment

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

Note that we might want to update the type hint for value to accept datetime as well.

alexdrydew pushed a commit to alexdrydew/pydantic that referenced this pull request Dec 23, 2023
…#298)

* combine literal_single_error and literal_multiple_error

* cleanup and test union
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.

Date annotation is parsed inconsistently depending on input data.
2 participants