oumi icon indicating copy to clipboard operation
oumi copied to clipboard

feat: Updated BaseConfig class for non primitive fields

Open abhiramvad opened this issue 6 months ago • 1 comments

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) https://github.com/oumi-ai/oumi/issues/1628

Before submitting

  • [ ] This PR only changes documentation. (You can ignore the following checks in that case)
  • [x] Did you read the contributor guideline Pull Request guidelines?
  • [x] Did you link the issue(s) related to this PR in the section above?
  • [x] Did you add / update tests where needed?

Reviewers

At least one review from a member of oumi-ai/oumi-staff is required.

abhiramvad avatar May 14 '25 05:05 abhiramvad

Sure, I need some time to add them. Will do that soon.

abhiramvad avatar May 19 '25 06:05 abhiramvad

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 ?

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.

abhiramvad avatar Jun 11 '25 05:06 abhiramvad

Hi @abhiramvad , could you please fix the precommit errors? You can verify it passes locally by running pre-commit run --all-files --show-diff-on-failure.

wizeng23 avatar Jun 11 '25 21:06 wizeng23

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?

oelachqar avatar Aug 03 '25 21:08 oelachqar

can we run the workflow again please?

abhiramvad avatar Sep 22 '25 00:09 abhiramvad

@abhiramvad could you fix the test error? You can run the checks locally with pre-commit run --all-files --show-diff-on-failure. Please re-request review when all tests pass locally.

wizeng23 avatar Sep 26 '25 19:09 wizeng23

@wizeng23 i fixed these errors. Here is a precommit check screenshot from my machine image

The tests work on my machine, and i also ran the CPU tests workflow on my fork. Lets hope it doesn't break here... https://github.com/abhiramvad/oumi/actions/runs/18120697923

abhiramvad avatar Sep 30 '25 06:09 abhiramvad

@wizeng23 can you review please?

abhiramvad avatar Oct 01 '25 18:10 abhiramvad

Thank you for making this change @abhiramvad !

wizeng23 avatar Nov 03 '25 19:11 wizeng23