diff --git a/rerun_py/tests/e2e_redap_tests/test_table_create.py b/rerun_py/tests/e2e_redap_tests/test_table_create.py index 38e7d4427b4c..8099efdf8c24 100644 --- a/rerun_py/tests/e2e_redap_tests/test_table_create.py +++ b/rerun_py/tests/e2e_redap_tests/test_table_create.py @@ -49,3 +49,29 @@ def test_create_table_from_dataset(prefilled_catalog: PrefilledCatalog, tmp_path for returned_field in returned_schema: original_field = original_schema.field(returned_field.name) assert returned_field.metadata == original_field.metadata + + +def test_create_existing_table_fails(prefilled_catalog: PrefilledCatalog, tmp_path: pathlib.Path) -> None: + from .conftest import TABLE_FILEPATH + + existing_table_name = "simple_datatypes" + + _existing_table = prefilled_catalog.client.ctx.table(prefilled_catalog.factory.apply_prefix(existing_table_name)) + + schema = pa.schema([("int64", pa.int64()), ("float32", pa.float32()), ("utf8", pa.utf8())]) + + with pytest.raises( + Exception, + match="failed to create table", + ): + _table_entry = prefilled_catalog.factory.create_table_entry( + existing_table_name, schema, tmp_path.absolute().as_uri() + ) + + existing_table_location = f"file://{TABLE_FILEPATH}" + + with pytest.raises( + Exception, + match="failed to create table", + ): + _table_entry = prefilled_catalog.factory.create_table_entry("new_table_name", schema, existing_table_location)