-
Notifications
You must be signed in to change notification settings - Fork 1.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
feat: Add env var LUDWIG_SCHEMA_VALIDATION_POLICY
to change marshmallow validation strictness
#3226
Conversation
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.
My only question is how extensively have you tested this locally? (Last thing I was fiddling around with pytest env variables and was about to try Ludwig CLI).
In particular, I want to check if there are any breakages when RAISE
is set for schemas that explicitly allow additional params via JSON. That means (based on a ctrl-f):
- input features (top-level)
- output features (top-level)
- preprocessing
- augmentation
Really, just one of these cases suffices as a sanity check for the rest.
(Also, I believe we're covered but we have to be careful that any internal parameters are in fact declared on their respective schemas (e.g. proc_column
for input features) - otherwise RAISE
will reject them.)
It's a good point @ksbrar, I haven't tested this extensively! If you have some cycles to test it out, please take a look and let me know what you find. |
I've tested out this PR. It doesn't work as is because the deprecation warning PR I merged a little while ago is actually performing the wrong task and is too aggressive in filtering parameters. This code (#3118) will filter out and log any and every unknown parameter as deprecated - which is the incorrect thing to do, as there is a clear distinction between a purely "unknown" or invalid parameter and a "deprecated" one - before marshmallow even has a chance to raise an error about the unknown parameters. I just pushed a simple fix that gets us to what we want (a user sets this environment flag to |
Synced offline -- upgrading the config, removing known deprecated parameters, and logging warnings for them is handled by We should be good to proceed with this PR (just blocked on writing a test). Follow-up PRs to continue progress towards making
|
@justinxzhao I spent some time and just couldn't get the environment variable switching to work properly for the test. If someone else wants to give it a go, here is some rough code showing a couple different attempts. I can clean it up/give some clarification if need be:
But changing the validation policy is easy enough to verify locally in a terminal, so I think we can proceed with just landing this PR. |
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.
Good to go from my standpoint.
LUDWIG_SCHEMA_VALIDATION_POLICY
to change marshmallow validation strictness
…llow validation strictness (#3226) Co-authored-by: ksbrar <kabir@brar.xyz>
…llow validation strictness (#3226) Co-authored-by: ksbrar <kabir@brar.xyz>
Closes #3218.