I am successful getting an array of unique values from a pandas column on the server side. I want to return this series to my form code in order to populate a drop-down list. I’m getting an error on the return. I’ve tried converting retval.tolist(), no love.
@anvil.server.callable
def get_column(col):
file=app_tables.files.get(filetype='MARSYS')['file']
df=pd.read_csv(io.BytesIO(file.get_bytes()), names=["industry", "top_level", "category", "sub_category", "vendor", "product", "model", "version", "int_serial","int_eth", "int_usb", "modbus", "tech_vendor", "tech_product", "tech_version", "website", "marsys_key", "tech_key"])
ret_array = pd.Series(df[col].unique)
for n in ret_array:
print("cat: " + str(n))
I can see the issue, the server-side is unable to serialize the List… I’ve confirmed that I’ve effectively converted the pandas series to a list.
Unfortunately all I can find in the documentation is the valid return types, which I’ve confirmed I am returning. Still looking…