pgzmnk commited on
Commit
84d8075
1 Parent(s): 35153c2
Files changed (2) hide show
  1. app.py +3 -5
  2. utils/duckdb_queries.py +3 -10
app.py CHANGED
@@ -2,19 +2,17 @@ import datetime
2
  import json
3
  import logging
4
  import os
 
5
 
6
- import duckdb
7
  import ee
8
  import gradio as gr
 
9
  import pandas as pd
10
  import plotly.graph_objects as go
11
  import yaml
12
- import numpy as np
13
- from itertools import repeat
14
 
15
-
16
- from utils.gradio import get_window_url_params
17
  from utils import duckdb_queries as dq
 
18
 
19
  # Logging
20
  logging.basicConfig(format="%(levelname)s:%(message)s", level=logging.INFO)
 
2
  import json
3
  import logging
4
  import os
5
+ from itertools import repeat
6
 
 
7
  import ee
8
  import gradio as gr
9
+ import numpy as np
10
  import pandas as pd
11
  import plotly.graph_objects as go
12
  import yaml
 
 
13
 
 
 
14
  from utils import duckdb_queries as dq
15
+ from utils.gradio import get_window_url_params
16
 
17
  # Logging
18
  logging.basicConfig(format="%(levelname)s:%(message)s", level=logging.INFO)
utils/duckdb_queries.py CHANGED
@@ -1,12 +1,8 @@
1
  import os
2
- import duckdb
3
-
4
- import logging
5
 
 
6
 
7
  # Configure DuckDB connection
8
- logging.info("Configuring DuckDB connection...")
9
-
10
  if not os.getenv("motherduck_token"):
11
  raise Exception(
12
  "No motherduck token found. Please set the `motherduck_token` environment variable."
@@ -14,11 +10,8 @@ if not os.getenv("motherduck_token"):
14
  else:
15
  con = duckdb.connect("md:climatebase")
16
  con.sql("USE climatebase;")
17
-
18
-
19
- # load extensions
20
- con.sql("""INSTALL spatial; LOAD spatial;""")
21
- logging.info("Configured DuckDB connection.")
22
 
23
 
24
  # to-do: pass con through decorator
 
1
  import os
 
 
 
2
 
3
+ import duckdb
4
 
5
  # Configure DuckDB connection
 
 
6
  if not os.getenv("motherduck_token"):
7
  raise Exception(
8
  "No motherduck token found. Please set the `motherduck_token` environment variable."
 
10
  else:
11
  con = duckdb.connect("md:climatebase")
12
  con.sql("USE climatebase;")
13
+ # load extensions
14
+ con.sql("""INSTALL spatial; LOAD spatial;""")
 
 
 
15
 
16
 
17
  # to-do: pass con through decorator