File tree 1 file changed +17
-12
lines changed
1 file changed +17
-12
lines changed Original file line number Diff line number Diff line change 1
1
import datetime
2
+ import tempfile
2
3
from pathlib import Path
3
4
from typing import List , Optional
4
5
5
6
import pandas as pd
7
+ import requests
6
8
import sqlglot
7
9
import streamlit as st
8
10
9
11
import ibis
10
12
from ibis import _
11
- from ibis .backends import duckdb
12
13
13
14
ONE_HOUR_IN_SECONDS = datetime .timedelta (hours = 1 ).total_seconds ()
14
15
22
23
23
24
@st .experimental_memo (ttl = ONE_HOUR_IN_SECONDS )
24
25
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"
35
28
)
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
+ )
37
42
38
43
39
44
@st .experimental_memo (ttl = ONE_HOUR_IN_SECONDS )
You can’t perform that action at this time.
0 commit comments