-
Notifications
You must be signed in to change notification settings - Fork 115
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
Allow customizing ResourceOptions in transformations #575
Conversation
Adds the ability for transformations to see the current ResourceOptions and modify it if desired on an per-resource basis. Fixes #574.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node changes LGTM
# Allow users to change API objects before any validation. | ||
if transformations is not None: | ||
for t in transformations: | ||
obj = t(obj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW - note that this code previous did obj = t(obj)
which is not the same semantics as JavaScript, and is possibly quite surprising. It's also not compatible with the change we want to make here.
I went ahead and changed it, though this is a breaking change. Curious if there's feedback on whether to take the breaking change to align these, or to adjust the PR somehow else to avoid it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'd go with the breaking change. It was unintentional behavior introduced when I ported from the Node SDK, and isn't widely used yet. We had at least one user mention that it was surprising, so I'd been intending to fix it anyway.
Adds the ability for transformations to see the current ResourceOptions and modify it if desired on an per-resource basis.
Fixes #574.