You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, there may still be some concerns around this since Transaction is a public class. If this is the case, I think we can start from making the parameter "private" (autocommit -> _autocommit) and/or adding some doc to explain the usage.
The text was updated successfully, but these errors were encountered:
The idea is to make the code simpler if we only want to evolve schema/spec/...
i.e.
with table.update_schema() as update:
update.add_column("some_field", IntegerType(), "doc")
instead of another with..transaction wrapper
with table.transaction() as transaction:
with transaction.update_schema() as update_schema:
update.add_column("some_other_field", IntegerType(), "doc")
....
What about moving the autocommit logic out of Transaction and into the class that uses it instead?
For example, UpdateSchema can implement __enter__ and __exit__ to commit the transaction automatically?
Porting over from #1246
Can be a potential footgun (#1246 (comment))
Autocommit usage (#1246 (comment))
The text was updated successfully, but these errors were encountered: