agentharbor commited on
Commit
f800a8a
·
verified ·
1 Parent(s): eec2452

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -30,7 +30,7 @@ def run(DATASET_ID):
30
  lookml = None
31
  lookml_explore = None
32
  dataset = model_response(f'''You are an expert in BQ public datasets. Generate a dataset schema related to {DATASET_ID}. You need to come up with atleast 5 tables with each table
33
- containing atleast 10 columns along with their descriptions.''')
34
  dataset_description = model_response(f'''Generate a succinct 3-4 line description of the dataset: {dataset}.''')
35
  yield dataset_description, None, None, None, None, None, None
36
 
@@ -77,6 +77,9 @@ containing atleast 10 columns along with their descriptions.''')
77
  queries = generate_dataset_queries(dataset, generated_glossary, schema_relations)
78
  yield dataset_description, py, schema_relations, generated_glossary, queries, None, None
79
  lookml = generate_lookml(dataset, generated_glossary, schema_relations)
 
 
 
80
  yield dataset_description, py, schema_relations, generated_glossary, queries, lookml, lookml_explore
81
  return dataset_description, py, schema_relations, generated_glossary, queries, lookml, lookml_explore
82
 
@@ -84,11 +87,13 @@ containing atleast 10 columns along with their descriptions.''')
84
  def wrapper(dataset_id):
85
  for outputs in run(dataset_id):
86
  yield (
 
87
  outputs[1],
88
  outputs[2], # Schema Relationships
89
  outputs[3], # Generated Glossary
90
  outputs[4], # Queries
91
- outputs[5] # LookML Model
 
92
  )
93
 
94
  import gradio as gr
@@ -101,7 +106,8 @@ iface = gr.Interface(
101
  gr.Markdown(label="Schema Relationships"),
102
  gr.Markdown(label="Generated Glossary"),
103
  gr.Textbox(label="Queries"),
104
- gr.Markdown(label="LookML Model")
 
105
  ],
106
  live=False,
107
  theme = gr.themes.Ocean(),
 
30
  lookml = None
31
  lookml_explore = None
32
  dataset = model_response(f'''You are an expert in BQ public datasets. Generate a dataset schema related to {DATASET_ID}. You need to come up with atleast 5 tables with each table
33
+ containing atleast 10 columns along with their descriptions.Ensure that these tables have columns that talk about data quality issues.''')
34
  dataset_description = model_response(f'''Generate a succinct 3-4 line description of the dataset: {dataset}.''')
35
  yield dataset_description, None, None, None, None, None, None
36
 
 
77
  queries = generate_dataset_queries(dataset, generated_glossary, schema_relations)
78
  yield dataset_description, py, schema_relations, generated_glossary, queries, None, None
79
  lookml = generate_lookml(dataset, generated_glossary, schema_relations)
80
+ yield dataset_description, py, schema_relations, generated_glossary, queries, lookml
81
+ lookml_explore = model_response(f'''Given the dataset: {dataset}, schema relationships: {py} and graph:{schema_relations}, generate a data preparation pipeline that
82
+ fixes the possible data quality issues across the tables in the dataset.''')
83
  yield dataset_description, py, schema_relations, generated_glossary, queries, lookml, lookml_explore
84
  return dataset_description, py, schema_relations, generated_glossary, queries, lookml, lookml_explore
85
 
 
87
  def wrapper(dataset_id):
88
  for outputs in run(dataset_id):
89
  yield (
90
+ outputs[0],
91
  outputs[1],
92
  outputs[2], # Schema Relationships
93
  outputs[3], # Generated Glossary
94
  outputs[4], # Queries
95
+ outputs[5], # LookML Model
96
+ outputs[6]
97
  )
98
 
99
  import gradio as gr
 
106
  gr.Markdown(label="Schema Relationships"),
107
  gr.Markdown(label="Generated Glossary"),
108
  gr.Textbox(label="Queries"),
109
+ gr.Markdown(label="LookML Model").
110
+ gr.Markdown(label="Data preparation pipeline")
111
  ],
112
  live=False,
113
  theme = gr.themes.Ocean(),