Improve DateRange validation#627
Conversation
Codecov Report
@@ Coverage Diff @@
## master #627 +/- ##
==========================================
+ Coverage 82.81% 82.82% +0.01%
==========================================
Files 5 5
Lines 3037 3039 +2
==========================================
+ Hits 2515 2517 +2
Misses 522 522
Continue to review full report at Codecov.
|
|
@jlstevens ready for review 🙃 |
|
Looks good to me! |
jbednar
left a comment
There was a problem hiding this comment.
Looks good to me, thanks! I agree that it would be nice to make messages more consistent, but don't have a terribly strong opinion between the ways that type information is printed. I think on balance I'd prefer a simpler, more-English like version (e.g. type float) over a syntax-y version (e.g. <class 'float'>).
|
Agreed, consistency would be good but for now this is an improvement. |
Noticed that the
DateRangeparameter was not checking that the value provided is atuple, which it should be given thatDateRangeinherits from Tuple.I've also changed the error message reported when one of the values is not of the correct type:
This is slightly different formatting compared to the messages reported by other Parameters, e.g. with a List:
Notice
of type floatvs.of type <class 'str'>. If the latter is preferred, I could update the error messages of the other Parameters.