File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1734,6 +1734,8 @@ def set_backend(backend: str | BaseBackend) -> None:
1734
1734
def get_backend (expr : Expr | None = None ) -> BaseBackend :
1735
1735
"""Get the current Ibis backend to use for a given expression.
1736
1736
1737
+ Parameters
1738
+ ----------
1737
1739
expr
1738
1740
An expression to get the backend from. If not passed, the default
1739
1741
backend is returned.
@@ -1743,6 +1745,25 @@ def get_backend(expr: Expr | None = None) -> BaseBackend:
1743
1745
BaseBackend
1744
1746
The Ibis backend.
1745
1747
1748
+ Examples
1749
+ --------
1750
+ >>> import ibis
1751
+
1752
+ Get the default backend.
1753
+
1754
+ >>> ibis.get_backend() # doctest: +ELLIPSIS
1755
+ <ibis.backends.duckdb.Backend object at 0x...>
1756
+
1757
+ Get the backend for a specific expression.
1758
+
1759
+ >>> polars_con = ibis.polars.connect()
1760
+ >>> t = polars_con.create_table("t", ibis.memtable({"a": [1, 2, 3]}))
1761
+ >>> ibis.get_backend(t) # doctest: +ELLIPSIS
1762
+ <ibis.backends.polars.Backend object at 0x...>
1763
+
1764
+ See Also
1765
+ --------
1766
+ [`get_backend()`](./expression-tables.qmd#ibis.expr.types.relations.Table.get_backend)
1746
1767
"""
1747
1768
if expr is None :
1748
1769
from ibis .config import _default_backend
You can’t perform that action at this time.
0 commit comments