-
Notifications
You must be signed in to change notification settings - Fork 640
feat: Updated BaseConfig class for non primitive fields #1684
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
base: main
Are you sure you want to change the base?
feat: Updated BaseConfig class for non primitive fields #1684
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.
Thank you for creating this PR! I've left a couple comments. Could you also confirm that you've tested this PR, and that it works for non-primitives, such as functions?
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.
Thank you @abhiramvad for the contribution! Given this changes a very sensitive class, would you be able to add unit tests to validate the logic ?
Sure, I need some time to add them. Will do that soon. |
I made the changes requested previously in comments. I have added few baseline tests, checking the test_config.py . Hope they align with what is needed. Kindly provide me comments on those. I'll update them soon. |
Hi @abhiramvad , could you please fix the precommit errors? You can verify it passes locally by running |
Thank you @abhiramvad for the updates! I think this is very close to the finish line. It looks like some of the new tests are failing? |
Description
This is a PR for the issue 1628. The
to_yaml
does not warn when trying to save non primitive data types (such as functions). This leads to errors while loading from saved yaml files.I have added a check to gracefully check for non primitive types recursively. If present, they are removed from the config. The removed types and their paths are specified to the user via logs.
Related issues
Fixes # (issue)
#1628
Before submitting
Reviewers
At least one review from a member of
oumi-ai/oumi-staff
is required.