kevinjqliu commented on issue #1505:
URL:
https://github.com/apache/iceberg-python/issues/1505#issuecomment-2583565807
Hey @jiakai-li thanks for raising this issue!
The root cause is the same as the one i raised in #1253 and #1497
Specifically, when using UpdateSchema as a "transaction" and a context
manager, I expect the transaction to be atomic
```
with table.update_schema() as update:
update.add_column("field_should_not_exist", IntegerType())
raise Exception("Error!")
```
This example shows that the first `add_column` is processed, even though the
transaction errored and should not apply any updates.
The core issue is from setting Transaction's `autocommit=True` in
`UpdateSchema`
([source](https://grep.app/search?q=autocommit%3DTrue&filter[repo][0]=apache/iceberg-python))
This will cause every update to be "applied"/"flushed" as soon as possible
([source](https://github.com/apache/iceberg-python/blob/a95f9ee6e231104319c01493cb3ada59d9e782d0/pyiceberg/table/__init__.py#L249-L270))
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]