You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Feature: Add interpolate keyword to as_dict() and as_attrdict() #33
changed the title [-]as.dict() and as.attrdict() do not interpolate when interpolate=True[/-][+]Feature: Add interpolate keyword to as_dict() and as_attrdict()[/+]on Jul 13, 2020
File "/group/siv_roast_bkup/staff/chinghwa/config-test/mytest.py", line 14, in <module>
print(cfg.as_attrdict(interpolation=True))
File "/group/siv_roast_bkup/staff/chinghwa/python-configuration/config/configuration.py", line 202, in as_attrdict
d = self.as_dict(interpolation=interpolation, nested=nested)
File "/group/siv_roast_bkup/staff/chinghwa/python-configuration/config/configuration_set.py", line 133, in as_dict
return Configuration(result).as_dict(interpolation=interpolation, nested=nested)
File "/group/siv_roast_bkup/staff/chinghwa/python-configuration/config/configuration.py", line 184, in as_dict
v = v.as_dict(interpolation=True)
File "/group/siv_roast_bkup/staff/chinghwa/python-configuration/config/configuration.py", line 184, in as_dict
v = v.as_dict(interpolation=True)
File "/group/siv_roast_bkup/staff/chinghwa/python-configuration/config/configuration.py", line 184, in as_dict
v = v.as_dict(interpolation=True)
File "/group/siv_roast_bkup/staff/chinghwa/python-configuration/config/configuration.py", line 182, in as_dict
v = interpolated_copy[cast(str, k)]
File "/group/siv_roast_bkup/staff/chinghwa/python-configuration/config/configuration.py", line 157, in __getitem__
return interpolate_object(item, v, [d], self._interpolate_type)
File "/group/siv_roast_bkup/staff/chinghwa/python-configuration/config/helpers.py", line 192, in interpolate_object
return interpolate_standard(obj, flatten(d), set())
File "/group/siv_roast_bkup/staff/chinghwa/python-configuration/config/helpers.py", line 111, in interpolate_standard
interpolated = {v: interpolate_standard(d[v], d, found) for v in variables}
File "/group/siv_roast_bkup/staff/chinghwa/python-configuration/config/helpers.py", line 111, in <dictcomp>
interpolated = {v: interpolate_standard(d[v], d, found) for v in variables}
KeyError: 'var'
Activity
tr11 commentedon Jul 13, 2020
That's by design -- maybe I can add an
interpolatekeyword to both methods to perform the interpolations.[-]as.dict() and as.attrdict() do not interpolate when interpolate=True[/-][+]Feature: Add interpolate keyword to as_dict() and as_attrdict()[/+]tr11 commentedon Aug 1, 2020
Take a look at #35. Can you test it to see if it does what you need?
chinghwayu commentedon Aug 4, 2020
I'm getting an error with
conf.py
dir/conf.py
mytest.py