Counting things

@anvil.server.callable
def get_furniture_type_count(typename):
  a = app_tables.furniture.search(furniture_type=app_tables.furniture_types.get(furniture_type_name=typename))
  df = pd.Dataframe(a)
  count = df.groupby('furniture_type').count
  return count

ok, so i’m getting closer but not quite. The new error is:
tables.TableError: Column ‘furniture_type’ can only be searched with a liveObjectArray (not a Row from ‘furniture_types’ table) in table ‘furniture’

which is very curious, as the previous error was:

tables.TableError: Column ‘furniture_type’ can only be searched with a Row from ‘furniture_types’ table (not a string) in table ‘furniture’