If the dataset do not exists, I either want to catch this exception thrown, or check if df exists

Setup Info
Registered Posts: 2 ✭✭

Exception: Reading dataset failed: b"Failed to read data from table, caused by: SnowflakeSQLException: SQL compilation error:\nObject 'PROD_.GLOBAL_PILOT' does not exist or not authorized."

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,320 Neuron
    edited October 2024

    You need to give more context than this. What are you trying to achieve? Post your Python recipe in a code block (the </> icon).

  • Registered Posts: 2 ✭✭

    In the community, you can ask the following question to address your requirement:

    "I would like to check if a dataframe exists before attempting to read a dataset. Furthermore, if the dataframe doesn't exist or if there are any issues in reading the dataset, I want to implement a condition to handle the error and perform a specific action. How can I achieve this in my code?"
     dataiku.Dataset("cn_pilot").get_dataframe()

    I would like to check if a dataframe exists before attempting to read a dataset. Furthermore, if the dataframe doesn't exist or if there are any issues in reading the dataset, I want to implement a condition to handle the error and perform a specific action. How can I achieve this in my code?

  • Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,320 Neuron
    try:
        dataiku.Dataset("cn_pilot").get_dataframe()
    except Exception as e:
        print(e)

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.