HonahX commented on PR #1246: URL: https://github.com/apache/iceberg-python/pull/1246#issuecomment-2439780764
> This seems like a potential footgun. Perhaps we should get rid of _autocommit, its not used anywhere https://github.com/search?q=repo%3Aapache%2Ficeberg-python%20_autocommit&type=code The `_autocommit` flag/`autocommit` parameter in Transaction is used in some `Table`'s APIs: https://github.com/apache/iceberg-python/blob/de976fe1719882c1fc13f02950e82b4d894276aa/pyiceberg/table/__init__.py#L991-L1006 https://github.com/apache/iceberg-python/blob/de976fe1719882c1fc13f02950e82b4d894276aa/pyiceberg/table/__init__.py#L1077-L1078 https://github.com/apache/iceberg-python/blob/de976fe1719882c1fc13f02950e82b4d894276aa/pyiceberg/table/__init__.py#L976-L989 The idea is to make the code simpler if we only want to evolve schema/spec/... i.e. ```python with table.update_schema() as update: update.add_column("some_field", IntegerType(), "doc") ``` instead of another with..transaction wrapper ```python with table.transaction() as transaction: with transaction.update_schema() as update_schema: update.add_column("some_other_field", IntegerType(), "doc") ``` Since the recommended way to start a transaction is ```python txn = tbl.transaction() ``` , this option in general is not exposed to user directly: https://github.com/apache/iceberg-python/pull/471#discussion_r1503919299 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. Please let me know what you think! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org