> ## Content Index
> Fetch the complete content index at: https://www.daanalytics.nl/llms.txt
> Use this file to discover other available public pages before exploring further.

# Building a Data Quality Framework with Snowflake and Streamlit
- URL: https://www.daanalytics.nl/data-quality-framework-in-snowflake-streamlit/
- Published: 2023-03-30T14:51:14.000Z
- Updated: 2026-08-28T07:33:43.000Z
- Author: Daan Bakboord
- Tags: Data Quality, Snowflake, Python, Streamlit

Data is one of the most important assets in organizations today. If you cannot trust the Data, decision making based on this Data is impossible. Measuring Data Quality is therefor essential. Inspired by the blogpost; "Data Quality Framework in Snowflake" of Divya Rajesh Surana, I decided to take it one step further by including Streamlit.

The Data Quality framework contains several checks, which will be stored in a database table and populated by a procedure. The code to create a Data Quality user, role, warehouse, database, etc. is on [GitHub](https://github.com/daanalytics/Snowflake/blob/master/code/SetupQA.sql?ref=daanalytics.nl). The additional objects, like the table to hold the metrics and the procedure to populate the table are also on [GitHub](https://github.com/daanalytics/Snowflake/blob/master/code/SetupQAobjects.sql?ref=daanalytics.nl).

In the original blogpost, you can call the procedure by the below statement:

[Bekijk code op GitHub Gist](https://gist.github.com/daanalytics/641df14af1f7a8cb074f62b89cd84b80?ref=daanalytics.nl)

When the Procedure has run successfully, you can query the Data Quality Metrics table by issuing the below query:

[Bekijk code op GitHub Gist](https://gist.github.com/daanalytics/c7c4bd7be3479a371f6a9c61a2d3b492?ref=daanalytics.nl)

## Streamlit

While this works fine working from Snowflake, I thought it could be also interesting to make an Streamlit app for this. The app works as follows:

- input fields to select the table (database, schema and table) you want to measure for Data Quality
- a button that calls the procedure
- the output of the query in a table

In previous Streamlit blogpost I covered connecting to Snowflake, which I will not repeat here. That's a relatively straightforward process

![Streamlit Sidebar Input fields to select he table (database, schema and table) you want to measure for Data Quality](https://www.daanalytics.nl/content/images/2023/03/image-edited-2.png)

Creating a sidebar with some Text inputs is easy. Call. the Streamlit-library prefixed with 'st'. Make sure you include 'sidebar', to put the Text Inputs in the Sidebar.

See the code below for more details.

[Bekijk code op GitHub Gist](https://gist.github.com/daanalytics/34b08ba62122f4bebde15d4b62667ac8?ref=daanalytics.nl)

![](https://www.daanalytics.nl/content/images/2023/03/image-1-2.png)

By clicking the 'Run Quality Assurance'-button, the procedure; 'QUALITY\_ASSURANCE.QUALITY\_CHECK.DATA\_QUALITY' is executed. When all is ok, a green message; 'Procedure has been executed successfully.' appears.

[Bekijk code op GitHub Gist](https://gist.github.com/daanalytics/277e225713b88f0dee039f3a5e2ab5b3?ref=daanalytics.nl)

Executing the procedure results in the below output. A table with the results of querying the QUALITY\_ASSURANCE.QUALITY\_CHECK.DATA\_QUALITY\_METRICS table.

[Bekijk code op GitHub Gist](https://gist.github.com/daanalytics/3d1c59735e428b986ad8410c7ab876ba?ref=daanalytics.nl)

![](https://www.daanalytics.nl/content/images/2023/03/image-2-1024x608-2.png)

The complete code of this Streamlit Application is on [GitHub](https://github.com/daanalytics/Snowflake/blob/master/python/streamlit/quality%5Fassurance.py?ref=daanalytics.nl). In this case I have deployed the Application in the Streamlit Cloud.

### Closing Statements

This was the first solution I found online, because I was reading on Medium. I will not argue that this is the best solution. I found other solutions as well. Taking once code as head start and creating your own version out of it is easy. Building a Streamlit Application around it is even easier and worth a try. If I can do it......

Till next time.

[Daan Bakboord – DaAnalytics](https://www.linkedin.com/in/daanbakboord?ref=daanalytics.nl)