Error trying to read a csv file from FileLoader and Pandas

I’m trying to make a few operations with a uploaded csv file from FileLoader. But I’m getting “TypeError: argument of type ‘method’ is not iterable”.

I tried StringIO, but was not able to install it on my Python.

@anvil.server.callable
def csv_to_df(my_string2):
#csvStringIO = pd.StringIO(my_string2)
df = pd.DataFrame([x.split(‘;’) for x in my_string2.split(‘\n’)])
df1 = pd.read_csv(df, sep=‘;’, header=None)
df2 = pd.to_dict(df1)
return df2
next(df2)
for line in df2:
keysList = list(line.keys())
f2 = app_tables.modelos.search(order_by=“-key_column”, rows=1)
txt = f2.read()
for key in keysList:
k = “{{”+key+“}}”
content = txt.replace(k, line[key])
title = line[‘NOME_COMPLETO’]
anvil.server.call(‘add_post’, title, content)
v += 1

My form code:

def file_loader_2_change(self, file, **event_args):
“”“This method is called when a new file is loaded into this FileLoader”“”
my_string2 = []
arquivo = file.get_bytes()
my_string2=arquivo.decode(‘utf-8’)
anvil.server.call(‘csv_to_df’, my_string2)

Need help. Please.