Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

Commit

Permalink
fix: can not write to sql data node
Browse files Browse the repository at this point in the history
  • Loading branch information
trgiangdo committed Nov 1, 2023
1 parent 388cafa commit d83b52d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/taipy/core/data/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from datetime import datetime, timedelta
from typing import Dict, List, Optional, Set

from sqlalchemy import text

from taipy.config.common.scope import Scope

from .._version._version_manager_factory import _VersionManagerFactory
Expand Down Expand Up @@ -133,6 +135,8 @@ def _do_write(self, data, engine, connection) -> None:
queries = [queries]
for query in queries:
if isinstance(query, str):
connection.execute(query)
connection.execute(text(query))
else:
connection.execute(*query)
statement = query[0]
parameters = query[1]
connection.execute(text(statement), parameters)
3 changes: 1 addition & 2 deletions src/taipy/core/data/sql_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,8 @@ def _do_write(self, data, engine, connection) -> None:

def _create_table(self, engine) -> Table:
return Table(
self.table,
self.properties[self.__TABLE_KEY],
MetaData(),
autoload=True,
autoload_with=engine,
)

Expand Down

0 comments on commit d83b52d

Please sign in to comment.