Expand test coverage for experimental Pipeline API#9595
Expand test coverage for experimental Pipeline API#9595sydney-runkle merged 1 commit intopydantic:mainfrom
Conversation
|
please review |
CodSpeed Performance ReportMerging #9595 will not alter performanceComparing Summary
|
sydney-runkle
left a comment
There was a problem hiding this comment.
Amazing, thanks so much @K-dash!
What did you think about this API? We're looking for feedback on this new experimental feature 🚀 !
|
@sydney-runkle
I genuinely think this is a great feature. In the past, when defining complex constraints and transformations for model fields in Pydantic, we had to use separate Field Validators and Model Validators. However, with the introduction of this pipeline API, I believe it has enhanced type safety and improved readability with more concise syntax. If there are any other benefits or effective ways to use this pipeline API, I would love to learn about them. :) I understand this is currently an experimental feature, but I look forward to incorporating it once it is officially released. Thank you for implementing such a useful feature! |
|
Wonderful, thanks so much for your feedback! We're super excited to get your feedback. @adriangb did all of the initial work on this awesome feature, and even wrote a PEP to help support this! https://peps.python.org/pep-0746/ I think the main benefits are:
I'm sure there are even more things, but these were the main motivating factors! |
|
@sydney-runkle
Indeed, I also think the above two benefits are significant. Thank you. |
Change Summary
I have added the following test cases to
test_pipeline.py:test_ge_le_gt_ltgeandle, so I added test codes forgtandlt.test_parse_multipleOfint, so I added test codes forfloatanddecimal.test_len_constraintstest_interval_constraintstest_parse_tzValueError.Pre-PR Coverage of pipeline.py: 83.30%
Current Coverage of pipeline.py w/ this PR: 93.01%
Related issue number
fix #9524
Checklist
Selected Reviewer: @sydney-runkle