Join the Kedro community

Updated last week

OmegaConfLoader Issue with Isoformatted Dates

When switching to OmegaConfLoader, it seems isoformatted dates (e.g. 2025-01-08) are no longer automatically converted to date objects. I thought an easy fix would be to create a custom resolver to do the conversion for me. But then I got an error stating that a date object was not a valid primitive type when creating OmegaConf objects. The issue seems to be when soft-merging params, you convert resolved dict objects back into OmegaConf objects which caused the error. Is this a bug?

A
M
N
9 comments

Any ETA on when it should be resolved?

no ETA yet, I think it will take some time if we want to address it by turning config into DictConfig to solve other problems as well. Though I think for this particularly problem we should remove the use of OmegaConf and keep the recursive merge. I haven't checked if it will break anything, I believe this was not added intentionally.

Won’t the recursive merge break the soft merge option?

I think an easy fix is to keep using the DictConfig obj internally in the getitem function of OmegaConfLoader

Or only resolve at the end of that function…

Not sure if the soft merge matters here, this bug happen at the KedroContext level which the config has already been merged.

The merge here is between the "final" config and runtime_params, a bit of legacy with how parameters override works in the old day.

I took a quick stab on this https://github.com/kedro-org/kedro/pull/4405, and passed the fail commands described in the original issue.

full test suite is still running, but feel free to test if it fixes your problem.

Add a reply
Sign up and join the conversation on Slack