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

add pydantic.color.Color objects as available input for Color fields #1258

Merged
merged 8 commits into from Feb 26, 2020

Conversation

leosussan
Copy link
Contributor

@leosussan leosussan commented Feb 25, 2020

Change Summary

If you pass a pydantic.color.Color object to a Color field, it will fail b/c the object

This small edit allows for Color objects as acceptable input for Color fields.

Related issue number

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 25, 2020

Codecov Report

Merging #1258 into master will not change coverage by %.
The diff coverage is n/a.

@@            Coverage Diff            @@
##            master     #1258   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines         3666      3669    +3     
  Branches       718       719    +1     
=========================================
+ Hits          3666      3669    +3     

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...3c3a8d6. Read the comment docs.

@leosussan leosussan changed the title add pydantic.color.Color objects as available input for Color fields WIP: add pydantic.color.Color objects as available input for Color fields Feb 25, 2020
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 looks good.

pydantic/color.py Show resolved Hide resolved
pydantic/color.py Outdated Show resolved Hide resolved
fix: remove ._original conditional (logic is set earlier in the method)
fix: removed pydantic.color.Color line from errorstring
@leosussan leosussan changed the title WIP: add pydantic.color.Color objects as available input for Color fields add pydantic.color.Color objects as available input for Color fields Feb 26, 2020
@samuelcolvin
Copy link
Member

awesome, thank you. Sorry about the docs build, I'll fix it when I'm back in the UK.

@samuelcolvin samuelcolvin merged commit c4e4274 into pydantic:master Feb 26, 2020
RajatRajdeep pushed a commit to RajatRajdeep/pydantic that referenced this pull request May 14, 2024
…ntic#1258)

Signed-off-by: Lance Drane <dranelt@ornl.gov>
Signed-off-by: Lance-Drane <ldraneutk@gmail.com>
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.

None yet

2 participants