Snowflake Integration
In this article, we will be looking at loading data from Snowflake tables and using the data for the following tasks-
Uploading baseline data to Fiddler
Onboarding a model to Fiddler and creating a surrogate
Publishing production data to Fiddler
Import data from Snowflake
In order to import data from Snowflake to Jupyter notebook, we will use the snowflake library, this can be installed using the following command in your Python environment.
Once the library is installed, we would require the following to establish a connection to Snowflake
Snowflake Warehouse
Snowflake Role
Snowflake Account
Snowflake User
Snowflake Password
These can be obtained from your Snowflake account under the ‘Admin’ option in the Menu as shown below or by running the queries -
Warehouse - select CURRENT_WAREHOUSE()
Role - select CURRENT_ROLE()
Account - select CURRENT_ACCOUNT()
'User' and 'Password' are the same as one used for logging into your Snowflake account.
![](https://docs.fiddler.ai/~gitbook/image?url=https%3A%2F%2F1798616019-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FmtRqRYN3Dch4wlduXsol%252Fuploads%252Fgit-blob-f19f86ebeff75f15117eee3a8de9b47cdfcfda3c%252Fc2f4cf4-Screen_Shot_2022-06-14_at_4.17.36_PM.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=7dc0b427&sv=1)
Once you have this information, you can set up a Snowflake connector using the following code -
You can then write a custom SQL query and import the data to a pandas dataframe.
Publish Production Events
In order to publish production events from Snowflake, we can load the data to a pandas dataframe and publish it to fiddler using fdl.Model.publish api.
Now that we have data imported from Snowflake to a jupyter notebook, we can refer to the following notebooks to
Last updated