From 6d917d3728a1d7242e77f814a36014dbd5fd7fb8 Mon Sep 17 00:00:00 2001 From: Olivier Grisel Date: Tue, 7 Feb 2023 14:32:10 +0100 Subject: [PATCH] docs(backends): document default backend configuration --- docs/user_guide/configuration.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/user_guide/configuration.md b/docs/user_guide/configuration.md index 7c832f3ffcb2..5666602bada8 100644 --- a/docs/user_guide/configuration.md +++ b/docs/user_guide/configuration.md @@ -57,3 +57,25 @@ def cowsay(msg): ibis.options.verbose_log = cowsay ``` + +## Default backend + +`ibis.options.default_backend` controls which backend is used by table +expressions returned by top-level functions such as `ibis.memtable`, +`ibis.read_csv` or `ibis.read_parquet`. + +By default, it points to an instance of DuckDB backend. Assuming the [backend +dependencies have been installed](../install.md), it can be updated by passing +the name of the backend to `ibis.set_backend` as follows: + +```python +import ibis + +expr = ibis.memtable({"column": [0, 1, 2, 3, 4]}) +ibis.get_backend(expr) +# + +ibis.set_backend("sqlite") +ibis.get_backend(expr) +# +```