Dataiku DSS 7 AMA is live! Learn more

Python SQLExecutor2 fails to conect to dataset

Level 1
Python SQLExecutor2 fails to conect to dataset

Following the tutorial on Using SQL in Python when trying to execute the Python code to extract the initial data from the dataset in the flow, SQLExecutor throws an error stating that the relation dataset does not exist.



The code is literally copy-pasted from the tutorial




sfo_prepared = dataiku.Dataset("sfo_prepared")

executor = SQLExecutor2(dataset=sfo_prepared)

mf_manufacturers = executor.query_to_df(
"""
select "Aircraft Manufacturer" as manufacturer,
sum("Landing Count") as count
from sfo_prepared
group by "Aircraft Manufacturer"
order by count desc limit 5
""")



Error message



-----



Error in Python process: At line 25: <type 'exceptions.Exception'>: None: During query ' select "Aircraft Manufacturer" as manufacturer, sum("Landing Count") as count from sfo_prepared group by "Aircraft Manufacturer" order by count desc limit 5 ': ERROR: relation "sfo_prepared" does not exist Position: 122



-----



This code is being run as a recipe within the flow and not as a separate Notebook.

Any idea of what would be causing this issue?

0 Kudos
1 Reply
Dataiker
Dataiker
Is the table sfo_prepared exists ? or is it in the right schema ?
0 Kudos
Labels (3)