Requesting snowflake with python
Hello, I am working on web app designer, I want to create a tile which lists the tables of my schemas of my snowflake db.
I have to do it in python but I don't know how to do it.
Since I am already connecting to snowflake from dataiku (I can add a dataset to the flow) I tell myself that in my script I no longer need to put the credentials to connect.
Would you know how to connect to snowflake with python? (without putting id and password)
Best Answer
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,171 Neuron
OK have a look at the SQLExecutor2 method:
https://knowledge.dataiku.com/latest/code/python/tutorial-sql-in-python-recipe.html
This will allow you to execute SQL over your existing SQL connections, like Snowflake, and retrieve the contents as a data frame.
Answers
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,171 Neuron
What type of Dataiku WebApp are you designing?
-
it's Application Designer.
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,171 Neuron
OK so you are not designing a Dataiku WebApp you are designing Dataiku Application. I am not sure which on you really meant to do and the answer to your question will depend on what you are developing. Do you want a Dataiku WebApp or a Dataiku Application? These are completely different things and fill completely different purposes.
-
i'm designing an Dataiku Application.
On one of my tiles (Edit Projet variables) i'm trying to create a python capable to list all tables whitch are in my snowflake db
-
thank you it works