Fast way to query a Table

Ok, so I found a “bug”, basically it is obvious that I should NOT run .search for each iteration, that’s time consuming. Instead this runs much faster:

  columns = app_tables.survey.list_columns()
  table = app_tables.survey.search()
  survey_data = {column['name']: [] for column in columns}
  for row in table:
    for column in columns:
      column_name = column['name']
      survey_data[column_name].append(row[column_name])
  
  return survey_data
2 Likes