December 13, 2022 at 11:43 am #237234
I’m trying to explore some data we have in a MariaDB database, and after I setup my environment I tried to install taipy[mysql] as recommended in the manual.
At this step, I get a warning :
WARNING: taipy 2.0.0 does not provide the extra ‘mysql’
My pipeline fails with an error :
taipy.core.exceptions.exceptions.UnknownDatabaseEngine: Unknown engine: mysql
My Node Config is defined :
products_cfg = Config.configure_sql_data_node(
Is there a way to use MySQL/MariaDB directly or do I have to pull data in some intermediate format like CSV or JSON and adapt my pipe ?
thank you for your help,
— JMMDecember 13, 2022 at 2:23 pm #237235
There is an error in the documentation. ‘mysql’ is not supported in this current version but will be in the next big release in January. We are also going to test along the way with MariaDB. The error in the documentation will be fixed soon.
If you want to make it work now, I would propose you configure your own generic Data Node. By providing a writing and reading function, you can use MariaDB within Taipy. (https://docs.taipy.io/en/latest/manuals/core/config/data-node-config/#generic)
FlorianDecember 13, 2022 at 4:01 pm #237236
I’ll try this suggestion and let you know how it went,
thanks for the help
— JMMDecember 13, 2022 at 4:50 pm #237237
I’m a little at a loss here, I read the user manual, and I just don’t get what read_fct and write_fct expect for parameters, and what format they are supposed to return (for write_fct I don’t even know what to return).
I wrote read_fct to send back a list of tuples I pulled from the DB, the data I want to look at, and with write_fct I don’t know what to do.
Could you please give a little example to explain how it’s supposed to work ?
thank you for your help
— JMMDecember 13, 2022 at 5:22 pm #237238
Here is an example of code you can use to understand how it works:
from taipy.core import Config
def write_data(data, path):
generic_data_node_cfg = Config.configure_generic_data_node(id=”my_data_node”,
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.
If you need more explanation, I can help you or organize a call when you want.
firstname.lastname@example.orgDecember 14, 2022 at 3:26 pm #237385
I think I got the knack of it, and wrote an pipeline pulling data from my db and using csv files as buffers.
As a result, I do not use any SQL related stuff in Taipy.
My pipeline unfortunately fails with an error :
pyodbc.Error: (‘01000’, “ [unixODBC][Driver Manager]Can’t open lib ‘ODBC Driver 17 for SQL Server’ : file not found (0) (SQLDriverConnect)”)
I’m using a Linux PC and no ODBC drivers, thus maybe the ‘ODBC driver missing’ error.
As I do not use any database from Taipy I shouldn’t have to have such drivers installed IMHO.
Maybe I’m missing something ?
— JMMDecember 14, 2022 at 3:48 pm #237386
So, how do you access your db without doing “SQL-related stuff”? Maybe, try to delete your .data of your project if not already done. If the previous configuration of the CSV data node is still in the .data, it might cause some errors.
I don’t see why you would get an “ODBC driver missing” error if you don’t use SQL in Taipy.
If the deletion of your .data doesn’t help, you can maybe contact me by mail to send me a copy of your code reproducing the error or organize a call.
FlorianDecember 14, 2022 at 3:57 pm #237387
thank you Florian,
clearing the .data directory did the trick, the pipeline works now,
I’m pulling the data from my DB using an orm, and not any of Taipy stuff, as I’m using MariaDB.
it’s OK now, thanks a lot for your help,
- You must be logged in to reply to this topic.