Skip to content

Commit

Permalink
docs(flink): override default install instructions
Browse files Browse the repository at this point in the history
Co-authored-by: Phillip Cloud <417981+cpcloud@users.noreply.github.com>
  • Loading branch information
2 people authored and gforsyth committed Dec 19, 2023
1 parent 33c855a commit 4fc8e75
Showing 1 changed file with 34 additions and 10 deletions.
44 changes: 34 additions & 10 deletions docs/_tabsets/install.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ You can install Ibis and a supported backend with `pip`, `conda`, `mamba`, or `p
```{python}
#| echo: false
#| output: asis
from textwrap import dedent
backends = [
{"name": "BigQuery", "module": "bigquery"},
Expand All @@ -13,6 +14,7 @@ backends = [
{"name": "DataFusion", "module": "datafusion"},
{"name": "Druid", "module": "druid"},
{"name": "DuckDB", "module": "duckdb"},
{"name": "Flink", "module": "flink"},
{"name": "Impala", "module": "impala"},
{"name": "MSSQL", "module": "mssql"},
{"name": "MySQL", "module": "mysql"},
Expand All @@ -34,30 +36,52 @@ installers = [
]
for installer in installers:
name = installer["name"]
installer_name = installer["name"]
cmd = installer["cmd"]
line = installer["line"]
print(f"## `{name}`")
print(f"## `{installer_name}`")
print("::: {.panel-tabset}")
print()
for backend in backends:
name = backend["name"]
backend_name = backend["name"]
mod = backend["module"]
extra = backend.get("extra", mod)
print(f"## {name}")
print(f"## {backend_name}")
print()
print(line.format(extra=extra))
print()
print(f"```bash\n{cmd.format(extra=extra)}\n```")
if backend_name == "Flink":
if installer_name == "pip":
print("Install alongside the `apache-flink` package:")
print()
print(f"```bash\npip install ibis-framework apache-flink\n```")
else:
print(
dedent(
"""\
::: {.callout-important}
## PyFlink is not available on conda-forge; please
use `pip` to install the PyFlink backend instead.
:::"""
)
)
continue
else:
extra = backend.get("extra", mod)
print(line.format(extra=extra))
print()
print(f"```bash\n{cmd.format(extra=extra)}\n```")
print()
print(f"Connect using [`ibis.{mod}.connect`](./backends/{name.lower()}.qmd#ibis.{mod}.connect).")
print(f"Connect using [`ibis.{mod}.connect`](./backends/{backend_name.lower()}.qmd#ibis.{mod}.connect).")
print()
if name == "pip":
if installer_name == "pip":
print("{{< include /_callouts/pypi_warning.qmd >}}")
print()
Expand Down

0 comments on commit 4fc8e75

Please sign in to comment.