[SFN] SNS Optimised Integration: Automatic Stringification of Message Arguments#10165
Merged
[SFN] SNS Optimised Integration: Automatic Stringification of Message Arguments#10165
Conversation
dominikschubert
approved these changes
Feb 1, 2024
Member
dominikschubert
left a comment
There was a problem hiding this comment.
minor nit, otherwise LGTM
Really appreciate the ultra fast turnaround time on this 💨
Comment on lines
90
to
93
| if "Message" in normalised_parameters: | ||
| message = normalised_parameters["Message"] | ||
| if not isinstance(message, str): | ||
| normalised_parameters["Message"] = to_json_str(message) |
Member
There was a problem hiding this comment.
Suggested change
| if "Message" in normalised_parameters: | |
| message = normalised_parameters["Message"] | |
| if not isinstance(message, str): | |
| normalised_parameters["Message"] = to_json_str(message) | |
| if message := normalized_parameters.get("Message"): | |
| if not isinstance(message, str): | |
| normalized_parameters["Message"] = to_json_str(message) |
bit of a nit (walrus operator)
also we generally try to use American English for consistency
Contributor
Author
There was a problem hiding this comment.
Thank you, Dominik! The walrus operator really improves readability in this case. I changed it slightly to ensure it wouldn't add missing 'Message' parameters (in case this is not given by the program).
About the British spelling, I realise it's a problem for this provider, I'll open a PR to standardise all of it!
Comment on lines
+1493
to
+1496
| "Message": { | ||
| "arg2": "World", | ||
| "arg1": "Hello", | ||
| "TaskToken": "<task_token:1>" |
maxhoheiser
pushed a commit
that referenced
this pull request
Feb 5, 2024
…f Message Arguments (#10165)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Currently, the StepFunctions v2 interpreter lacks support for automatic stringification of message arguments in the SNS Optimised Integration. This limitation can lead to unintended behaviour in publish calls. This PR addresses such lacking support and adds relevant validated snapshot tests for SNS integrations, including a callback scenario.
Changes