-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Need to also emit legacy state for read override connectors when state is not specified #16569
Conversation
""" | ||
# vars(self.__class__) checks if the current class directly overrides the read() function | ||
if "read" in vars(self.__class__): | ||
return defaultdict(dict, state_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.
Could you share why you call defaultdict
with a dict
default factory?
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.
Great question! Not sure if it actually makes a difference, but the original code before the changes also wrapped it in defaultdict
so I wanted to preserve the same functionality. Reference to prior changes:
state = defaultdict(dict, state_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.
👍 from me, but deferring to @alafanechere's review
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.
Lgtm!
/publish-cdk dry-run=false
|
What
When fixing #16566 , I forgot to also emit the legacy format when state isn't specified.
How
Since we may need to conditionally emit the legacy format in more than one place, I refactored the condition into it's own function so it could be reused.
Tested again w/ the following conditions work with the correct state interpretation:
--state
specified in the read request: replicate all records, emit final state{}
: replicate all records, emit final state[]
: replicate all records, emit final state