We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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
config.to_json()
{ "val_a": 10, "val_b": null }
Which is expected behaviour, but we should get a warning that some keys were ignored (IMO)
The text was updated successfully, but these errors were encountered:
@WeberJulian can you maybe give a code example of when it should raise an error and when it should work?
Sorry, something went wrong.
@WeberJulian ?
I'll add that tonight
I added the description @erogol
maybe not allowing a new attributes would be safer
Agreed
No branches or pull requests
Here is an toy scenario where it would be nice to have a warning
There the value of
config.to_json()
isWhich is expected behaviour, but we should get a warning that some keys were ignored (IMO)
The text was updated successfully, but these errors were encountered: