-
Notifications
You must be signed in to change notification settings - Fork 276
feat(transaction): Remove current_table, updates, and requirements from Transaction #1451
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
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks @CTTY for this pr, generally looks good to me!
for update in updates { | ||
metadata_builder = update.clone().apply(metadata_builder)?; | ||
} | ||
|
||
self.current_table | ||
.with_metadata(Arc::new(metadata_builder.build()?.metadata)); | ||
table.with_metadata(Arc::new(metadata_builder.build()?.metadata)); |
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.
Not related to this pr, and it's not mandatory. But I think it's better to change the with_metadata(mut self)
to consume table rather than modify 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.
this is a very good point. I did notice people are confused with the usage of tx.apply in other discussions, and making with_metadata
consume tables would require tx.apply
to return Result<Table>
instead of Result<()>
and make it clearer on its usage.
I've included the change in this PR, please let me know what you think!
Which issue does this PR close?
Related Issue
Closes:
What changes are included in this PR?
This PR wraps up the effort to make Transaction API + TransactionAction retryable!
With
Transaction
holds retryableactions
, it no longer needs to hold staging variables likecurrent_table
,updates
, orrequirements
. These can be generated withindo_commit
.Are these changes tested?
Existing unit tests