Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
shiv-io committed Jan 22, 2025
1 parent c028042 commit 4672e15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 1 addition & 3 deletions pyiceberg/catalog/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions tests/integration/test_writes/test_writes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4672e15

Please sign in to comment.