Skip to content

Commit 3d94082

Browse files
committed
docs(backend-info): prevent app from trying install duckdb extensions
1 parent 2599c9b commit 3d94082

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

docs/backends/app/backend_info_app.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import datetime
2+
import tempfile
23
from pathlib import Path
34
from typing import List, Optional
45

56
import pandas as pd
7+
import requests
68
import sqlglot
79
import streamlit as st
810

911
import ibis
1012
from ibis import _
11-
from ibis.backends import duckdb
1213

1314
ONE_HOUR_IN_SECONDS = datetime.timedelta(hours=1).total_seconds()
1415

@@ -22,18 +23,22 @@
2223

2324
@st.experimental_memo(ttl=ONE_HOUR_IN_SECONDS)
2425
def support_matrix_df():
25-
backend: duckdb.Backend = ibis.connect('duckdb://')
26-
support_matrix = (
27-
backend.read_csv(
28-
'https://ibis-project.org/docs/dev/backends/raw_support_matrix.csv'
29-
)
30-
.relabel({'FullOperation': 'full_operation'})
31-
.mutate(
32-
short_operation=_.full_operation.split(".")[4],
33-
operation_category=_.full_operation.split(".")[3],
34-
)
26+
resp = requests.get(
27+
"https://ibis-project.org/docs/dev/backends/raw_support_matrix.csv"
3528
)
36-
return support_matrix.execute()
29+
resp.raise_for_status()
30+
31+
with tempfile.NamedTemporaryFile() as f:
32+
f.write(resp.content)
33+
return (
34+
ibis.read_csv(f.name)
35+
.relabel({'FullOperation': 'full_operation'})
36+
.mutate(
37+
short_operation=_.full_operation.split(".")[-1],
38+
operation_category=_.full_operation.split(".")[-2],
39+
)
40+
.execute()
41+
)
3742

3843

3944
@st.experimental_memo(ttl=ONE_HOUR_IN_SECONDS)

0 commit comments

Comments
 (0)