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
{{ message }}
Repository navigation
Commit 401c582
Browse filesBrowse the repository at this point in the historyBrowse files
Raise on view-table collisions in create/register/rename
- Add `_raise_if_view_exists` helper that maps `view_exists(id) == True` at
the target identifier to `TableAlreadyExistsError`. Catalogs without view
support (most non-REST impls) raise `NotImplementedError` from
`view_exists`; treat that as "no view at this identifier".
- Wire the check into `create_table`, `register_table`, and `rename_table`
on SqlCatalog, HiveCatalog, GlueCatalog, DynamoDbCatalog, and
BigQueryMetastoreCatalog (skipping methods that already raise
`NotImplementedError`). Also call it from
`MetastoreCatalog.create_table_transaction`.
- For `rename_table`, the check is on the destination identifier.
- RestCatalog intentionally unchanged: the server's 409 response is the
authority and an extra client-side HEAD per call would be wasted.
- Re-uses `TableAlreadyExistsError` so existing `create_table_if_not_exists`
callers see the same exception type they already catch.
- Tests: unit tests for the helper (returns True / False / raises
`NotImplementedError`) in `tests/catalog/test_base.py`, plus
parametrized behavior tests over InMemoryCatalog + SqlCatalog in
`tests/catalog/test_catalog_behaviors.py` that monkeypatch `view_exists`
to assert each call site invokes the helper.
0 commit comments