Toggle dark mode

Hi,

📢 Taipy v2.1 is about to be launched! 🚀 ETA:

Day(s)

:

Hour(s)

:

Minute(s)

:

Second(s)

M

Reply To: Taipy 2.0 & MySQL

Welcome to Taipy Forums Taipy Core Taipy 2.0 & MySQL Reply To: Taipy 2.0 & MySQL

#237238
Florian JactaFlorian Jacta
Keymaster

Hi,

Here is an example of code you can use to understand how it works:

_______________
from taipy.core import Config

def read_data(path):
return pd.read_csv(path)

def write_data(data, path):
pd.DataFrame(data).to_csv(path)

generic_data_node_cfg = Config.configure_generic_data_node(id=”my_data_node”,
read_fct=read_data,
write_fct=write_data,
read_fct_params=[“res.csv”],
write_fct_params=[“res.csv”])
_______________

You also have to be aware of your types. The function of your task will receive the type given by ‘read_data’ and the type returned by the function of your task should be in the correct type for ‘write_data’ to work.

This line of code below should work with “foo” and “bar” optional and function(), your normal Python function used by your task.

write_data(function(read_data(“foo”)), “bar”)

If you need more explanation, I can help you or organize a call when you want.

Best regards,
Florian
florian.jacta@taipy.io