Skip to content
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

[automation/python] - Fix deserialization of UpdateSummary #6838

Merged
merged 2 commits into from Apr 22, 2021

Conversation

komalali
Copy link
Member

@komalali komalali commented Apr 21, 2021

Deserialization of config values in UpdateSummary was erroring when the config value is a map or array. This fixes the issue.

Fixes: #6809

@komalali komalali changed the title [automation/python] - Fix deserialization of config values [automation/python] - Fix deserialization of UpdateSummary Apr 21, 2021
@@ -88,7 +88,8 @@ def __init__(self,
self.version = version
self.config: ConfigMap = {}
for key in config:
self.config[key] = ConfigValue(**config[key])
config_value = config[key]
self.config[key] = ConfigValue(value=config_value["value"], secret=config_value["secret"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the error message before, did config[key] pass some unexpected parameters? Are "value" and "secret" fields required and always present? Especially "secret"? If it's optional consider config_value.get("secret", None).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, both secret and value are always present and required. Merged so we could get this in 3.1.

The error was TypeError: __init__() got an unexpected keyword argument 'objectValue' because when the config is a map or an array it includes objectValue which is the deserialized object. I think we probably ideally want to include that as a way of resolving #5506 - but for now for consistency with other SDKs, I've removed it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the right change then, thank you!!

@komalali komalali merged commit f523d25 into master Apr 22, 2021
@komalali komalali deleted the komalali/fix-python-config-parse branch April 22, 2021 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pulumi automation can not handle objectValue in Config
2 participants