LeonceNsh commited on
Commit
fe85696
Β·
verified Β·
1 Parent(s): 4226065

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py CHANGED
@@ -39,10 +39,20 @@ schema = [
39
  {"column_name": "countrycode", "column_type": "VARCHAR"}
40
  ]
41
 
 
 
 
 
 
 
42
  @lru_cache(maxsize=1)
43
  def get_schema():
44
  return schema
45
 
 
 
 
 
46
  COLUMN_TYPES = {col['column_name']: col['column_type'] for col in get_schema()}
47
 
48
  # =========================
@@ -125,6 +135,9 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
125
  with gr.Accordion("πŸ“„ Dataset Schema", open=False):
126
  gr.JSON(get_schema(), label="Schema")
127
 
 
 
 
128
  with gr.Column(scale=2):
129
  gr.Markdown("### πŸ“Š Query Results")
130
  results_out = gr.DataFrame(label="", interactive=False, row_count=10)
 
39
  {"column_name": "countrycode", "column_type": "VARCHAR"}
40
  ]
41
 
42
+ columns = [ "department_ind_agency", "cgac","sub_tier","fpds_code", "office","aac_code",
43
+ "posteddate", "type","basetype","popstreetaddress","popcity","popstate",
44
+ "popzip", "popcountry", "active","awardnumber","awarddate","award",
45
+ "awardee","state","city", "zipcode", "countrycode"
46
+ ]
47
+
48
  @lru_cache(maxsize=1)
49
  def get_schema():
50
  return schema
51
 
52
+ @lru_cache(maxsize=1)
53
+ def get_columns():
54
+ return columns
55
+
56
  COLUMN_TYPES = {col['column_name']: col['column_type'] for col in get_schema()}
57
 
58
  # =========================
 
135
  with gr.Accordion("πŸ“„ Dataset Schema", open=False):
136
  gr.JSON(get_schema(), label="Schema")
137
 
138
+ with gr.Accordion("πŸ“„ Dataset Columns", open=False):
139
+ gr.JSON(get_columns(), label="Columns")
140
+
141
  with gr.Column(scale=2):
142
  gr.Markdown("### πŸ“Š Query Results")
143
  results_out = gr.DataFrame(label="", interactive=False, row_count=10)