From cc6870c020e4b8b33ab86305924d7675fd0c1c4d Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 26 Oct 2023 04:44:38 -0400 Subject: [PATCH] feat(datafusion): support dropping schemas --- ibis/backends/datafusion/__init__.py | 5 ++--- ibis/backends/tests/test_client.py | 5 ----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/ibis/backends/datafusion/__init__.py b/ibis/backends/datafusion/__init__.py index 54d84c1f7405..67c36b7b64b3 100644 --- a/ibis/backends/datafusion/__init__.py +++ b/ibis/backends/datafusion/__init__.py @@ -231,9 +231,8 @@ def create_schema( def drop_schema( self, name: str, database: str | None = None, force: bool = False ) -> None: - raise com.UnsupportedOperationError( - "DataFusion does not support dropping schemas" - ) + schema_name = sg.table(name, db=database) + self.raw_sql(sg.exp.Drop(kind="SCHEMA", this=schema_name, exists=force)) def list_tables( self, diff --git a/ibis/backends/tests/test_client.py b/ibis/backends/tests/test_client.py index 9aff21f0fb5d..fa38a598cabb 100644 --- a/ibis/backends/tests/test_client.py +++ b/ibis/backends/tests/test_client.py @@ -1326,11 +1326,6 @@ def test_create_database(con_create_database): con_create_database.drop_database(database) -@pytest.mark.notyet( - ["datafusion"], - raises=com.UnsupportedOperationError, - reason="datafusion doesn't support dropping schemas", -) def test_create_schema(con_create_schema): schema = gen_name("test_create_schema") con_create_schema.create_schema(schema)