Here is an toy scenario where it would be nice to have a warning
from dataclasses import dataclass
from coqpit import Coqpit
@dataclass
class SimpleConfig(Coqpit):
val_a: int = 10
val_b: int = None
if __name__ == "__main__":
config = SimpleConfig()
tmp_config = config.to_dict()
tmp_config["unknown_key"] = "Ignored value"
config.from_dict(tmp_config)
print(config.to_json())
There the value of config.to_json() is
{
"val_a": 10,
"val_b": null
}
Which is expected behaviour, but we should get a warning that some keys were ignored (IMO)