Skip to content

Commit

Permalink
chore(backends): mark from_connection experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
deepyaman committed Jul 22, 2024
1 parent 442c9f6 commit c8267e6
Show file tree
Hide file tree
Showing 17 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions ibis/backends/bigquery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ def do_connect(

self.partition_column = partition_column

@util.experimental
@classmethod
def from_connection(
cls,
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/clickhouse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def do_connect(
**kwargs,
)

@util.experimental
@classmethod
def from_connection(cls, con: cc.driver.Client) -> Backend:
"""Create an Ibis client from an existing ClickHouse Connect Client instance.
Expand Down
2 changes: 2 additions & 0 deletions ibis/backends/datafusion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import ibis.expr.operations as ops
import ibis.expr.schema as sch
import ibis.expr.types as ir
from ibis import util
from ibis.backends import CanCreateCatalog, CanCreateDatabase, CanCreateSchema, NoUrl
from ibis.backends.sql import SQLBackend
from ibis.backends.sql.compilers import DataFusionCompiler
Expand Down Expand Up @@ -114,6 +115,7 @@ def do_connect(
for name, path in config.items():
self.register(path, table_name=name)

@util.experimental
@classmethod
def from_connection(cls, con: SessionContext) -> Backend:
"""Create a DataFusion `Backend` from an existing `SessionContext` instance.
Expand Down
2 changes: 2 additions & 0 deletions ibis/backends/druid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import ibis.expr.datatypes as dt
import ibis.expr.schema as sch
from ibis import util
from ibis.backends.sql import SQLBackend
from ibis.backends.sql.compilers import DruidCompiler
from ibis.backends.sql.compilers.base import STAR
Expand Down Expand Up @@ -81,6 +82,7 @@ def do_connect(self, **kwargs: Any) -> None:
header = kwargs.pop("header", True)
self.con = pydruid.db.connect(**kwargs, header=header)

@util.experimental
@classmethod
def from_connection(cls, con: pydruid.db.api.Connection) -> Backend:
"""Create an Ibis client from an existing connection to a Druid database.
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/duckdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ def do_connect(

self._post_connect(extensions)

@util.experimental
@classmethod
def from_connection(
cls,
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/exasol/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def do_connect(
)
self._post_connect(timezone)

@util.experimental
@classmethod
def from_connection(
cls, con: pyexasol.ExaConnection, timezone: str | None = None
Expand Down
2 changes: 2 additions & 0 deletions ibis/backends/flink/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import ibis.expr.operations as ops
import ibis.expr.schema as sch
import ibis.expr.types as ir
from ibis import util
from ibis.backends import CanCreateDatabase, NoUrl
from ibis.backends.flink.ddl import (
CreateDatabase,
Expand Down Expand Up @@ -71,6 +72,7 @@ def do_connect(self, table_env: TableEnvironment) -> None:
"""
self._table_env = table_env

@util.experimental
@classmethod
def from_connection(cls, table_env: TableEnvironment) -> Backend:
"""Create a Flink `Backend` from an existing table environment.
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/impala/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ def do_connect(
self.con = con
self._post_connect()

@util.experimental
@classmethod
def from_connection(cls, con: hs2.HiveServer2Connection) -> Backend:
"""Create an Impala `Backend` from an existing HS2 connection.
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/mssql/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def do_connect(

self._post_connect()

@util.experimental
@classmethod
def from_connection(cls, con: pyodbc.Connection) -> Backend:
"""Create an Ibis client from an existing connection to a MSSQL database.
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/mysql/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def do_connect(

self._post_connect()

@util.experimental
@classmethod
def from_connection(cls, con: pymysql.Connection) -> Backend:
"""Create an Ibis client from an existing connection to a MySQL database.
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/oracle/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def do_connect(

self._post_connect()

@util.experimental
@classmethod
def from_connection(cls, con: oracledb.Connection) -> Backend:
"""Create an Ibis client from an existing connection to an Oracle database.
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/postgres/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ def do_connect(

self._post_connect()

@util.experimental
@classmethod
def from_connection(cls, con: psycopg2.extensions.connection) -> Backend:
"""Create an Ibis client from an existing connection to a PostgreSQL database.
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/pyspark/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def do_connect(
for key, value in kwargs.items():
self._session.conf.set(key, value)

@util.experimental
@classmethod
def from_connection(
cls, session: SparkSession, mode: ConnectionMode = "batch", **kwargs
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/snowflake/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ def from_snowpark(
)
return backend

@util.experimental
@classmethod
def from_connection(
cls,
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/sql/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ def truncate_table(
with self._safe_raw_sql(f"TRUNCATE TABLE {ident}"):
pass

@util.experimental
@classmethod
def from_connection(cls, con: Any, **kwargs: Any) -> BaseBackend:
"""Create an Ibis client from an existing connection.
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/sqlite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def do_connect(

self._post_connect(type_map)

@util.experimental
@classmethod
def from_connection(
cls,
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/trino/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ def do_connect(
**kwargs,
)

@util.experimental
@classmethod
def from_connection(cls, con: trino.dbapi.Connection) -> Backend:
"""Create an Ibis client from an existing connection to a Trino database.
Expand Down

0 comments on commit c8267e6

Please sign in to comment.