-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix(rust, python): raise if to_datetime would have parsed input incorrectly #9675
fix(rust, python): raise if to_datetime would have parsed input incorrectly #9675
Conversation
9c5d6a8
to
a27bb0e
Compare
a27bb0e
to
2246994
Compare
thanks for your review! merging then as the failure is unrelated |
or not any(month in fmt for month in ("%b", "%B", "%m")) | ||
) | ||
and "strict conversion to datetimes failed" in str(exc) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I would add a reject()
(after the sanity check) in situations like this, so Hypothesis will complain for us if we're generating mostly bad examples and thus not actually testing anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks - I tried that but then it was telling me that it was rejecting too many
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks - I tried that but then it was telling me that it was rejecting too many
I would reintroduce the reject()
and slap @settings(suppress_health_check=[HealthCheck.filter_too_much])
so there's a more honest recognition of that fact. I think this would also coerce Hypothesis to generate more examples, to compensate for the many filtered examples—need to check on that tho.
Ideally the strategy could be constructed in such a way its generating more valid examples. I'm pretty ignorant in this specific instance—if its to do with incompatible fmts to datetimes, maybe generate one first and then respectively generate the other?
closes #9673