| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,6 @@ jobs: | |
| os: | ||
| - ubuntu-latest | ||
| python-version: | ||
| - "3.9" | ||
| - "3.10" | ||
| - "3.11" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| name: PyPI Pre-Release | ||
|
|
||
| on: | ||
| schedule: | ||
| # weekly on Sunday | ||
| - cron: "0 0 * * 0" | ||
|
|
||
| # as needed by clicking through the github actions UI | ||
| workflow_dispatch: | ||
|
|
||
| # we do not want more than one pre-release workflow executing at the same time, ever | ||
| concurrency: | ||
| group: pre-release | ||
| # cancelling in the middle of a release would create incomplete releases | ||
| # so cancel-in-progress is false | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| pre-release: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: install python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: "3.10" | ||
|
|
||
| - name: upgrade pip | ||
| run: python -m pip install --upgrade pip | ||
|
|
||
| - name: install poetry | ||
| run: python -m pip install 'poetry<1.4' poetry-dynamic-versioning | ||
|
|
||
| - name: compute ibis version | ||
| id: get_version | ||
| run: echo "value=$(poetry version)" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: run some poetry sanity checks | ||
| run: poetry check | ||
| if: contains(steps.get_version.outputs.value, '.dev') | ||
|
|
||
| - name: build wheel and source dist | ||
| run: poetry build | ||
| if: contains(steps.get_version.outputs.value, '.dev') | ||
|
|
||
| - name: add test pypi index | ||
| if: contains(steps.get_version.outputs.value, '.dev') | ||
| run: poetry config repositories.test-pypi https://test.pypi.org/legacy/ | ||
|
|
||
| - name: publish pre-release wheel to test pypi index | ||
| if: contains(steps.get_version.outputs.value, '.dev') | ||
| run: poetry publish -r test-pypi | ||
| env: | ||
| POETRY_PYPI_TOKEN_TEST_PYPI: ${{ secrets.TEST_PYPI_TOKEN }} | ||
|
|
||
| - name: publish pre-release wheel to pypi | ||
| if: contains(steps.get_version.outputs.value, '.dev') | ||
| run: poetry publish | ||
| env: | ||
| POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| #!/usr/bin/env python3 | ||
|
|
||
| import collections | ||
| import fnmatch | ||
| import json | ||
| import pathlib | ||
| import subprocess | ||
| import sys | ||
|
|
||
| CURRENT_DIR = pathlib.Path(__file__).parent.absolute() | ||
|
|
||
|
|
||
| def generate_dependency_graph(*args): | ||
| command = ("pydeps", "--show-deps", *args) | ||
| print(f"Running: {' '.join(command)}") # noqa: T201 | ||
| result = subprocess.check_output(command, text=True) | ||
| return json.loads(result) | ||
|
|
||
|
|
||
| def check_dependency_rules(dependency_graph, disallowed_imports): | ||
| prohibited_deps = collections.defaultdict(set) | ||
|
|
||
| for module, module_data in dependency_graph.items(): | ||
| imports = module_data.get("imports", []) | ||
|
|
||
| for pattern, disallow_rules in disallowed_imports.items(): | ||
| if fnmatch.fnmatch(module, pattern): | ||
| for disallow_rule in disallow_rules: | ||
| for imported in imports: | ||
| if fnmatch.fnmatch(imported, disallow_rule): | ||
| prohibited_deps[module].add(imported) | ||
|
|
||
| return prohibited_deps | ||
|
|
||
|
|
||
| disallowed_imports = { | ||
| "ibis.expr.*": ["numpy", "pandas"], | ||
| } | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| dependency_graph = generate_dependency_graph(*sys.argv[1:]) | ||
| prohibited_deps = check_dependency_rules(dependency_graph, disallowed_imports) | ||
|
|
||
| print("\n") # noqa: T201 | ||
| print("Prohibited dependencies:") # noqa: T201 | ||
| print("------------------------") # noqa: T201 | ||
| for module, deps in prohibited_deps.items(): | ||
| print(f"\n{module}:") # noqa: T201 | ||
| for dep in deps: | ||
| print(f" <= {dep}") # noqa: T201 | ||
|
|
||
| if prohibited_deps: | ||
| sys.exit(1) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| -- https://docs.oracle.com/database/121/DRDAS/data_type.htm#DRDAS264 | ||
| -- says that NUMBER(4) -> NUMBER(4) | ||
| -- says that NUMBER(9) -> NUMBER(9) | ||
| -- says that BIGINT -> NUMBER(18); | ||
|
|
||
| DROP TABLE IF EXISTS "diamonds"; | ||
|
|
||
| CREATE TABLE "diamonds" ( | ||
| "carat" BINARY_FLOAT, | ||
| "cut" VARCHAR2(255), | ||
| "color" VARCHAR2(255), | ||
| "clarity" VARCHAR2(255), | ||
| "depth" BINARY_FLOAT, | ||
| "table" BINARY_FLOAT, | ||
| "price" NUMBER(18), | ||
| "x" BINARY_FLOAT, | ||
| "y" BINARY_FLOAT, | ||
| "z" BINARY_FLOAT | ||
| ); | ||
|
|
||
| DROP TABLE IF EXISTS "batting"; | ||
|
|
||
| CREATE TABLE "batting" ( | ||
| "playerID" VARCHAR2(255), | ||
| "yearID" NUMBER(18), | ||
| "stint" NUMBER(18), | ||
| "teamID" VARCHAR2(7), | ||
| "lgID" VARCHAR2(7), | ||
| "G" NUMBER(18), | ||
| "AB" NUMBER(18), | ||
| "R" NUMBER(18), | ||
| "H" NUMBER(18), | ||
| "X2B" NUMBER(18), | ||
| "X3B" NUMBER(18), | ||
| "HR" NUMBER(18), | ||
| "RBI" NUMBER(18), | ||
| "SB" NUMBER(18), | ||
| "CS" NUMBER(18), | ||
| "BB" NUMBER(18), | ||
| "SO" NUMBER(18), | ||
| "IBB" NUMBER(18), | ||
| "HBP" NUMBER(18), | ||
| "SH" NUMBER(18), | ||
| "SF" NUMBER(18), | ||
| "GIDP" NUMBER(18) | ||
| ); | ||
|
|
||
| DROP TABLE IF EXISTS "awards_players"; | ||
|
|
||
| CREATE TABLE "awards_players" ( | ||
| "playerID" VARCHAR2(255), | ||
| "awardID" VARCHAR2(255), | ||
| "yearID" NUMBER(18), | ||
| "lgID" VARCHAR2(7), | ||
| "tie" VARCHAR2(7), | ||
| "notes" VARCHAR2(255) | ||
| ) ; | ||
|
|
||
| DROP TABLE IF EXISTS "functional_alltypes"; | ||
|
|
||
| CREATE TABLE "functional_alltypes" ( | ||
| "id" NUMBER(9), | ||
| -- There is no boolean type in oracle | ||
| -- and no recommendation on how to implement it | ||
| -- I'm going with 0/1 in a NUMBER(1) | ||
| "bool_col" NUMBER(1), | ||
| "tinyint_col" NUMBER(2), | ||
| "smallint_col" NUMBER(4), | ||
| "int_col" NUMBER(9), | ||
| "bigint_col" NUMBER(18), | ||
| "float_col" BINARY_FLOAT, | ||
| "double_col" BINARY_DOUBLE, | ||
| "date_string_col" VARCHAR2(255), | ||
| "string_col" VARCHAR2(255), | ||
| "timestamp_col" TIMESTAMP(3), | ||
| "year" NUMBER(9), | ||
| "month" NUMBER(9) | ||
| ); | ||
|
|
||
| DROP TABLE IF EXISTS "win"; | ||
|
|
||
| CREATE TABLE "win" ("g" VARCHAR2(8), "x" NUMBER(18), "y" NUMBER(18)); | ||
| INSERT INTO "win" VALUES | ||
| ('a', 0, 3), | ||
| ('a', 1, 2), | ||
| ('a', 2, 0), | ||
| ('a', 3, 1), | ||
| ('a', 4, 1); | ||
|
|
||
| COMMIT; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| options (SKIP=1) | ||
| load data | ||
| infile '/opt/oracle/data/awards_players.csv' | ||
| into table "awards_players" | ||
| fields terminated by "," optionally enclosed by '"' | ||
| TRAILING NULLCOLS | ||
| ( "playerID", "awardID", "yearID", "lgID", "tie", "notes" ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| options (SKIP=1) | ||
| load data | ||
| infile '/opt/oracle/data/batting.csv' | ||
| into table "batting" | ||
| fields terminated by "," optionally enclosed by '"' | ||
| TRAILING NULLCOLS | ||
| ( "playerID", "yearID", "stint", "teamID", "lgID", "G", "AB", "R", "H", "X2B", "X3B", "HR", "RBI", "SB", "CS", "BB", "SO", "IBB", "HBP", "SH", "SF", "GIDP" ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| options (SKIP=1) | ||
| load data | ||
| infile '/opt/oracle/data/diamonds.csv' | ||
| into table "diamonds" | ||
| fields terminated by "," optionally enclosed by '"' | ||
| ( "carat", "cut", "color", "clarity", "depth", "table", "price", "x", "y", "z" ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| options (SKIP=1) | ||
| load data | ||
| infile '/opt/oracle/data/functional_alltypes.csv' | ||
| into table "functional_alltypes" | ||
| fields terminated by "," optionally enclosed by '"' | ||
| TRAILING NULLCOLS | ||
| ( "id", | ||
| "bool_col", | ||
| "tinyint_col", | ||
| "smallint_col", | ||
| "int_col", | ||
| "bigint_col", | ||
| "float_col", | ||
| "double_col", | ||
| "date_string_col", | ||
| "string_col", | ||
| "timestamp_col" "to_timestamp(:\"timestamp_col\", 'YYYY-MM-DD HH24:MI:SS.FF')", | ||
| "year", | ||
| "month" ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ coverage: | |
| patch: | ||
| default: | ||
| target: auto | ||
| threshold: 92% | ||
| only_pulls: true | ||
| project: | ||
| default: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| {% if imports %} ) }}-blue?style=flat-square) {% endif %} | ||
|
|
||
| {% if exports %} ) }}-orange?style=flat-square) {% endif %} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| --- | ||
| backend_name: Google BigQuery | ||
| backend_url: https://cloud.google.com/bigquery | ||
| exports: ["PyArrow", "Parquet", "CSV", "Pandas"] | ||
| --- | ||
|
|
||
| # BigQuery | ||
|
|
||
| {% include 'backends/badges.md' %} | ||
|
|
||
| ## Install | ||
|
|
||
| Install `ibis` and dependencies for the BigQuery backend: | ||
|
|
||
| === "pip" | ||
|
|
||
| ```sh | ||
| pip install 'ibis-framework[bigquery]' | ||
| ``` | ||
|
|
||
| {% for mgr in ["conda", "mamba"] %} | ||
| === "{{ mgr }}" | ||
|
|
||
| ```sh | ||
| {{ mgr }} install -c conda-forge ibis-bigquery | ||
| ``` | ||
|
|
||
| {% endfor %} | ||
|
|
||
| ## Connect | ||
|
|
||
| ### `ibis.bigquery.connect` | ||
|
|
||
| ```python | ||
| con = ibis.bigquery.connect( | ||
| project_id="ibis-bq-project", | ||
| dataset_id="testing", | ||
| ) | ||
| ``` | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| !!! info "`ibis.bigquery.connect` is a thin wrapper around [`ibis.backends.bigquery.Backend.do_connect`][ibis.backends.bigquery.Backend.do_connect]." | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### Connection Parameters | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| ::: ibis.backends.bigquery.Backend.do_connect | ||
| options: | ||
| heading_level: 4 | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### `ibis.connect` URL format | ||
|
|
||
| In addition to `ibis.bigquery.connect`, you can also connect to BigQuery by | ||
| passing a properly formatted BigQuery connection URL to `ibis.connect` | ||
|
|
||
| ```python | ||
| con = ibis.connect(f"bigquery://{project_id}/{dataset_id}") | ||
| ``` | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| !!! info "This assumes you have already authenticated via the `gcloud` CLI" | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### Finding your `project_id` and `dataset_id` | ||
|
|
||
| Log in to the [Google Cloud Console](https://console.cloud.google.com/bigquery) | ||
| to see which `project_id`s and `dataset_id`s are available to use. | ||
|
|
||
|  | ||
|
|
||
| ### BigQuery Authentication | ||
|
|
||
| The simplest way to authenticate with the BigQuery backend is to use [Google's `gcloud` CLI tool](https://cloud.google.com/sdk/docs/install-sdk). | ||
|
|
||
| Once you have `gcloud` installed, you can authenticate to BigQuery (and other Google Cloud services) by running | ||
|
|
||
| ```sh | ||
| gcloud auth login | ||
| ``` | ||
|
|
||
| For any authentication problems, or information on other ways of authenticating, | ||
| see the [`gcloud` CLI authorization | ||
| guide](https://cloud.google.com/sdk/docs/authorizing). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| --- | ||
| backend_name: ClickHouse | ||
| backend_url: https://clickhouse.yandex/ | ||
| backend_module: clickhouse | ||
| exports: ["PyArrow", "Parquet", "CSV", "Pandas"] | ||
| --- | ||
|
|
||
| # ClickHouse | ||
|
|
||
| {% include 'backends/badges.md' %} | ||
|
|
||
| ## Install | ||
|
|
||
| Install `ibis` and dependencies for the ClickHouse backend: | ||
|
|
||
| === "pip" | ||
|
|
||
| ```sh | ||
| pip install 'ibis-framework[clickhouse]' | ||
| ``` | ||
|
|
||
| {% for mgr in ["conda", "mamba"] %} | ||
| === "{{ mgr }}" | ||
|
|
||
| ```sh | ||
| {{ mgr }} install -c conda-forge ibis-clickhouse | ||
| ``` | ||
|
|
||
| {% endfor %} | ||
|
|
||
| ## Connect | ||
|
|
||
| ### `ibis.clickhouse.connect` | ||
|
|
||
| ```python | ||
| con = ibis.clickhouse.connect( | ||
| user="username", | ||
| password="password", | ||
| host="hostname", | ||
| ) | ||
| ``` | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| !!! info "`ibis.clickhouse.connect` is a thin wrapper around [`ibis.backends.clickhouse.Backend.do_connect`][ibis.backends.clickhouse.Backend.do_connect]." | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### Connection Parameters | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| ::: ibis.backends.clickhouse.Backend.do_connect | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_examples: false | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### `ibis.connect` URL format | ||
|
|
||
| In addition to `ibis.clickhouse.connect`, you can also connect to ClickHouse by | ||
| passing a properly formatted ClickHouse connection URL to `ibis.connect` | ||
|
|
||
| ```python | ||
| con = ibis.connect(f"clickhouse://{user}:{password}@{host}:{port}?secure={secure}") | ||
| ``` | ||
|
|
||
| ## ClickHouse playground | ||
|
|
||
| ClickHouse provides a free playground with several datasets that you can connect to using `ibis`: | ||
|
|
||
| ```python | ||
| con = ibis.clickhouse.connect( | ||
| host="play.clickhouse.com", | ||
| secure=True, | ||
| user="play", | ||
| password="clickhouse", | ||
| ) | ||
| ``` | ||
|
|
||
| or | ||
|
|
||
| ```python | ||
| con = ibis.connect("clickhouse://play:clickhouse@play.clickhouse.com:443?secure=True") | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| --- | ||
| backend_name: Datafusion | ||
| backend_url: https://arrow.apache.org/datafusion/ | ||
| backend_module: datafusion | ||
| version_added: "2.1" | ||
| exports: ["PyArrow", "Parquet", "Delta Lake", "CSV", "Pandas"] | ||
| imports: ["CSV", "Parquet", "Delta Lake"] | ||
| --- | ||
|
|
||
| # DataFusion | ||
|
|
||
| {% include 'backends/badges.md' %} | ||
|
|
||
| ## Install | ||
|
|
||
| Install `ibis` and dependencies for the Apache Datafusion backend: | ||
|
|
||
| === "pip" | ||
|
|
||
| ```sh | ||
| pip install 'ibis-framework[datafusion]' | ||
| ``` | ||
|
|
||
| {% for mgr in ["conda", "mamba"] %} | ||
| === "{{ mgr }}" | ||
|
|
||
| ```sh | ||
| {{ mgr }} install -c conda-forge ibis-datafusion | ||
| ``` | ||
|
|
||
| {% endfor %} | ||
|
|
||
| ## Connect | ||
|
|
||
| ### `ibis.datafusion.connect` | ||
|
|
||
| ```python | ||
| con = ibis.datafusion.connect() | ||
| ``` | ||
|
|
||
| ```python | ||
| con = ibis.datafusion.connect( | ||
| config={"table1": "path/to/file.parquet", "table2": "path/to/file.csv"} | ||
| ) | ||
| ``` | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| !!! info "`ibis.datafusion.connect` is a thin wrapper around [`ibis.backends.datafusion.Backend.do_connect`][ibis.backends.datafusion.Backend.do_connect]." | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### Connection Parameters | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| ::: ibis.backends.datafusion.Backend.do_connect | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_examples: false | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ## File Support | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| ::: ibis.backends.datafusion.Backend.read_csv | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_returns: false | ||
| ::: ibis.backends.datafusion.Backend.read_parquet | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_returns: false | ||
| ::: ibis.backends.datafusion.Backend.read_delta | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_returns: false | ||
| <!-- prettier-ignore-end --> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| --- | ||
| backend_name: Druid | ||
| backend_url: https://druid.apache.org/ | ||
| backend_module: druid | ||
| exports: ["PyArrow", "Parquet", "CSV", "Pandas"] | ||
| --- | ||
|
|
||
| # Druid | ||
|
|
||
| {% include 'backends/badges.md' %} | ||
|
|
||
| !!! experimental "Introduced in v5.0" | ||
|
|
||
| The Druid backend is experimental and is subject to backwards incompatible changes. | ||
|
|
||
| ## Install | ||
|
|
||
| Install `ibis` and dependencies for the Druid backend: | ||
|
|
||
| === "pip" | ||
|
|
||
| ```sh | ||
| pip install 'ibis-framework[druid]' | ||
| ``` | ||
|
|
||
| {% for mgr in ["conda", "mamba"] %} | ||
| === "{{ mgr }}" | ||
|
|
||
| ```sh | ||
| {{ mgr }} install -c conda-forge ibis-druid | ||
| ``` | ||
|
|
||
| {% endfor %} | ||
|
|
||
| ## Connect | ||
|
|
||
| ### `ibis.druid.connect` | ||
|
|
||
| ```python | ||
| con = ibis.druid.connect( | ||
| host="hostname", | ||
| port=8082, | ||
| database="druid/v2/sql", | ||
| ) | ||
| ``` | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| !!! info "`ibis.druid.connect` is a thin wrapper around [`ibis.backends.druid.Backend.do_connect`][ibis.backends.druid.Backend.do_connect]." | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### Connection Parameters | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| ::: ibis.backends.druid.Backend.do_connect | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_examples: false | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### `ibis.connect` URL format | ||
|
|
||
| In addition to `ibis.druid.connect`, you can also connect to Druid by | ||
| passing a properly formatted Druid connection URL to `ibis.connect` | ||
|
|
||
| ```python | ||
| con = ibis.connect("druid://localhost:8082/druid/v2/sql") | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,155 @@ | ||
| --- | ||
| backend_name: DuckDB | ||
| backend_url: https://duckdb.org/ | ||
| backend_module: duckdb | ||
| exports: ["PyArrow", "Parquet", "Delta Lake", "CSV", "Pandas"] | ||
| imports: | ||
| [ | ||
| "CSV", | ||
| "Parquet", | ||
| "Delta Lake", | ||
| "JSON", | ||
| "PyArrow", | ||
| "Pandas", | ||
| "SQLite", | ||
| "Postgres", | ||
| ] | ||
| --- | ||
|
|
||
| # DuckDB | ||
|
|
||
| {% include 'backends/badges.md' %} | ||
|
|
||
| ??? danger "`duckdb` >= 0.5.0 requires `duckdb-engine` >= 0.6.2" | ||
|
|
||
| If you encounter problems when using `duckdb` >= **0.5.0** you may need to | ||
| upgrade `duckdb-engine` to at least version **0.6.2**. | ||
|
|
||
| See [this issue](https://github.com/ibis-project/ibis/issues/4503) for | ||
| more details. | ||
|
|
||
| ## Install | ||
|
|
||
| Install `ibis` and dependencies for the DuckDB backend: | ||
|
|
||
| === "pip" | ||
|
|
||
| ```sh | ||
| pip install 'ibis-framework[duckdb]' | ||
| ``` | ||
|
|
||
| {% for mgr in ["conda", "mamba"] %} | ||
| === "{{ mgr }}" | ||
|
|
||
| ```sh | ||
| {{ mgr }} install -c conda-forge ibis-duckdb | ||
| ``` | ||
|
|
||
| {% endfor %} | ||
|
|
||
| ## Connect | ||
|
|
||
| ### `ibis.duckdb.connect` | ||
|
|
||
| ```python | ||
| con = ibis.duckdb.connect() # (1) | ||
| ``` | ||
|
|
||
| 1. Use an ephemeral, in-memory database | ||
|
|
||
| ```python | ||
| con = ibis.duckdb.connect("mydb.duckdb") # (1) | ||
| ``` | ||
|
|
||
| 1. Connect to, or create, a local DuckDB file | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| !!! info "`ibis.duckdb.connect` is a thin wrapper around [`ibis.backends.duckdb.Backend.do_connect`][ibis.backends.duckdb.Backend.do_connect]." | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### Connection Parameters | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| ::: ibis.backends.duckdb.Backend.do_connect | ||
| options: | ||
| heading_level: 4 | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### `ibis.connect` URL format | ||
|
|
||
| In addition to `ibis.duckdb.connect`, you can also connect to DuckDB by | ||
| passing a properly formatted DuckDB connection URL to `ibis.connect` | ||
|
|
||
| ```python | ||
| con = ibis.connect("duckdb:///path/to/local/file") | ||
| ``` | ||
|
|
||
| ```python | ||
| con = ibis.connect("duckdb://") # (1) | ||
| ``` | ||
|
|
||
| 1. ephemeral, in-memory database | ||
|
|
||
| ## MotherDuck | ||
|
|
||
| The DuckDB backend supports [MotherDuck](https://motherduck.com). If you have an | ||
| account, you can connect to MotherDuck by passing in the string `md:` or | ||
| `motherduck:`. `ibis` will trigger the authentication prompt in-browser. | ||
|
|
||
| ```python | ||
| >>> import ibis | ||
|
|
||
| >>> con = ibis.duckdb.connect("md:") | ||
| ``` | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| !!! info "Authentication to MotherDuck will trigger on the first call that requires retrieving information (in this case `list_tables`)" | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ```python | ||
| >>> con.list_tables() | ||
| Attempting to automatically open the SSO authorization page in your default browser. | ||
| 1. Please open this link to login into your account: https://auth.motherduck.com/activate | ||
| 2. Enter the following code: ZSRQ-GJQS | ||
|
|
||
|
|
||
| Token successfully retrieved âś… | ||
| You can store it as an environment variable to avoid having to log in again: | ||
| $ export motherduck_token='****************' | ||
|
|
||
| ['penguins'] | ||
| ``` | ||
|
|
||
| ## File Support | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| ::: ibis.backends.duckdb.Backend.read_csv | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_returns: false | ||
| ::: ibis.backends.duckdb.Backend.read_parquet | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_returns: false | ||
| ::: ibis.backends.duckdb.Backend.read_delta | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_returns: false | ||
| ::: ibis.backends.duckdb.Backend.read_json | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_returns: false | ||
| ::: ibis.backends.duckdb.Backend.read_in_memory | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_returns: false | ||
| ::: ibis.backends.duckdb.Backend.read_sqlite | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_examples: false | ||
| show_docstring_returns: false | ||
| ::: ibis.backends.duckdb.Backend.read_postgres | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_returns: false | ||
| <!-- prettier-ignore-end --> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,45 +1,9 @@ | ||
| # Backends | ||
|
|
||
| A backend is where execution of Ibis table expressions occur after compiling into some intermediate representation. A backend is often a database and the intermediate representation often SQL, but several types of backends exist. | ||
|
|
||
| See the [configuration guide](../how_to/configuration.md#default-backend) | ||
| to inspect or reconfigure the backend used by default. View the [operation support matrix](_support_matrix.md) to see which operations | ||
| are supported by each backend. | ||
|
|
||
| Each backend has its own configuration options documented here. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| --- | ||
| backend_name: MS SQL Server | ||
| backend_url: https://www.microsoft.com/en-us/evalcenter/evaluate-sql-server-2022 | ||
| backend_module: mssql | ||
| backend_param_style: connection parameters | ||
| version_added: "4.0" | ||
| exports: ["PyArrow", "Parquet", "CSV", "Pandas"] | ||
| --- | ||
|
|
||
| # MSSQL | ||
|
|
||
| {% include 'backends/badges.md' %} | ||
|
|
||
| ## Install | ||
|
|
||
| Install `ibis` and dependencies for the MSSQL backend: | ||
|
|
||
| === "pip" | ||
|
|
||
| ```sh | ||
| pip install 'ibis-framework[mssql]' | ||
| ``` | ||
|
|
||
| {% for mgr in ["conda", "mamba"] %} | ||
| === "{{ mgr }}" | ||
|
|
||
| ```sh | ||
| {{ mgr }} install -c conda-forge ibis-mssql | ||
| ``` | ||
|
|
||
| {% endfor %} | ||
|
|
||
| ## Connect | ||
|
|
||
| ### `ibis.mssql.connect` | ||
|
|
||
| ```python | ||
| con = ibis.mssql.connect( | ||
| user="username", | ||
| password="password", | ||
| host="hostname", | ||
| ) | ||
| ``` | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| !!! info "`ibis.mssql.connect` is a thin wrapper around [`ibis.backends.mssql.Backend.do_connect`][ibis.backends.mssql.Backend.do_connect]." | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### Connection Parameters | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| ::: ibis.backends.mssql.Backend.do_connect | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_examples: false | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### `ibis.connect` URL format | ||
|
|
||
| In addition to `ibis.mssql.connect`, you can also connect to MSSQL by | ||
| passing a properly formatted MSSQL connection URL to `ibis.connect` | ||
|
|
||
| ```python | ||
| con = ibis.connect(f"mssql://{user}:{password}@{host}:{port}") | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| --- | ||
| backend_name: MySQL | ||
| backend_url: https://www.mysql.com/ | ||
| backend_module: mysql | ||
| backend_param_style: a SQLAlchemy-style URI | ||
| exports: ["PyArrow", "Parquet", "CSV", "Pandas"] | ||
| --- | ||
|
|
||
| # MySQL | ||
|
|
||
| {% include 'backends/badges.md' %} | ||
|
|
||
| ## Install | ||
|
|
||
| Install `ibis` and dependencies for the MySQL backend: | ||
|
|
||
| === "pip" | ||
|
|
||
| ```sh | ||
| pip install 'ibis-framework[mysql]' | ||
| ``` | ||
|
|
||
| {% for mgr in ["conda", "mamba"] %} | ||
| === "{{ mgr }}" | ||
|
|
||
| ```sh | ||
| {{ mgr }} install -c conda-forge ibis-mysql | ||
| ``` | ||
|
|
||
| {% endfor %} | ||
|
|
||
| ## Connect | ||
|
|
||
| ### `ibis.mysql.connect` | ||
|
|
||
| ```python | ||
| con = ibis.mysql.connect( | ||
| user="username", | ||
| password="password", | ||
| host="hostname", | ||
| port=3306, | ||
| database="database", | ||
| ) | ||
| ``` | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| !!! info "`ibis.mysql.connect` is a thin wrapper around [`ibis.backends.mysql.Backend.do_connect`][ibis.backends.mysql.Backend.do_connect]." | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### Connection Parameters | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| ::: ibis.backends.mysql.Backend.do_connect | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_examples: false | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### `ibis.connect` URL format | ||
|
|
||
| In addition to `ibis.mysql.connect`, you can also connect to MySQL by | ||
| passing a properly formatted MySQL connection URL to `ibis.connect` | ||
|
|
||
| ```python | ||
| con = ibis.connect(f"mysql://{user}:{password}@{host}:{port}/{database}") | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| --- | ||
| backend_name: Oracle | ||
| backend_url: https://docs.oracle.com/en/database/oracle/oracle-database/index.html | ||
| backend_module: oracle | ||
| backend_param_style: a SQLAlchemy connection string | ||
| backend_connection_example: ibis.connect("oracle://user:pass@host:port/service_name") | ||
| is_experimental: true | ||
| version_added: "6.0" | ||
| exports: ["PyArrow", "Parquet", "CSV", "Pandas"] | ||
| --- | ||
|
|
||
| # Oracle | ||
|
|
||
| {% include 'backends/badges.md' %} | ||
|
|
||
| !!! experimental "Introduced in v6.0" | ||
|
|
||
| The Oracle backend is experimental and is subject to backwards incompatible changes. | ||
|
|
||
| ## Install | ||
|
|
||
| Install `ibis` and dependencies for the Oracle backend: | ||
|
|
||
| === "pip" | ||
|
|
||
| ```sh | ||
| pip install 'ibis-framework[oracle]' | ||
| ``` | ||
|
|
||
| {% for mgr in ["conda", "mamba"] %} | ||
| === "{{ mgr }}" | ||
|
|
||
| ```sh | ||
| {{ mgr }} install -c conda-forge ibis-oracle | ||
| ``` | ||
|
|
||
| {% endfor %} | ||
|
|
||
| ## Connect | ||
|
|
||
| ### `ibis.oracle.connect` | ||
|
|
||
| ```python | ||
| con = ibis.oracle.connect( | ||
| user="username", | ||
| password="password", | ||
| host="hostname", | ||
| port=1521, | ||
| database="database", | ||
| ) | ||
| ``` | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| !!! info "`ibis.oracle.connect` is a thin wrapper around [`ibis.backends.oracle.Backend.do_connect`][ibis.backends.oracle.Backend.do_connect]." | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### Connection Parameters | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| ::: ibis.backends.oracle.Backend.do_connect | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_examples: false | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### `ibis.connect` URL format | ||
|
|
||
| In addition to `ibis.oracle.connect`, you can also connect to Oracle by | ||
| passing a properly formatted Oracle connection URL to `ibis.connect` | ||
|
|
||
| ```python | ||
| con = ibis.connect(f"oracle://{user}:{password}@{host}:{port}/{database}") | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| --- | ||
| backend_name: Polars | ||
| backend_url: https://pola-rs.github.io/polars-book/user-guide/index.html | ||
| backend_module: polars | ||
| is_experimental: true | ||
| version_added: "4.0" | ||
| exports: ["PyArrow", "Parquet", "Delta Lake", "CSV", "Pandas"] | ||
| imports: ["CSV", "Parquet", "Delta Lake", "Pandas"] | ||
| --- | ||
|
|
||
| # Polars | ||
|
|
||
| {% include 'backends/badges.md' %} | ||
|
|
||
| !!! experimental "Introduced in v4.0" | ||
|
|
||
| The Polars backend is experimental and is subject to backwards incompatible changes. | ||
|
|
||
| ## Install | ||
|
|
||
| Install `ibis` and dependencies for the Polars backend: | ||
|
|
||
| === "pip" | ||
|
|
||
| ```sh | ||
| pip install 'ibis-framework[polars]' | ||
| ``` | ||
|
|
||
| {% for mgr in ["conda", "mamba"] %} | ||
| === "{{ mgr }}" | ||
|
|
||
| ```sh | ||
| {{ mgr }} install -c conda-forge ibis-polars | ||
| ``` | ||
|
|
||
| {% endfor %} | ||
|
|
||
| ## Connect | ||
|
|
||
| ### `ibis.polars.connect` | ||
|
|
||
| ```python | ||
| con = ibis.polars.connect() | ||
| ``` | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| !!! info "`ibis.polars.connect` is a thin wrapper around [`ibis.backends.polars.Backend.do_connect`][ibis.backends.polars.Backend.do_connect]." | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### Connection Parameters | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| ::: ibis.backends.polars.Backend.do_connect | ||
| options: | ||
| heading_level: 4 | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ## File Support | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| ::: ibis.backends.polars.Backend.read_csv | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_returns: false | ||
| ::: ibis.backends.polars.Backend.read_parquet | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_returns: false | ||
| ::: ibis.backends.polars.Backend.read_delta | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_returns: false | ||
| <!-- prettier-ignore-end --> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| --- | ||
| backend_name: PostgreSQL | ||
| backend_url: https://www.postgresql.org/ | ||
| backend_module: postgres | ||
| backend_param_style: a SQLAlchemy-style URI | ||
| exports: ["PyArrow", "Parquet", "CSV", "Pandas"] | ||
| --- | ||
|
|
||
| # PostgreSQL | ||
|
|
||
| {% include 'backends/badges.md' %} | ||
|
|
||
| ## Install | ||
|
|
||
| Install `ibis` and dependencies for the Postgres backend: | ||
|
|
||
| === "pip" | ||
|
|
||
| ```sh | ||
| pip install 'ibis-framework[postgres]' | ||
| ``` | ||
|
|
||
| {% for mgr in ["conda", "mamba"] %} | ||
| === "{{ mgr }}" | ||
|
|
||
| ```sh | ||
| {{ mgr }} install -c conda-forge ibis-postgres | ||
| ``` | ||
|
|
||
| {% endfor %} | ||
|
|
||
| ## Connect | ||
|
|
||
| ### `ibis.postgres.connect` | ||
|
|
||
| ```python | ||
| con = ibis.postgres.connect( | ||
| user="username", | ||
| password="password", | ||
| host="hostname", | ||
| port=5432, | ||
| database="database", | ||
| ) | ||
| ``` | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| !!! info "`ibis.postgres.connect` is a thin wrapper around [`ibis.backends.postgres.Backend.do_connect`][ibis.backends.postgres.Backend.do_connect]." | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### Connection Parameters | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| ::: ibis.backends.postgres.Backend.do_connect | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_examples: false | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### `ibis.connect` URL format | ||
|
|
||
| In addition to `ibis.postgres.connect`, you can also connect to Postgres by | ||
| passing a properly formatted Postgres connection URL to `ibis.connect` | ||
|
|
||
| ```python | ||
| con = ibis.connect(f"postgres://{user}:{password}@{host}:{port}/{database}") | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| --- | ||
| backend_name: PySpark | ||
| backend_url: https://spark.apache.org/docs/latest/api/python/ | ||
| backend_module: pyspark | ||
| backend_param_style: PySpark things | ||
| exports: ["PyArrow", "Parquet", "CSV", "Pandas"] | ||
| imports: ["CSV", "Parquet"] | ||
| --- | ||
|
|
||
| # PySpark | ||
|
|
||
| {% include 'backends/badges.md' %} | ||
|
|
||
| ## Install | ||
|
|
||
| Install `ibis` and dependencies for the PySpark backend: | ||
|
|
||
| === "pip" | ||
|
|
||
| ```sh | ||
| pip install 'ibis-framework[pyspark]' | ||
| ``` | ||
|
|
||
| {% for mgr in ["conda", "mamba"] %} | ||
| === "{{ mgr }}" | ||
|
|
||
| ```sh | ||
| {{ mgr }} install -c conda-forge ibis-pyspark | ||
| ``` | ||
|
|
||
| {% endfor %} | ||
|
|
||
| ## Connect | ||
|
|
||
| ### `ibis.pyspark.connect` | ||
|
|
||
| ```python | ||
| con = ibis.pyspark.connect(session=session) | ||
| ``` | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| !!! info "`ibis.pyspark.connect` is a thin wrapper around [`ibis.backends.pyspark.Backend.do_connect`][ibis.backends.pyspark.Backend.do_connect]." | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| !!! info "The `pyspark` backend does not create `SparkSession` objects, you must create a `SparkSession` and pass that to `ibis.pyspark.connect`." | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### Connection Parameters | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| ::: ibis.backends.pyspark.Backend.do_connect | ||
| options: | ||
| heading_level: 4 | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ## File Support | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| ::: ibis.backends.pyspark.Backend.read_csv | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_returns: false | ||
| ::: ibis.backends.pyspark.Backend.read_parquet | ||
| options: | ||
| heading_level: 4 | ||
| show_docstring_returns: false | ||
| <!-- prettier-ignore-end --> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| --- | ||
| backend_name: Snowflake | ||
| backend_url: https://snowflake.com/ | ||
| exports: ["PyArrow", "Parquet", "CSV", "Pandas"] | ||
| --- | ||
|
|
||
| # Snowflake | ||
|
|
||
| {% include 'backends/badges.md' %} | ||
|
|
||
| !!! experimental "Introduced in v4.0" | ||
|
|
||
| The Snowflake backend is experimental and is subject to backwards incompatible changes. | ||
|
|
||
| ## Install | ||
|
|
||
| Install `ibis` and dependencies for the Snowflake backend: | ||
|
|
||
| === "pip" | ||
|
|
||
| ```sh | ||
| pip install 'ibis-framework[snowflake]' | ||
| ``` | ||
|
|
||
| {% for mgr in ["conda", "mamba"] %} | ||
| === "{{ mgr }}" | ||
|
|
||
| ```sh | ||
| {{ mgr }} install -c conda-forge ibis-snowflake | ||
| ``` | ||
|
|
||
| {% endfor %} | ||
|
|
||
| ## Connect | ||
|
|
||
| ### `ibis.snowflake.connect` | ||
|
|
||
| ```python | ||
| con = ibis.snowflake.connect( | ||
| user="user", | ||
| password="password", | ||
| account="safpqpq-sq55555", | ||
| database="IBIS_TESTING/IBIS_TESTING", | ||
| ) | ||
| ``` | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| !!! info "`ibis.snowflake.connect` is a thin wrapper around [`ibis.backends.snowflake.Backend.do_connect`][ibis.backends.snowflake.Backend.do_connect]." | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### Connection Parameters | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| ::: ibis.backends.snowflake.Backend.do_connect | ||
| options: | ||
| heading_level: 4 | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### `ibis.connect` URL format | ||
|
|
||
| In addition to `ibis.snowflake.connect`, you can also connect to Snowflake by | ||
| passing a properly formatted Snowflake connection URL to `ibis.connect` | ||
|
|
||
| ```python | ||
| con = ibis.connect(f"snowflake://{user}:{password}@{account}/{database}") | ||
| ``` | ||
|
|
||
| ### Authenticating with SSO | ||
|
|
||
| Ibis supports connecting to SSO-enabled Snowflake warehouses using the `authenticator` parameter. | ||
|
|
||
| You can use it in the explicit-parameters-style or in the URL-style connection | ||
| APIs. All values of `authenticator` are supported. | ||
|
|
||
| #### Explicit | ||
|
|
||
| ```python | ||
| con = ibis.snowflake.connect( | ||
| user="user", | ||
| account="safpqpq-sq55555", | ||
| database="my_database/my_schema", | ||
| warehouse="my_warehouse", | ||
| authenticator="externalbrowser", | ||
| ) | ||
| ``` | ||
|
|
||
| #### URL | ||
|
|
||
| ```python | ||
| con = ibis.connect( | ||
| f"snowflake://{user}@{account}/{database}?warehouse={warehouse}", | ||
| authenticator="externalbrowser", | ||
| ) | ||
| ``` | ||
|
|
||
| ### Looking up your Snowflake organization ID and user ID | ||
|
|
||
| A [Snowflake account | ||
| identifier](https://docs.snowflake.com/en/user-guide/admin-account-identifier#format-1-preferred-account-name-in-your-organization) | ||
| consists of an organization ID and a user ID, separated by a hyphen. | ||
|
|
||
| !!! info "This user ID is not the same as the username you log in with." | ||
|
|
||
| To find your organization ID and user ID, log in to the Snowflake web app, then | ||
| click on the text just to the right of the Snowflake logo (in the | ||
| lower-left-hand corner of the screen). | ||
|
|
||
| The bold text at the top of the little pop-up window is your organization ID. | ||
| The bold blue text with a checkmark next to it is your user ID. | ||
|
|
||
|  | ||
|
|
||
| ### Choosing a value for `database` | ||
|
|
||
| Snowflake refers to a collection of tables as a schema, and a collection of schema as a database. | ||
|
|
||
| You must choose a database and a schema to connect to. You can refer to the | ||
| available databases and schema in the "Data" sidebar item in the Snowflake web | ||
| app. | ||
|
|
||
|  |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| --- | ||
| backend_name: SQLite | ||
| backend_url: https://www.sqlite.org/ | ||
| backend_module: sqlite | ||
| imports: ["CSV", "Parquet", "JSON", "PyArrow", "Pandas", "SQLite", "Postgres"] | ||
| --- | ||
|
|
||
| # SQLite | ||
|
|
||
| {% include 'backends/badges.md' %} | ||
|
|
||
| ## Install | ||
|
|
||
| Install `ibis` and dependencies for the SQLite backend: | ||
|
|
||
| === "pip" | ||
|
|
||
| ```sh | ||
| pip install 'ibis-framework[sqlite]' | ||
| ``` | ||
|
|
||
| {% for mgr in ["conda", "mamba"] %} | ||
| === "{{ mgr }}" | ||
|
|
||
| ```sh | ||
| {{ mgr }} install -c conda-forge ibis-sqlite | ||
| ``` | ||
|
|
||
| {% endfor %} | ||
|
|
||
| ## Connect | ||
|
|
||
| ### `ibis.sqlite.connect` | ||
|
|
||
| ```python | ||
| con = ibis.sqlite.connect() # (1) | ||
| ``` | ||
|
|
||
| 1. Use an ephemeral, in-memory database | ||
|
|
||
| ```python | ||
| con = ibis.sqlite.connect("mydb.sqlite") # (1) | ||
| ``` | ||
|
|
||
| 1. Connect to, or create, a local SQLite file | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| !!! info "`ibis.sqlite.connect` is a thin wrapper around [`ibis.backends.sqlite.Backend.do_connect`][ibis.backends.sqlite.Backend.do_connect]." | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### Connection Parameters | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| ::: ibis.backends.sqlite.Backend.do_connect | ||
| options: | ||
| heading_level: 4 | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### `ibis.connect` URL format | ||
|
|
||
| In addition to `ibis.sqlite.connect`, you can also connect to SQLite by | ||
| passing a properly formatted SQLite connection URL to `ibis.connect` | ||
|
|
||
| ```python | ||
| con = ibis.connect("sqlite:///path/to/local/file") | ||
| ``` | ||
|
|
||
| ```python | ||
| con = ibis.connect("sqlite://") # (1) | ||
| ``` | ||
|
|
||
| 1. ephemeral, in-memory database |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ | |
|
|
||
| ## Install | ||
|
|
||
| Install `ibis` and dependencies for the {{ backend_name }} backend: | ||
|
|
||
| === "pip" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| --- | ||
| backend_name: Trino | ||
| backend_url: https://trino.io | ||
| backend_module: trino | ||
| exports: ["PyArrow", "Parquet", "CSV", "Pandas"] | ||
| --- | ||
|
|
||
| # Trino | ||
|
|
||
| {% include 'backends/badges.md' %} | ||
|
|
||
| !!! experimental "Introduced in v4.0" | ||
|
|
||
| The Trino backend is experimental and is subject to backwards incompatible changes. | ||
|
|
||
| ## Install | ||
|
|
||
| Install `ibis` and dependencies for the Trino backend: | ||
|
|
||
| === "pip" | ||
|
|
||
| ```sh | ||
| pip install 'ibis-framework[trino]' | ||
| ``` | ||
|
|
||
| {% for mgr in ["conda", "mamba"] %} | ||
| === "{{ mgr }}" | ||
|
|
||
| ```sh | ||
| {{ mgr }} install -c conda-forge ibis-trino | ||
| ``` | ||
|
|
||
| {% endfor %} | ||
|
|
||
| ## Connect | ||
|
|
||
| ### `ibis.trino.connect` | ||
|
|
||
| ```python | ||
| con = ibis.trino.connect( | ||
| user="user", | ||
| password="password", | ||
| port=8080, | ||
| database="database", | ||
| schema="default", | ||
| ) | ||
| ``` | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| !!! info "`ibis.trino.connect` is a thin wrapper around [`ibis.backends.trino.Backend.do_connect`][ibis.backends.trino.Backend.do_connect]." | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| ### Connection Parameters | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| ::: ibis.backends.trino.Backend.do_connect | ||
| options: | ||
| heading_level: 4 | ||
| <!-- prettier-ignore-end --> |