Community Conundrum 28: News Engagement is live! Read More

Error on import for a SQL Query in a python recipe

Level 1
Error on import for a SQL Query in a python recipe

Hello,



I'm trying to make some SQL query directly from a python recipe to make some work in python on the results.



I followed the advice from this page : http://doc.dataiku.com/dss/latest/api/python/sql.html



But I get the following error, as soon as I try to import SQLExecutor, any idea what's the problem ?




[2015/12/02-18:27:32.411] [Exec-30] [INFO] [dku.utils] - from dataiku.core.sql import SQLExecutor2
[2015/12/02-18:27:32.411] [Exec-30] [INFO] [dku.utils] - ImportError: cannot import name SQLExecutor2
0 Kudos
1 Reply
Dataiker
Dataiker

Hi hrobellaz, 



You'd better try this: 




from dataiku.core import sql

sqe = sql.SQLExecutor("yourConnectionName")
df = sqe.exec_query("SELECT * FROM TABLE")


 



Matt

Mattsco
0 Kudos
Labels (3)
A banner prompting to get Dataiku DSS