Calling dataset from API deisgner failed
Rachel
Registered Posts: 4 ✭✭
How to call the dataset in Python function from API designer?
im using Python function, and in the function, I'm using below function:
def testing_example(parameter1):
dataset = dataiku.Dataset("datasetname",project_key="project_id")
df = dataset.get_dataframe()
But it fails. Any idea how to solve this?
Tagged:
Answers
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,090 Neuron
The API node is outside DSS so you need to connect to it first.
import dataiku dataiku.set_remote_dss("http://DSS_local_URL:DSS_PORT", "API_secret") dataset = dataiku.Dataset("datasetname", project_key="PROJECT_KEY") dataset_df = dataset.get_dataframe() dataset_df.head()