diff --git a/pyiceberg/catalog/rest.py b/pyiceberg/catalog/rest.py index 76a64fc8a7..fd111354ed 100644 --- a/pyiceberg/catalog/rest.py +++ b/pyiceberg/catalog/rest.py @@ -918,9 +918,7 @@ def view_exists(self, identifier: Union[str, Identifier]) -> bool: bool: True if the view exists, False otherwise. """ response = self._session.head( - self.url( - Endpoints.view_exists, prefixed=True, **self._split_identifier_for_path(identifier, IdentifierKind.VIEW) - ), + self.url(Endpoints.view_exists, prefixed=True, **self._split_identifier_for_path(identifier, IdentifierKind.VIEW)), ) if response.status_code == 404: return False diff --git a/tests/integration/test_writes/test_writes.py b/tests/integration/test_writes/test_writes.py index 5a0af656bd..1fe29c684c 100644 --- a/tests/integration/test_writes/test_writes.py +++ b/tests/integration/test_writes/test_writes.py @@ -1424,18 +1424,23 @@ def test_table_v1_with_null_nested_namespace(session_catalog: Catalog, arrow_tab # We expect no error here session_catalog.drop_table(identifier) + @pytest.mark.integration -def test_view_exists(spark: SparkSession, session_catalog: Catalog,) -> None: +def test_view_exists( + spark: SparkSession, + session_catalog: Catalog, +) -> None: identifier = "default.some_view" spark.sql( f""" CREATE VIEW {identifier} - AS + AS (SELECT 1 as some_col) """ ).collect() assert session_catalog.view_exists(identifier) - session_catalog.drop_view(identifier) # clean up + session_catalog.drop_view(identifier) # clean up + @pytest.mark.integration def test_overwrite_all_data_with_filter(session_catalog: Catalog) -> None: