Uplink-Data fault / Dataframe/Dicts

Hi,
I’m using the Anvil Uplink to transmit data from my local DB to Anvil. What kind of datatypes are common for this?

In my jupyter notebook I’m very familiar with dataframes from pandas. This does not work out, right? Then I tried to transmit dicts, out of the dataframe. This does not work out as well? Here is my small example:

Local Jupyter Notebook:

Anvil Server Code:

Anvil Output:

Do you’ve got an idea?

Thanks a lot!

Looks like your dict has keys that are not strings. Does it work when you make them strings?

Thats the message but I don’t know how to solve! :slight_smile:

Here are the types of the keys…

You should be able to pass standard python objects around no problem (e.g., dicts, lists, numbers, strings, etc), as long as they are serializable afaik.

Also, I’m a bit confused because above you have a server function called “test_func_dict” that is making a server call (anvil.server.call('get_data')), but you can call functions directly when in the server or uplinked (no need to use anvil.server.call unless you are on the client side). That may not be the issue but just wanted to clarify that.

Yeah, it works with the option records:

dicts = df.to_dict(‘records’)

(Yes, get_data is an uplink function so I thought, I have to call it with the anvil.server function to call (on server and client side…)

Thank you very much!

1 Like