ChenyuRabbitLove commited on
Commit
c3741e3
1 Parent(s): 4566577

add query bq testing function

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -140,11 +140,15 @@ with gr.Blocks(theme=seafoam, css=css) as demo:
140
  f'WHERE user_id = {user_id}'
141
  )
142
  query_job = client.query(QUERY)
 
143
  query_result = query_job.result()
 
144
  df = query_result.to_dataframe()
 
145
  # Select a subset of columns
146
  df = df[["created_at", "points", "user_role", "joined", "developer"]]
147
  # Convert numeric columns to standard numpy types
 
148
  df = df.astype({"points": np.int64})
149
  return df
150
 
 
140
  f'WHERE user_id = {user_id}'
141
  )
142
  query_job = client.query(QUERY)
143
+ print('Running query')
144
  query_result = query_job.result()
145
+ print('Query complete')
146
  df = query_result.to_dataframe()
147
+ print('Convert to dataframe')
148
  # Select a subset of columns
149
  df = df[["created_at", "points", "user_role", "joined", "developer"]]
150
  # Convert numeric columns to standard numpy types
151
+ print('Convert to numpy')
152
  df = df.astype({"points": np.int64})
153
  return df
154