ialarmedalien opened a new pull request, #4408: URL: https://github.com/apache/iceberg-python/pull/4408
# Rationale for this change Currently, `SqlCatalog` catches sqlalchemy `IntegrityError`s on table operations (`create_table`, `register_table`, `rename_table`, `commit_table`) and converts them into `TableAlreadyExistsError`. This PR updates `create_namespace` to raise a `NamespaceAlreadyExistsError` if there are two concurrent requests to create the same namespace. Existing behaviour that throws an `IntegrityError` if namespace property-value pairs contain `None` (as tested in `tests/catalog/test_catalog_behaviors.py`) is preserved. Note that because the PK is a composite of catalog_name, namespace, and property_key, two concurrent requests with disjoint property keys do not trigger an `IntegrityError`, so no `NamespaceAlreadyExistsError` would be thrown. ## Are these changes tested? Yes -- see `test_create_namespace_concurrent_integrity_error` in `tests/catalog/test_sql.py`. ## Are there any user-facing changes? No. -- 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]
