Fix enable_validation#2201
Conversation
|
@fehiepsi : shall we keep |
|
We decided to enable validation by default. I think setting the attribute to the global one might fix the issue. |
juanitorduz
left a comment
There was a problem hiding this comment.
Minor point, right @Qazalbash ?
| from . import constraints | ||
|
|
||
| _VALIDATION_ENABLED = True | ||
| _VALIDATION_ENABLED = False |
There was a problem hiding this comment.
Based on the comment above, we should keep _VALIDATION_ENABLED = True
There was a problem hiding this comment.
This is fixed. Note that this changes the behavior by default and might be a breaking change for some codebases. However, I find that it is much better to have validation enabled by default, as it was quite unintuitive in the first place.
Qazalbash
left a comment
There was a problem hiding this comment.
@juanitorduz Yes, the global variable value should be reverted.
Qazalbash
left a comment
There was a problem hiding this comment.
Thanks @renecotyfanboy
|
I think CI will trigger after @juanitorduz approves. Let's merge this PR only when the latest CI passes. |
|
@renecotyfanboy thanks! Can you push an empty commit (e.g., git commit -m"empty" --allow-empty ) to try to trigger the CI? 🙏 |
|
Enabling validation by default broke some tests in the CI. Should I simply wrap them around |
Hi there,
Here is a super small fix for validation. Currently, the validation context is handled using
_VALIDATION_ENABLEDglobal variable. By default_VALIDATION_ENABLED=Trueand_validate_args=Falseby default, which trigger weird behaviors when enabling / disabling the validation through contexts. But since everything is handled through mutating_VALIDATION_ENABLED, it sometimes produces weird behaviors.The simplest repro is :
The current fix produces the expected behavior.