OmegaConfigLoader
should not throw MissingConfigException
when the file is empty
#2566
Milestone
OmegaConfigLoader
should not throw MissingConfigException
when the file is empty
#2566
Description
Related #2556
Currently, if you have an empty configuration file with
OmegaConfigLoader
, you will get this error which isn't very accurate.This draft PR is just a starting point, it's expected to be picked up by someone and worked on it further.
kedro/kedro/config/omegaconf_config.py
Lines 195 to 200 in 6531457
This is due to the fact that we always return an empty dictionary when we load the configuration. In other words, we cannot distinguish between an empty file and a missing file.
kedro/kedro/config/omegaconf_config.py
Lines 274 to 275 in 6531457
We should take this as an opportunity to refactor and simplify these conditions. Bottom line we should have a better error message to handle empty configuration properly.
Context
How has this bug affected you? What were you trying to accomplish?
I was confused with the error because I have the config file. Initially I thought my configuration is not in the right place or I didn't config the
config_patterns
properly. The config file is actually read but the error is confusing.Expected Result
Tell us what should happen.
It should return an empty dictionary
{}
instead of getting error.Actual Result
Tell us what happens instead.
MissingConfigException
is thrown.The text was updated successfully, but these errors were encountered: