Skip to content

Commit

Permalink
move ibis stuff to helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-rp committed Dec 6, 2024
1 parent f22b1dc commit 7af8870
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dlt/common/destination/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
try:
from dlt.common.libs.pandas import DataFrame
from dlt.common.libs.pyarrow import Table as ArrowTable
from dlt.common.libs.ibis import BaseBackend as IbisBackend
from dlt.helpers.ibis import BaseBackend as IbisBackend
except MissingDependencyException:
DataFrame = Any
ArrowTable = Any
Expand Down
6 changes: 3 additions & 3 deletions dlt/destinations/dataset/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

if TYPE_CHECKING:
try:
from dlt.common.libs.ibis import BaseBackend as IbisBackend
from dlt.helpers.ibis import BaseBackend as IbisBackend
except MissingDependencyException:
IbisBackend = Any
else:
Expand All @@ -47,7 +47,7 @@ def __init__(

def ibis(self) -> IbisBackend:
"""return a connected ibis backend"""
from dlt.common.libs.ibis import create_ibis_backend
from dlt.helpers.ibis import create_ibis_backend

self._ensure_client_and_schema()
return create_ibis_backend(
Expand Down Expand Up @@ -117,7 +117,7 @@ def table(self, table_name: str) -> SupportsReadableRelation:
# we can create an ibis powered relation if ibis is available
if table_name in self.schema.tables and self._dataset_type in ("auto", "ibis"):
try:
from dlt.common.libs.ibis import create_unbound_ibis_table
from dlt.helpers.ibis import create_unbound_ibis_table
from dlt.destinations.dataset.ibis_relation import ReadableIbisRelation

unbound_table = create_unbound_ibis_table(self.sql_client, self.schema, table_name)
Expand Down
4 changes: 2 additions & 2 deletions dlt/destinations/dataset/ibis_relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
ReadableDBAPIDataset = Any

try:
from dlt.common.libs.ibis import Expr
from dlt.helpers.ibis import Expr
except MissingDependencyException:
Expr = Any

Expand Down Expand Up @@ -63,7 +63,7 @@ def __init__(
def query(self) -> Any:
"""build the query"""

from dlt.common.libs.ibis import ibis, sqlglot
from dlt.helpers.ibis import ibis, sqlglot

destination_type = self._dataset._destination.destination_type
target_dialect = DIALECT_MAP[destination_type]
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/load/test_read_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ def sql_from_expr(expr: Any) -> str:
def test_ibis_dataset_access(populated_pipeline: Pipeline) -> None:
# NOTE: we could generalize this with a context for certain deps

from dlt.common.libs.ibis import SUPPORTED_DESTINATIONS
from dlt.helpers.ibis import SUPPORTED_DESTINATIONS

# check correct error if not supported
if populated_pipeline.destination.destination_type not in SUPPORTED_DESTINATIONS:
Expand Down

0 comments on commit 7af8870

Please sign in to comment.