Hi, thank you for your quick reply. Yes, I’ve tried both (i.e. passing some args as well as removing the **filter
altogether but nothing seems to have worked.
The uplink connection appears to be okay. I see my connection in the logs. I tried some print statements in the server function, and there’s nothing in the logs (which makes sense since it seems that the actual call of the function is failing).
I ran the following script on May 30, and it worked fine. When I try to run that now, I get the same error.
import pandas as pd
import anvil.server
import anvil.users
anvil.server.connect('...')
anvil.users.login_with_email("...", "...")
sec_exec_names = (
pd.read_csv("SECExecNames.csv")
.dropna(subset=["cik"])
.assign(
cik_int=lambda df: df["cik"].astype(int),
name_list=lambda df: df["Exec Names"].str.split(" "),
first_name=lambda df: df['name_list'].str[1],
last_name=lambda df: df['name_list'].str[0],
other_names=lambda df: df['name_list'].str[2:].str.join(" "),
)
)
for row in sec_exec_names.itertuples():
response = anvil.server.call(
"api_executive_create",
data={
'cik': row.cik_int,
'first_name': row.first_name,
'last_name': row.last_name,
'other_names': row.other_names,
'data_source': 'SECExecNames.csv from Josef Svenda',
}
)
print('Response:', dict(response))
Maybe the entire traceback will help? This includes a keyword arg in the function call.
Traceback (most recent call last):
File “H:\My Drive\projects\jan_svenda\ceo_cfo_database\scripts.venv\Lib\site-packages\anvil\server.py”, line 421, in call
return _do_call(args, kwargs, fn_name=fn_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “H:\My Drive\projects\jan_svenda\ceo_cfo_database\scripts.venv\Lib\site-packages\anvil\server.py”, line 411, in _do_call
return _threaded_server.do_call(args, kwargs, fn_name=fn_name, live_object=live_object)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “H:\My Drive\projects\jan_svenda\ceo_cfo_database\scripts.venv\Lib\site-packages\anvil_threaded_server.py”, line 505, in do_call
raise error_from_server
anvil._server.AnvilWrappedError: anvil.server.call() expects atleast 1 argument
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “H:\My Drive\projects\jan_svenda\ceo_cfo_database\scripts\get_form3_data.py”, line 16, in
main()
File “H:\My Drive\projects\jan_svenda\ceo_cfo_database\scripts\get_form3_data.py”, line 9, in main
execs = anvil.server.call(‘api_executive_read’, cik=1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “H:\My Drive\projects\jan_svenda\ceo_cfo_database\scripts.venv\Lib\site-packages\anvil\server.py”, line 424, in call
raise _server._deserialise_exception(e.error_obj)
anvil._server.AnvilWrappedError: anvil.server.call() expects atleast 1 argument