Python SQLExecutor2 fails to conect to dataset

DKasatchkow
DKasatchkow Registered Posts: 1 ✭✭✭✭
edited July 18 in Using Dataiku

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?

Tagged:

Answers

Setup Info
    Tags
      Help me…