Closed trgiangdo closed 1 year ago
Description
Can not write to a SQLDataNode and SQLTableDataNode.
How to reproduce
Configuration: Get the configuration from the SQL data node on sqlite engine example.
A code fragment from the SQL Data node read/write example
import taipy as tp from taipy import Config import pandas as pd def write_query_builder(data: pd.DataFrame): insert_data = list( data[["date", "nb_sales"]].itertuples(index=False, name=None)) return [ "DELETE FROM sales", ("INSERT INTO sales VALUES (?, ?)", insert_data) ] sales_history_cfg = Config.configure_sql_data_node( id="sales_history", db_name="taipy", db_engine="sqlite", read_query="SELECT * from sales", write_query_builder=write_query_builder, sqlite_folder_path="database", sqlite_file_extension=".sqlite3", ) sale_history_datanode = tp.create_global_data_node(sales_history_cfg) data = pandas.DataFrame( [ {"date": "01/08/2019", "product_id": 1, "nb_sales": 450}, {"date": "01/08/2019", "product_id": 3, "nb_sales": 320}, {"date": "01/08/2019", "product_id": 4, "nb_sales": 350}, ] ) data_node.write(data)
Expected behavior
Description
Can not write to a SQLDataNode and SQLTableDataNode.
How to reproduce
Configuration: Get the configuration from the SQL data node on sqlite engine example.
A code fragment from the SQL Data node read/write example
Expected behavior