Spaces:
Running
Running
ChenyuRabbitLove
commited on
Commit
•
4566577
1
Parent(s):
62b3eea
add query bq testing function
Browse files
app.py
CHANGED
@@ -133,12 +133,7 @@ with gr.Blocks(theme=seafoam, css=css) as demo:
|
|
133 |
o = gr.Textbox()
|
134 |
b = gr.Button(elem_id="test2")
|
135 |
df = gr.DataFrame()
|
136 |
-
|
137 |
-
def print_text(t):
|
138 |
-
return t
|
139 |
|
140 |
-
b.click(print_text, i, o,)
|
141 |
-
|
142 |
def run_query(user_id):
|
143 |
QUERY = (
|
144 |
'SELECT created_at, points, user_role, joined, developer FROM `datastore_backup.UserData`',
|
@@ -152,6 +147,9 @@ with gr.Blocks(theme=seafoam, css=css) as demo:
|
|
152 |
# Convert numeric columns to standard numpy types
|
153 |
df = df.astype({"points": np.int64})
|
154 |
return df
|
|
|
|
|
|
|
155 |
|
156 |
if __name__ == "__main__":
|
157 |
demo.launch()
|
|
|
133 |
o = gr.Textbox()
|
134 |
b = gr.Button(elem_id="test2")
|
135 |
df = gr.DataFrame()
|
|
|
|
|
|
|
136 |
|
|
|
|
|
137 |
def run_query(user_id):
|
138 |
QUERY = (
|
139 |
'SELECT created_at, points, user_role, joined, developer FROM `datastore_backup.UserData`',
|
|
|
147 |
# Convert numeric columns to standard numpy types
|
148 |
df = df.astype({"points": np.int64})
|
149 |
return df
|
150 |
+
|
151 |
+
b.click(run_query, i, df,)
|
152 |
+
|
153 |
|
154 |
if __name__ == "__main__":
|
155 |
demo.launch()
|