-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
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
ConfigTree.merge_configs fails when one ConfigTree comes from file and another from dict #137
Comments
Addresses issue chimpler#137
Also experienced this. The error is
|
I'm also running into this. For me it's a little more subtle and appears to be dependent on whether the dict overrides values in some or all sub-trees of the file-based config. |
My temporary/hacky workaround for this is to parse the dictionary once using c1 = ConfigFactory.parse_file("some.conf")
c2 = ConfigFactory.from_dict({"foo": 1, "bar.splat": 2})
c2 = ConfigFactory.parse_string(json.dumps(c2)) It's a little hacky, but seems to handle everything and results in a valid config. |
On recent versions of pyhocon the merge_configs methods make reference to the attribute "history" of the ConfigTree. This attribute is set when read from file, but is not set when CofigFactory.from_dict is called. This causes the merge_configs methods to fail when e.g. a file is read and some dictionary of overrides is to be merged on top of the file options.
The text was updated successfully, but these errors were encountered: