Skip to content

Commit

Permalink
chore: remove unused api methods
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Dec 30, 2024
1 parent fbb90f2 commit 235977a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 31 deletions.
13 changes: 0 additions & 13 deletions ibis/backends/athena/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,19 +389,6 @@ def from_connection(
def _post_connect(self, *, memtable_volume: str) -> None:
pass

Check warning on line 390 in ibis/backends/athena/__init__.py

View check run for this annotation

Codecov / codecov/patch

ibis/backends/athena/__init__.py#L389-L390

Added lines #L389 - L390 were not covered by tests

def _in_memory_table_exists(self, name: str) -> bool:
catalog_name = self.current_catalog
schema_name = self.current_database
with self.con.cursor() as cur:
result = cur.list_table_metadata(
catalog_name=catalog_name,
schema_name=schema_name,
expression=name,
max_results=1,
)
assert 0 <= len(result) <= 1, f"{len(result) = }"
return bool(result)

def _register_in_memory_table(self, op: ops.InMemoryTable) -> None:
import pyarrow.parquet as pq

Check warning on line 393 in ibis/backends/athena/__init__.py

View check run for this annotation

Codecov / codecov/patch

ibis/backends/athena/__init__.py#L392-L393

Added lines #L392 - L393 were not covered by tests

Expand Down
19 changes: 1 addition & 18 deletions ibis/backends/databricks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from ibis import util
from ibis.backends import CanCreateDatabase, UrlFromPath
from ibis.backends.sql import SQLBackend
from ibis.backends.sql.compilers.base import STAR, AlterTable, C, RenameTable
from ibis.backends.sql.compilers.base import STAR, AlterTable, RenameTable

Check warning on line 29 in ibis/backends/databricks/__init__.py

View check run for this annotation

Codecov / codecov/patch

ibis/backends/databricks/__init__.py#L29

Added line #L29 was not covered by tests

if TYPE_CHECKING:
from collections.abc import Mapping
Expand Down Expand Up @@ -387,23 +387,6 @@ def _post_connect(self, *, memtable_volume: str) -> None:
def _memtable_volume_path(self) -> str:
return f"/Volumes/{self._memtable_catalog}/{self._memtable_database}/{self._memtable_volume}"

def _in_memory_table_exists(self, name: str) -> bool:
sql = (
sg.select(self.compiler.f.count(STAR))
.from_(
sg.table("views", db="information_schema", catalog=self.current_catalog)
)
.where(
C.table_name.eq(sge.convert(name)),
C.table_schema.eq(self.compiler.f.current_database()),
)
)
with self._safe_raw_sql(sql) as cur:
[(out,)] = cur.fetchall()

assert 0 <= out <= 1, str(out)
return out == 1

def _register_in_memory_table(self, op: ops.InMemoryTable) -> None:
import pyarrow.parquet as pq

Expand Down

0 comments on commit 235977a

Please sign in to comment.