<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sam Kohlleffel on Medium]]></title>
        <description><![CDATA[Stories by Sam Kohlleffel on Medium]]></description>
        <link>https://medium.com/@sam.kohlleffel?source=rss-886c759dd690------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*XxrWXo6A3d70h-C760sWfA.jpeg</url>
            <title>Stories by Sam Kohlleffel on Medium</title>
            <link>https://medium.com/@sam.kohlleffel?source=rss-886c759dd690------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 10:43:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sam.kohlleffel/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Cloudy SQL — Querying Snowflake Inside a Jupyter Notebook]]></title>
            <link>https://medium.com/hashmapinc/cloudy-sql-querying-snowflake-inside-a-jupyter-notebook-408695683ed4?source=rss-886c759dd690------2</link>
            <guid isPermaLink="false">https://medium.com/p/408695683ed4</guid>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[jupyter-notebook]]></category>
            <dc:creator><![CDATA[Sam Kohlleffel]]></dc:creator>
            <pubDate>Thu, 28 Jan 2021 14:06:50 GMT</pubDate>
            <atom:updated>2021-03-19T14:24:37.043Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cloudy SQL — Querying Snowflake Inside a Jupyter Notebook</h3><h4>A Jupyter Magics extension designed for Data Scientists to interact seamlessly with Snowflake</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lt0zkW1YYgD3OVHKHyz8AQ.png" /></figure><h3>Background</h3><p>The <a href="http://www.snowflake.com/">Snowflake Data Cloud</a> is multifaceted providing scale, elasticity, and performance all in a consumption-based SaaS offering. Customers can load their data into Snowflake tables and easily transform the stored data when the need arises.</p><p>Among the many features provided by Snowflake is the ability to establish a remote connection. From this connection, you can leverage the majority of what Snowflake has to offer.</p><p>I will focus on two features: running SQL queries and transforming table data via a remote Snowflake connection.</p><p>One popular way for data scientists to query Snowflake and transform table data is to connect remotely using the <a href="https://docs.snowflake.com/en/user-guide/python-connector.html">Snowflake Connector Python</a> inside a <a href="https://jupyter.org/">Jupyter Notebook</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/317149e906c2769dd0b7c195d964eeb9/href">https://medium.com/media/317149e906c2769dd0b7c195d964eeb9/href</a></iframe><p>The example above is a use case of the Snowflake Connector Python inside a Jupyter Notebook. I first create a connector object. Then, a cursor object is created from the connection. After creating the cursor, I can execute a SQL query inside my Snowflake environment. Finally, I store the query results as a pandas DataFrame. I can now easily transform the pandas DataFrame and upload it to Snowflake as a table.</p><p>From the example above, you can see that connecting to Snowflake and executing SQL inside a Jupyter Notebook is not difficult, but it can be inefficient. To address this problem, we developed an open-source Python package and Jupyter extension.</p><h3>Cloudy SQL</h3><p><a href="https://www.hashmapinc.com/cloudy-sql">Cloudy SQL</a> is a pandas and Jupyter extension that manages the Snowflake connection process and provides a simplified way to execute SQL in Snowflake from a Jupyter Notebook.</p><p>Watch a demonstration video of <a href="https://www.hashmapinc.com/cloudy-sql"><strong>Cloudy SQL</strong></a> in this Hashmap Megabyte:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FYVheg9Du-B0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DYVheg9Du-B0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FYVheg9Du-B0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1455579f76e88535e61158a3268d0322/href">https://medium.com/media/1455579f76e88535e61158a3268d0322/href</a></iframe><h4>Supported Methods</h4><p>Cloudy SQL currently supports:</p><ol><li>A Jupyter magic method that allows users to execute SQL queries in Snowflake from a Jupyter Notebook easily</li><li>Writing to an existing or new Snowflake table from a pandas DataFrame</li></ol><h4>Installation and Configuration</h4><p>To optimize Cloudy SQL, a few steps need to be completed before use:</p><ul><li>Run pip install cloudy-sql to install Cloudy SQL and its dependencies:</li><li>Upon installation, open an empty Jupyter notebook and run the following code in a Jupyter cell:</li></ul><p>%load_ext cloudy_sql</p><p>After you run the above code, a configuration file will be created in your HOME directory. Cloudy SQL uses the information in this file to connect to Snowflake for you.</p><p>The path to the configuration file: $HOME/.cloudy_sql/configuration_profiles.yml</p><blockquote><em>For Windows use </em><em>$USERPROFILE instead of </em><em>$HOME</em></blockquote><p>The configuration file has the following format:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/177960dafeba222224e697d669faeeab/href">https://medium.com/media/177960dafeba222224e697d669faeeab/href</a></iframe><ul><li>Open this file using the path provided above and fill out your Snowflake information to the applicable fields.</li></ul><p><strong>Note: </strong>Configuration is a one-time setup. Once you’ve configured the credentials file, you can use it for any project that uses Cloudy SQL.</p><h3>How it works</h3><p>When you call any Cloudy SQL magic or method, it uses the information stored in the configuration_profiles.yml to seamlessly connect to Snowflake.</p><p>Cloudy SQL currently supports two options to pass in Snowflake connection credentials and details:</p><ol><li>The above configuration file. configuration_profiles.yml serves as the place to store default Snowflake credentials.</li><li>Pass in your Snowflake details as arguments when calling a Cloudy SQL magic or method. Any argument passed in will prioritize its corresponding default value stored in the configuration file when you use this option.</li></ol><h3>Using the Extension</h3><p>To use Cloudy SQL in a Jupyter Notebook, you need to run the following code in a cell:</p><p>%load_ext cloudy_sql</p><h3>API</h3><p>The intent has been to keep the API as simple as possible by minimally extending the pandas and IPython Magic APIs.</p><h4>%%sql_to_snowflake</h4><p>IPython Cell Magic to seamlessly connect to Snowflake and run a query in Snowflake and optionally return a pandas DataFrame as the result when applicable.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9262126a91942d91639d164f2d926547/href">https://medium.com/media/9262126a91942d91639d164f2d926547/href</a></iframe><h4><strong>Parameters</strong></h4><ul><li><strong>&lt;SQL query&gt; </strong>(Required)<strong><br></strong>SQL query to be executed in Snowflake</li><li><strong>&lt;destination_var&gt;</strong> (Positional)<br>Variable to store the query results. If none is given, the magic will return the first 10 rows of the pandas DataFrame if applicable.</li><li><strong>--params &lt;params&gt;</strong> (Optional)<br>Parameters to be used in the SQL Query. Params must be passed in as a dictionary string in the format {&quot;param_name&quot;: &quot;param_value&quot;} or reference a dictionary string defined in a previous cell. The use of a parameter in the query should be indicated with {{param_name}}.</li><li><strong>--username &lt;username&gt; </strong>(Optional)<br>The called method will connect to Snowflake with this username instead of the configuration file&#39;s default if provided.</li><li><strong>--password &lt;password&gt;</strong> (Optional)<br>If provided, the called method will connect to Snowflake with this password instead of the default configuration file.</li><li><strong>--account &lt;account&gt; </strong>(Optional)<strong><br></strong> If provided, the called method will connect to Snowflake with this account instead of the configuration file&#39;s default.</li><li><strong>--role &lt;role&gt; </strong>(Optional)<strong><br></strong> If provided, the called method will connect to Snowflake with this role instead of the default in the configuration file.</li><li><strong>--warehouse &lt;warehouse&gt; </strong>(Optional)<strong><br></strong> If provided, the called method will use this warehouse instead of the default in the configuration file.</li></ul><h4>write_snowflake</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e41d83811785391a8ddbc572d3025d0b/href">https://medium.com/media/e41d83811785391a8ddbc572d3025d0b/href</a></iframe><p>This method allows users to create a Snowflake table and write to that table with a pandas DataFrame. Users can also use this method to append data to an existing Snowflake table.</p><p>The only required argument to directly include is table.</p><p>This method works when writing to either an existing Snowflake table or a previously non-existing Snowflake table. If the table you provide does not exist, this method creates a new Snowflake table and writes to it. If the table already exists, the DataFrame data is appended to the existing table by default. If you would like to replace the table with the pandas, DataFrame set overwrite = True when calling the method.</p><p>Role and warehouse are optional arguments that can be set up in the configuration_profiles.yml.</p><p>Username, password, account, database, and schema are all required but can have default values set up in the configuration file.</p><h3>Examples</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/75e7dfe03135a31f97eca59a9b9fdc4a/href">https://medium.com/media/75e7dfe03135a31f97eca59a9b9fdc4a/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0cb4fe52042e593f3e9289e7cbce331f/href">https://medium.com/media/0cb4fe52042e593f3e9289e7cbce331f/href</a></iframe><p>The example above shows how a user can leverage both the %%sql_to_snowflake magic and the write_snowflake method. It runs a SQL query with %%sql_to_snowflake and saves the results as a pandas DataFrame by passing in the destination variable df In [6]. The called %%sql_to_snowflake magic uses the Snowflake credentials found in the configuration file.</p><p>The example then shows how to easily write that df to a Snowflake table In [8]. The write_snowflake method uses the default username, password, account, database, and schema found in the configuration file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d76bb31a3c01cc4523b10285c59eaee8/href">https://medium.com/media/d76bb31a3c01cc4523b10285c59eaee8/href</a></iframe><p>The example above runs a SQL query with passed-in variables. The variables are used directly in the SQL query by placing each one inside {{ }}. A dictionary string parameters is passed in when the magic is called by including the--params inline argument and placing a $ to reference the dictionary string creating in the previous cell In [3]. The magic also uses the passed in snowflake_username instead of the default in the configuration file.</p><p>The example then shows how to overwrite the existing test_cloudy_sql table with the data in the df variable by setting overwrite = True In [5]. The user then drops the table In [6].</p><h4>Get the Code</h4><p>Find the Gitlab Repo <a href="https://gitlab.com/hashmapinc/oss/cloudy_sql">here</a>.</p><h3>Conclusion</h3><p><a href="https://www.hashmapinc.com/cloudy-sql">Cloudy SQL</a> is a pandas and Jupyter extension that manages the <a href="https://www.hashmapinc.com/snowflake">Snowflake</a> connection process and provides a simplified and streamlined way to execute SQL in Snowflake from a Jupyter Notebook. This tool continues to be developed with new features, so any feedback is greatly appreciated. Be sure to check out the PyPi package <a href="https://pypi.org/project/cloudy-sql/">here</a>!</p><h3>Ready to Accelerate Your Digital Transformation?</h3><p>At Hashmap, we work with our clients to build better together.</p><p>If you are considering moving data and analytics products and applications to the cloud or if you would like help and guidance and a few best practices in delivering higher value outcomes in your existing cloud program, then please <a href="http://hashmapinc.com/reach-out">contact us</a>.</p><p><a href="https://www.hashmapinc.com/"><strong>Hashmap</strong></a><strong>, an NTT DATA Company, </strong>offers a range of enablement workshops and assessment services, cloud modernization and migration services, and consulting service packages as part of our data and cloud service offerings. We would be glad to work through your specific requirements.</p><p><em>Feel free to share on other channels, and be sure and keep up with all new content from Hashmap </em><a href="http://hashmapinc.com/"><strong><em>here</em></strong></a><em>. To listen in on a casual conversation about all things data engineering and the cloud, check out Hashmap’s podcast </em><a href="https://www.hashmapinc.com/hashmapontap"><strong><em>Hashmap on Tap</em></strong></a><strong><em> </em></strong><em>as well on Spotify, Apple, Google, and other popular streaming apps.</em></p><p><a href="https://www.hashmapinc.com/hashmapontap">Hashmap on Tap | Hashmap Podcast</a></p><h3>Other Tools and Content For You</h3><ul><li><a href="https://medium.com/hashmapinc/cloudy-warehouses-simplifying-snowflake-pandas-dataframes-interaction-4199b5c6c977">Cloudy Warehouses — Simplifying Snowflake &amp; pandas DataFrames Interaction</a></li><li><a href="https://medium.com/hashmapinc/introducing-hashmap-data-migrator-87417065dbc8">Introducing Hashmap Data Migrator</a></li><li><a href="https://www.hashmapinc.com/snowflake-utilities-accelerators">Snowflake Utilities &amp; Accelerators | Do more with Snowflake | Hashmap</a></li><li><a href="https://medium.com/hashmapinc/behind-the-scenes-of-snowflake-healthcheck-661091ba1701">Behind the Scenes of Snowflake Healthcheck</a></li></ul><p><a href="http://www.linkedin.com/in/samuel-kohlleffel"><strong><em>Sam Kohlleffel</em></strong></a><strong><em> </em></strong><em>is in the RTE Internship program at </em><a href="http://hashmapinc.com/"><em>Hashmap</em></a><em>, an NTT DATA Company. When he’s not developing data and cloud applications, he’s studying Economics, Math, and Statistics at Texas A&amp;M University.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=408695683ed4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hashmapinc/cloudy-sql-querying-snowflake-inside-a-jupyter-notebook-408695683ed4">Cloudy SQL — Querying Snowflake Inside a Jupyter Notebook</a> was originally published in <a href="https://medium.com/hashmapinc">Hashmap, an NTT DATA Company</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloudy Warehouses — Simplifying Snowflake & pandas DataFrames Interaction]]></title>
            <link>https://medium.com/hashmapinc/cloudy-warehouses-simplifying-snowflake-pandas-dataframes-interaction-4199b5c6c977?source=rss-886c759dd690------2</link>
            <guid isPermaLink="false">https://medium.com/p/4199b5c6c977</guid>
            <category><![CDATA[snowflake-connector]]></category>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[dataframes]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[snowflake]]></category>
            <dc:creator><![CDATA[Sam Kohlleffel]]></dc:creator>
            <pubDate>Fri, 15 Jan 2021 13:51:24 GMT</pubDate>
            <atom:updated>2021-03-22T14:52:59.851Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cloudy Warehouses — Simplifying Snowflake &amp; pandas DataFrames Interaction</h3><h4>A pandas library extension designed for streamlined interaction between Snowflake and pandas DataFrames</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9KdTmT2ulwjauljie8sPxA.png" /></figure><h3>Background</h3><p><a href="https://www.snowflake.com/">Snowflake</a>’s Data Cloud enables us to run six core workloads as part of the service, including Data Engineering, Data Lake, Data Warehouse, Data Science, Data Apps, and Data Sharing. For this article, I’ll focus on two core workloads — Data Science and Data Warehouse.</p><p>Snowflake users store their data in tables and can transform the uploaded data as they see fit. One popular way for Python developers and data scientists to interact with Snowflake tables is using <a href="https://pandas.pydata.org/docs/reference/frame.html">pandas DataFrames</a> and the <a href="https://docs.snowflake.com/en/user-guide/python-connector.html">Snowflake Connector for Python</a>.</p><p>With the Snowflake Connector, developers can establish a <a href="https://docs.snowflake.com/en/user-guide/python-connector-example.html">direct connection</a> with Snowflake from their local machines. They then can interact with their Snowflake environment. Using the Snowflake Connector isn’t difficult, but it takes time to learn, as with any new library.</p><p>Every time you want to perform basic interactions with Snowflake from your local machine, the Connector requires that you provide your account credentials and connection details for each project. From personal experience, I can tell you this process becomes tedious. Thankfully, there is now a tool we developed that addresses this problem.</p><h3>Cloudy Warehouses — a pandas extension for Snowflake</h3><p><a href="https://www.hashmapinc.com/cloudy-warehouses">Cloudy Warehouses</a> is a pandas extension that manages the <a href="https://www.hashmapinc.com/snowflake">Snowflake</a> connection process and provides simplified interaction methods between Snowflake and pandas DataFrames.</p><p><a href="https://gitlab.com/hashmapinc/oss/cloudy-warehouses">Gitlab Repository</a></p><p><a href="https://github.com/hashmapinc/cloudy_warhouses">Github Mirror</a></p><h4>Snowflake Support</h4><p>The cloudy_warehouses pandas extension currently supports:</p><ol><li>Writing to an existing or new Snowflake table from a pandas DataFrame</li><li>Reading from a Snowflake table</li><li>Listing Snowflake tables in a database</li><li>Creating a clone of an existing Snowflake table</li><li>Creating an empty clone of an existing Snowflake table (clones columns, not column data)</li></ol><h4>Installation and Configuration</h4><p>Follow the steps below or you can watch my walk through how to set up and use Cloudy Warehouses in this Hashmap Megabyte:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FD7Lq7SaHrHg%3Fstart%3D15%26feature%3Doembed%26start%3D15&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DD7Lq7SaHrHg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FD7Lq7SaHrHg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1a70a6900e65eeb8c13a21bbe7496b31/href">https://medium.com/media/1a70a6900e65eeb8c13a21bbe7496b31/href</a></iframe><p>To fully utilize Cloudy Warehouses, a few steps need to be completed before use:</p><ul><li>Run pip install cloudy-warehouses to install Cloudy Warehouses and their dependencies:</li><li>Upon installation, create an empty Python file with the following two lines of code:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7640e348b21923b700bdf396fa841466/href">https://medium.com/media/7640e348b21923b700bdf396fa841466/href</a></iframe><p>After you run the above Python file, a configuration file will be created in your HOME directory. Cloudy Warehouses uses the information in this file to connect to Snowflake for you.</p><p>The path to the configuration file: $HOME/.cloudy_warehouses/configuration_profiles.yml</p><blockquote>For Windows use $USERPROFILE instead of $HOME</blockquote><p>The configuration file has the following format:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c78daad7f7cb50e7660fa75efa14ea30/href">https://medium.com/media/c78daad7f7cb50e7660fa75efa14ea30/href</a></iframe><ul><li>Open the above file using the path provided above and fill out your Snowflake information to the applicable fields.</li></ul><p><strong>Note: </strong>Configuration is a one-time setup. Once you’ve configured the credentials file, you can use it for any project that uses Cloudy Warehouses.</p><h4>How it works</h4><p>When you call any Cloudy Warehouses method, it uses the information stored in the configuration_profiles.yml to seamlessly connect to Snowflake.</p><p>Cloudy Warehouses currently supports two options to pass in Snowflake connection credentials and details:</p><ol><li>The above configuration file. configuration_profiles.yml serves as the place to store default Snowflake credentials.</li><li>Pass in your Snowflake details as arguments when calling a Cloudy Warehouses method. Any argument passed in will prioritize its corresponding default value stored in the configuration file when you use this option.</li></ol><h4><strong>Using the Extension</strong></h4><p>To use Cloudy Warehouses in a Python file, you need the two following import statements:</p><p>import cloudy_warehouses</p><p>import pandas as pd</p><h4>API</h4><p>The intent has been to keep the API as simple as possible by minimally extending the pandas and Snowflake Connector APIs.</p><p><strong>Writing to a Snowflake Table</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/381272abf6388bbea83b38ff15466b2b/href">https://medium.com/media/381272abf6388bbea83b38ff15466b2b/href</a></iframe><p>This method allows users to create a Snowflake table and write to that table with a pandas DataFrame. Users can also use this method to append data to an existing Snowflake table.</p><p>The only required argument to directly include is table.</p><p>Role and warehouse are optional arguments that can be set up in the configuration_profiles.yml .</p><p>Username, password, account, database, and schema are all required but can all have default values set up in the configuration file.</p><p><strong>Reading from a Snowflake Table</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cbf458318deee917ba97c1dd0156441d/href">https://medium.com/media/cbf458318deee917ba97c1dd0156441d/href</a></iframe><p>This method reads from a Snowflake table and returns the data in that table as a pandas DataFrame.</p><p>The only required argument to be directly passed in is table.</p><p>Role and warehouse are optional arguments that can be set up in the configuration_profiles.yml .</p><p>Username, password, account, database, and schema are all required but can all have default values set up in the configuration file.</p><p><strong>Listing the Tables in a Snowflake Database</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d88841cf84982c8507165cdffc341af/href">https://medium.com/media/1d88841cf84982c8507165cdffc341af/href</a></iframe><p>This method returns all of the tables in a Snowflake database as a pandas DataFrame.</p><p>There are no variables that need to be directly passed in when calling this method. All of the variables can have default values set up in the configuration file.</p><p><strong>Creating a Clone of an Existing Snowflake Table</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/92ef4860b0554bf56e48c8eb5c08d980/href">https://medium.com/media/92ef4860b0554bf56e48c8eb5c08d980/href</a></iframe><p>This method creates a clone of an existing Snowflake table. The new_table variable is the new table that will be created after the method is called. The source_table variable is the existing Snowflake table that is being cloned. The optional source_database and source_schema variables are the database and schema in which the source_table resides. If you plan to clone an existing table from the schema and database that the new_table will reside in, you do not need to include source_database and source_schema variables. The other variables can have defaults set up in the configuration file.</p><p><strong>Creating an Empty Clone of an Existing Snowflake Table</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5ce2b31f359bc79e840d4cc61870cacf/href">https://medium.com/media/5ce2b31f359bc79e840d4cc61870cacf/href</a></iframe><p>This method creates an empty clone of an existing Snowflake table. The new_table variable is the new table that will be created after the method is called. The source_table variable is the existing Snowflake table that is being cloned. The optional source_database and source_schema variables are the database and schema in which the source_table resides. If you plan to clone an existing table from the schema and database that the new_table will reside in, you do not need to include source_database and source_schema variables. The other variables can have defaults set up in the configuration file.</p><p>Now, let’s look at an example.</p><h4>Example</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f7d694f360f2739a10fcd3d8603bd300/href">https://medium.com/media/f7d694f360f2739a10fcd3d8603bd300/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a27dafc3228c961b522823791622b8ce/href">https://medium.com/media/a27dafc3228c961b522823791622b8ce/href</a></iframe><p>The above example shows how a user can leverage the read and write methods of Cloudy Warehouses after setting it up — configuration stored in: configuration_profiles.yml.</p><p>In this case, df.cloudy_warehouses.write_snowflake uses the username, password, account, database, schema, warehouse, and role stored in the above configuration file.</p><p>Meanwhile, pd.read_snowflake uses database and schema arguments that are passed in. Those two arguments will be used instead of the default values. Cloudy Warehouses will connect to Snowflake with the default username, password, account, warehouse, and role parameters stored in the configuration file.</p><p>The traditional way to do this is to manually create a Snowflake connection and run commands from that point on.</p><h3>Features We Are Looking to Add</h3><ol><li>Supported methods for additional cloud-based data platforms <br>(BigQuery, Azure Synapse)</li><li>Additional API features</li><li>New connection options <br>(key auth, SSO)</li></ol><h3>Conclusion</h3><p>Cloudy Warehouses streamlines and simplifies interactions between pandas and Snowflake. This tool is still in development with new features to be added, so any feedback is appreciated. Be sure to check out the PyPi package <a href="https://pypi.org/project/cloudy-warehouses/">here</a>!</p><p>Don’t forget to watch <a href="https://www.youtube.com/watch?v=D7Lq7SaHrHg&amp;t=60s">my video walkthru of Cloudy Warehouses</a> — I hope you’ll check it out!</p><h3>Need Snowflake Cloud Data Warehousing and Migration Assistance?</h3><p>If you’d like additional assistance in this area, <a href="http://hashmapinc.com/snowflake"><strong>Hashmap</strong></a><strong>, an NTT DATA Company, </strong>offers a range of enablement workshops and consulting service packages as part of our consulting service offerings. We would be glad to work through your specifics in this area. <a href="https://www.hashmapinc.com/reach-out">Reach out to us here</a>.</p><h3>Other Tools and Content For You</h3><ul><li><a href="https://medium.com/hashmapinc/introducing-hashmap-data-migrator-87417065dbc8">Introducing Hashmap Data Migrator</a></li><li><a href="https://www.hashmapinc.com/snowflake-utilities-accelerators">Snowflake Utilities &amp; Accelerators | Do more with Snowflake | Hashmap</a></li><li><a href="https://medium.com/hashmapinc/behind-the-scenes-of-snowflake-healthcheck-661091ba1701">Behind the Scenes of Snowflake Healthcheck</a></li><li><a href="https://medium.com/hashmapinc/supercharge-your-snowflake-billing-statement-with-user-metrics-ad5720f7ea95">Supercharge Your Snowflake Billing Statement with User Metrics</a></li></ul><p><a href="http://www.linkedin.com/in/samuel-kohlleffel"><strong><em>Sam Kohlleffel</em></strong></a><strong><em> </em></strong><em>is in the RTE Internship program at </em><a href="http://hashmapinc.com/"><em>Hashmap</em></a><em>, an NTT DATA Company. When he’s not developing data and cloud applications, he’s studying Economics, Math, and Statistics at Texas A&amp;M University.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4199b5c6c977" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hashmapinc/cloudy-warehouses-simplifying-snowflake-pandas-dataframes-interaction-4199b5c6c977">Cloudy Warehouses — Simplifying Snowflake &amp; pandas DataFrames Interaction</a> was originally published in <a href="https://medium.com/hashmapinc">Hashmap, an NTT DATA Company</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Behind the Scenes of Snowflake Healthcheck]]></title>
            <link>https://medium.com/hashmapinc/behind-the-scenes-of-snowflake-healthcheck-661091ba1701?source=rss-886c759dd690------2</link>
            <guid isPermaLink="false">https://medium.com/p/661091ba1701</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[snowflake-healthcheck]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[snowflake]]></category>
            <dc:creator><![CDATA[Sam Kohlleffel]]></dc:creator>
            <pubDate>Thu, 03 Dec 2020 21:46:47 GMT</pubDate>
            <atom:updated>2021-02-03T11:00:05.704Z</atom:updated>
            <content:encoded><![CDATA[<h4>Understanding Hashmap’s Latest Snowflake Utility</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PdKMneUxjtoq0lZuQX7ovA.jpeg" /></figure><p><a href="https://healthcheck.snowflakeinspector.com/">Snowflake Healthcheck</a> is the latest <a href="https://www.hashmapinc.com/snowflake-utilities-accelerators">Snowflake utility</a> developed by <a href="https://www.hashmapinc.com/">Hashmap</a>. Healthcheck helps users measure and improve the health of their Snowflake environment. In this article, I’ll first give a brief demonstration of how to use Snowflake Healthcheck, then I’ll show you how we use Snowflake query results to build the dashboards used to display the Healthcheck data.</p><p>You’re likely using the <a href="http://snowflake.com/">Snowflake</a> Data Cloud today to enable a wide range of data workloads including data warehousing, data lakes, data engineering, data science, and more. As a true SaaS service, Snowflake requires virtually no maintenance and operational overhead plus it’s consumption-based and very SQL friendly.</p><p>Based on the above and many other reasons, we continue to see significant market demand for Snowflake and as a <a href="http://hashmapinc.com/snowflake">Premier Services Partner</a>, we strive to do our best to add value to the overall customer experience — that’s where Snowflake Healthcheck comes in.</p><p>Snowflake Healthcheck is an open-source <a href="https://reactjs.org/">React</a> application. A Snowflake account with administrative privileges is the only requirement to use the tool.</p><h3><strong>How to Use the Tool</strong></h3><ul><li>Go to<a href="https://healthcheck.snowflakeinspector.com/"> Healthcheck</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NceiW2_fwJ685QB5" /></figure><ul><li>Click on the <strong>New Report </strong>button</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HbwEMlANjYj_u5P_" /></figure><ul><li>Click on the <strong>Copy to Clipboard </strong>button to copy the Snowflake query</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9LFAd4bdta0FVELY" /></figure><ul><li>Login to your <strong>Snowflake account</strong> and navigate to <strong>Worksheets</strong></li><li>Make a new worksheet</li><li><strong>Paste</strong> the Snowflake query that you copied earlier into your new worksheet</li><li>Click <strong>Run </strong>(the query will take a few minutes to complete)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ur6BkVPA92NMJBpv" /></figure><ul><li>Download the query results as a .csv file</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K_R0tHIXFWA4tdeT" /></figure><ul><li>Upload the .csv containing the query results and click <strong>Visualize</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8JzQb9VrDK-NYJDQ" /></figure><h3>Our Snowflake Query</h3><p>The Snowflake query we created for Healthcheck gathers data from views found in the SNOWFLAKE database and the ACCOUNT_USAGE schema. These views are available to anyone with a Snowflake account that has administrative access.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a8be152321194911e7725b3ca6f95409/href">https://medium.com/media/a8be152321194911e7725b3ca6f95409/href</a></iframe><p>The three views that we query from are:</p><ul><li>QUERY_HISTORY provides detailed records of all query history up to a year</li><li>WAREHOUSE_METERING_HISTORY provides records of credit usage for all warehouses in the Snowflake account</li><li>DATABASE_STORAGE_USAGE_HISTORY provides records of storage for all databases in the Snowflake account</li></ul><h3><strong>Building the Charts</strong></h3><p>To visualize the query results, Snowflake Healthcheck leverages <a href="https://plotly.com/javascript/">plotly.js</a>. Before the .csv data can be visualized, it must first be parsed.</p><h4>Parsing the Query Results</h4><p>The Snowflake query we created allows us to easily read the results. The query results are generated as JSON objects where each row of the .csv file is an individual JSON object.</p><p>The individualJSON objects are formatted as seen below. Each object has a type key.</p><p>There are three possible type values:</p><ul><li>warehouse_health</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bae84962d0e09f523a11add12a91b953/href">https://medium.com/media/bae84962d0e09f523a11add12a91b953/href</a></iframe><ul><li>warehouse_usage</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c721846f629fcd3eac74d363928b83d0/href">https://medium.com/media/c721846f629fcd3eac74d363928b83d0/href</a></iframe><ul><li>database_usage</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f96390b532b0b72ac15f6523a26b30bb/href">https://medium.com/media/f96390b532b0b72ac15f6523a26b30bb/href</a></iframe><p>The type key is used for parsing the data because its value determines which chart component its data will be applied to.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7fa7865dff904c420bfb5c353f2d9ba3/href">https://medium.com/media/7fa7865dff904c420bfb5c353f2d9ba3/href</a></iframe><p>Once a user uploads their .csv file, the data is filtered based on the key type. This filtered data is used to update the state variables that are used by the chart components. Each of these state variables is an array and corresponds to a specific chart component.</p><ol><li>warehouse_health_data: used in the <strong>Warehouse Health </strong>chart component</li><li>warehouse_usage_data: used in the <strong>Warehouse Compute Credits </strong>chart component</li><li>database_datasize_data: used in the <strong>Database Usage </strong>chart component</li></ol><p>The data key of the JSON objects holds the specific key/value pairs that are used to make up the data for the specific chart.</p><h3><strong>The Charts</strong></h3><p>The above state variables are passed to the chart components as props. As of the writing of this article, Snowflake Healthcheck generates three charts.</p><h4><strong>Warehouse Health</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HihfxL4yuIuS3xwr" /></figure><p>Warehouse Health gives insight into the effect of past queries on the warehouse. It is a grouped bar chart with three traces that have corresponding values to each warehouse. The data used in this chart is gathered from the SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY view in Snowflake.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1314f6fd72f9fe6eae83573e0cabf3f3/href">https://medium.com/media/1314f6fd72f9fe6eae83573e0cabf3f3/href</a></iframe><p>This chart is generated by the data that is passed down in the warehouse_health_data prop variable which is formatted as follows. It is an array where each entry has a type and data key.</p><p>The data value is a JSON object that holds the following four keys:</p><ul><li>WAREHOUSE: the entry’s Snowflake warehouse</li><li>MEDIAN_EXECUTION_TIME_MINUTES: the median time it took to execute the queries for the warehouse (last 30 days to present)</li><li>MEDIAN_QUEUED_PROVISIONING_TIME_MINUTES: the median time spent in the warehouse queue when the warehouse was provisioning servers (last 30 days to present)</li><li>MEDIAN_QUEUED_OVERLOAD_TIME_MINUTES: the median time spent in the warehouse queue when the warehouse was overloaded by the query workload (last 30 days to present)</li></ul><p>The warehouse_health_data is iterated with a forEach loop. The three traces in the chart are generated from a key/value pair from warehouse_health_data.</p><p>For example, the Median Execution Time trace that can be seen in the chart comes from the MEDIAN_EXECUTION_TIME_MINUTES key in the warehouse_health_data.</p><h4><strong>Daily Warehouse Compute Credit Usage</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0mUQaMZS0qiCdNEm" /></figure><p>Warehouse Compute Credits gives insight into how much the warehouse is being used. It is a line chart in which each warehouse’s daily credit consumption is tracked over a 30 day period. The data that is gathered to make up this chart comes from the SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY Snowflake view.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4803d3670892b8583ea2fcd74e3e3be4/href">https://medium.com/media/4803d3670892b8583ea2fcd74e3e3be4/href</a></iframe><p>Warehouse Compute Credits chart component relies on the warehouse_usage_data prop variable to make visualizations. This prop variable is an array that is broken down as follows. Each entry in the array has a type and data key.</p><p>The value of data is a JSON object that holds the following three keys:</p><ul><li>WAREHOUSE: the entry’s Snowflake warehouse</li><li>DATE: the date that the credits were used</li><li>COMPUTE_CREDITS: the number of credits used</li></ul><p>In this stacked line chart, there is a trace for each warehouse. For each warehouse trace, the x-value is an array made up of the dates where credits were used in that warehouse. The y-value is the corresponding number of credits used on that date.</p><h4>Daily Database Usage (in GB)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kM8-zGYn1tQv7Sgv" /></figure><p>The Daily Database Usage (in GB) is a stacked line chart that shows the number of gigabytes of storage used by a specific database over a 30 day period. The data used to generate this chart comes from the SNOWFLAKE.ACCOUNT_USAGE.DATABASE_STORAGE_USAGE_HISTORY Snowflake view.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/768b3229e07d4f3e89537e6e572850d0/href">https://medium.com/media/768b3229e07d4f3e89537e6e572850d0/href</a></iframe><p>The data for the Daily Database Usage chart component is passed down as the database_datasize_data prop variable. This prop variable is an array that is broken down as follows. Each entry in the array has a type and data key.</p><p>The data key value is a JSON object that holds the following three keys:</p><ul><li>DATABASE: the entry’s Snowflake database</li><li>DATE: the date of the storage usage record</li><li>AVERAGE_DAILY_USAGE_GIGABYTES: the amount of storage data used (in GB)</li></ul><p>In this stacked line chart, there is a trace for each database. For each database trace, the x-value is an array made up of the dates in which data was initially stored in that database. The y-value is the corresponding amount of storage used (in gigabytes) on that day.</p><h3><strong>Final Thoughts</strong></h3><p>Snowflake Healthcheck provides an in-depth visualization of the health of your Snowflake environment. The charts described above provide health and cost summaries of the warehouses and databases attached to your Snowflake account. Be sure to check out <a href="https://healthcheck.snowflakeinspector.com/">Snowflake Healthcheck</a>! We are currently working on updates and plan to release new visualizations soon.</p><h3>Ready to Accelerate Your Digital Transformation?</h3><p>At Hashmap, we work with our clients to build better, together.</p><p>If you’d like additional assistance in this area, <a href="http://hashmapinc.com/snowflake"><strong>Hashmap</strong></a> offers a range of enablement workshops and consulting service packages as part of our consulting service offerings, and would be glad to work through your specifics in this area.</p><p>How does Snowflake’s platform compare to other data platforms? Our technical experts have implemented over 250 cloud/data projects in the last 3 years and conducted unbiased, detailed analyses across 34 business and technical dimensions, <a href="https://www.hashmapinc.com/snowflake-benchmarking">ranking each cloud data platform.</a></p><p><a href="https://www.hashmapinc.com/snowflake-benchmarking">2021 Cloud Data Platform Benchmark Analysis</a></p><h3>Other Tools and Content You Might Like</h3><ul><li><a href="https://www.hashmapinc.com/snowflake-utilities-accelerators">Snowflake Utilities &amp; Accelerators | Do more with Snowflake | Hashmap</a></li><li><a href="https://medium.com/hashmapinc/automating-a-react-app-hosted-on-aws-s3-snowflake-healthcheck-e3fd0feb9f05">Automating a React App Hosted on AWS S3 — Snowflake Healthcheck</a></li><li><a href="https://www.hashmapinc.com/webinars-and-meetups">Hashmap Webinars &amp; Meetups | On-Demand Videos</a></li><li><a href="https://www.hashmapinc.com/hashmapontap">Hashmap on Tap | Hashmap Podcast</a></li></ul><p><a href="http://www.linkedin.com/in/samuel-kohlleffel"><strong><em>Sam Kohlleffel</em></strong></a><strong><em> </em></strong><em>is in Hashmap’s RTE Internship program developing data and cloud applications and is also a student at Texas A&amp;M University studying Economics, Math, and Statistics.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=661091ba1701" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hashmapinc/behind-the-scenes-of-snowflake-healthcheck-661091ba1701">Behind the Scenes of Snowflake Healthcheck</a> was originally published in <a href="https://medium.com/hashmapinc">Hashmap, an NTT DATA Company</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating Reusable CI/CD Pipelines with GitLab]]></title>
            <link>https://medium.com/hashmapinc/creating-reusable-ci-cd-pipelines-with-gitlab-4c898de30b1e?source=rss-886c759dd690------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c898de30b1e</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[gitlab]]></category>
            <dc:creator><![CDATA[Sam Kohlleffel]]></dc:creator>
            <pubDate>Mon, 23 Nov 2020 13:21:31 GMT</pubDate>
            <atom:updated>2020-12-03T16:25:02.470Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4r7FdxrwLcycLwFF215YlA.jpeg" /></figure><p>CI/CD is vital to any project. It enables developers to spend more time adding new features to a project and less time worrying about how to implement those features into the main version of the code. However, CI/CD pipelines vary depending on the type of project in development.</p><p>In this article, I’ll walk through how we built reusable CI/CD pipelines for PyPi projects with GitLab CI. This article assumes that you have some knowledge of <a href="https://docs.docker.com/">Docker</a>, <a href="https://docs.gitlab.com/ee/ci/introduction/">CI/CD</a>, and <a href="https://git-scm.com/doc">Git</a>.</p><h4>What is PyPi?</h4><p><a href="https://pypi.org/">PyPi</a> or Python Package Index is a repository of publicly available Python libraries that can be downloaded via <a href="https://pip.pypa.io/en/stable/">pip</a>. Commonly used Python libraries downloaded from PyPi include Pandas, Numpy, Pytest, etc.</p><h4>What is GitLab?</h4><p><a href="https://gitlab.com/gitlab-com">GitLab</a> is primarily a web-based version control tool that provides many additional features, including CI/CD support and a Docker registry.</p><h4>CI/CD in GitLab</h4><p>The only requirements to implement GitLab CI/CD with a project are:</p><ol><li>A project hosted in a Git repository. As long as the project has version control configured, you can set up your CI/CD in GitLab.</li><li>A .gitlab-ci.yml file at the root of your project directory. There can only be one file called .gitlab-ci.yml in a project. .gitlab-ci.yml contains the project-specific test and deployment scripts that you need in your pipeline. An individual script used in a .gitlab-ci.yml is called a <strong>job</strong>. There can be multiple jobs in a CI/CD pipeline.</li></ol><p>3. A runner configured in GitLab. A GitLab runner is a VM instance that runs the jobs in .gitlab-ci.yml.</p><h4>Reusable Pipelines</h4><p>GitLab CI allows developers to use external YAML configuration files in their own project’s .gitlab-ci.yml. The way to do this is with an include keyword in .gitlab-ci.yml. This feature allows projects to use multiple external and/or local YAML files in their own YAML configuration.</p><p>I plan to implement this feature. I will build a pipeline in two separate repositories, then any developer who wants to implement pipelines in their PyPi project can do so by adding an include command in their project’s .gitlab-ci.yml.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cddc2b667a7b53a6451091258ef7c7e6/href">https://medium.com/media/cddc2b667a7b53a6451091258ef7c7e6/href</a></iframe><p>In the above example, a repository contains a PyPi project that has a .gitlab-ci.yml file at the root. Instead of making a custom CI/CD pipeline, this project utilizes a CI/CD pipelines from two external repositories. The first pipeline contains a Docker build job that creates a Docker image. The second pipeline runs the project’s tests and deploys the project’s Python library to PyPi. These external repository CI/CD pipelines can be used for any PyPi project.</p><p>I have a PyPi project configured to use external CI/CD pipelines. It’s now time to create the external CI/CD pipelines.</p><h4>Creating the Docker Build Pipeline</h4><p>This pipeline will contain a build job that creates a Docker image.<strong> </strong>Every repository in GitLab comes with a private <a href="https://docs.gitlab.com/ee/user/packages/container_registry/">Docker container registry</a>. This is where the user’s custom Docker image will be stored. This build job will create the Docker image used in the second pipeline to run tests and deploy the project’s PyPi package.</p><p>In order to use the Docker build job, the user needs a Dockerfile at the root of their PyPi project.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0584a7291df7c73a0edd01848d443d47/href">https://medium.com/media/0584a7291df7c73a0edd01848d443d47/href</a></iframe><p>This sample Dockerfile has a run command that installs all dependencies from a project’s requirements.txt. It also includes a command that installs the additional dependencies that are required in the PyPi pipeline.</p><p>With this Dockerfile, a user can now run the job that builds a Docker image.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dd78e93e9f5f74717ef1a6cff2b403a1/href">https://medium.com/media/dd78e93e9f5f74717ef1a6cff2b403a1/href</a></iframe><p>This job builds a Docker image and pushes the image to the GitLab CI Docker container registry. Notice the rules — changes keywords at the bottom of the file. This rule ensures that the Docker build job only runs when there are changes to the Dockerfile or requirements.txt of the user’s project. The stage of the job is defined as .pre. The .pre stage ensures that when this job is triggered, it is the first job to run in any workflow.</p><p>There is also an important IMAGE_TAG variable that is used as the name of the created Docker image. The $CI_REGISTRY_IMAGE is a predefined environment variable in GitLab CI. The value of the variable is the path to the project repository.</p><p>This job creates a Docker image with the following naming convention: &lt;path/to/your/project&gt;:latest</p><p>&lt;path/to/your/project&gt; comes from the predefined $CI_REGISTRY_IMAGE environment variable.</p><p>Now, all a user has to do is implement this job into their .gitlab-ci.yml. With the Docker build job ready to go, it’s time to create a pipeline that runs tests and deploys a PyPi package.</p><h4>The PyPi CI/CD Pipeline</h4><p>I want the following jobs to run when the PyPi CI/CD pipeline is triggered:</p><ul><li><strong>Unit Tests</strong></li><li><strong>Static Code Analysis</strong><br> A. Lint Testing<br> B. Security Testing<br> C. Documentation Testing</li></ul><p>Testing is a critical component of continuous integration in any project. Any time a feature branch is merged into the master branch, there is always a chance that the new updates will break the existing code. To ensure the new features won’t break the master branch, I am going to include both unit test and static code analysis jobs in my CI/CD pipeline. I want these tests to run every time someone commits code to any branch or if a merge request is opened.</p><ul><li><strong>Dev PyPi Deploy Package</strong></li><li><strong>Prod PyPi Deploy Package</strong></li></ul><p>These last two jobs are specific to my PyPi package pipeline. After the test jobs run and pass, these jobs will execute and deploy the project’s PyPi package depending on the context of the commit or merge request.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e528567fe0d404e5f26bbca14c1f32f8/href">https://medium.com/media/e528567fe0d404e5f26bbca14c1f32f8/href</a></iframe><p>The above pypi-pipeline.gitlab-ci.yml file is comprised of multiple jobs. Each individual job completes one task.</p><p>Notice that every job has four keywords:</p><ol><li>stage: defines the when in the workflow the job runs</li><li>image: defines the Docker image to use</li><li>script: the shell script that is executed</li><li>rules: determine if the job is run</li></ol><p>The stages keyword is at the top of the file. It defines workflow of the jobs. In this YAML, the unittest stage runs first. The unittest stage is configured to run the unittest job. If the unittest job fails, the pipeline fails and no further stages in the workflow are run. However, if the unittest job passes, the coverage_test stage runs the coverage_test job. This workflow runs until all jobs pass or one job fails.</p><p>This YAML file only scratches the surface of what is possible with GitLab CI. Check out the <a href="https://docs.gitlab.com/ee/ci/yaml/">GitLab CI Docs</a> for more examples and keywords.</p><h4>The main features in this PyPi specific pipeline:</h4><p>The pipeline uses the custom Docker image that is built in the separate Docker build pipeline. This Docker image comes preinstalled with the necessary dependencies. If the jobs in this pipeline used a base Python Docker image, dependencies would have to be installed for each job. This would significantly increase the time it takes for the pipeline to run. Because the jobs use a custom Docker image with the dependencies already installed, the jobs don’t need to be configured to install the project dependencies.</p><p>The pipeline jobs have rules attached to them. This ensures that jobs are not run every time the pipeline triggers. Instead, there are specific rules attached to each job that triggers the job to run.</p><p>The test jobs run anytime there is a commit or merge request regardless of the branches involved. The $CI_COMMIT_BRANCH and $CI_MERGE_REQUEST predefined environment variables ensure this happens.</p><p>The dev_deploy job only runs when there is an open merge request. This dev version of the pypi package is completely separate from and in no way impacts the prod version.</p><p>The prod_deploy job only runs when there is a commit to the master branch. I have this rule in place because users will only want to deploy PyPi packages that are ready for public use.</p><p>Now that the pipeline is complete, it’s time to use it in a PyPi project.</p><p><strong>Using the Pipelines in the Dataframez Project</strong></p><p>I showed this .gitlab-ci.yml configuration file above. This is the .gitlab-ci.yml for the dataframez project. Dataframez is an extension to the Pandas library and is deployed to PyPi. The dataframez project is a perfect fit for the pipelines I created.</p><p>For the external PyPi pipeline to work, dataframez needs:</p><ul><li>requirements.txt</li><li>Dockerfile (this can be a copy of the one I created earlier)</li><li>a .gitlab-ci.yml that uses include statements in order to run the external pipelines</li><li>The project needs to be configured to use a GitLab runner</li><li>Project environment variables configured to connect to PyPi via twine</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0584a7291df7c73a0edd01848d443d47/href">https://medium.com/media/0584a7291df7c73a0edd01848d443d47/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b35f0fbf988daf33010cfd1e3ba3ee56/href">https://medium.com/media/b35f0fbf988daf33010cfd1e3ba3ee56/href</a></iframe><p>The above files are placed at the root of the project.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cddc2b667a7b53a6451091258ef7c7e6/href">https://medium.com/media/cddc2b667a7b53a6451091258ef7c7e6/href</a></iframe><p>This .gitlab-ci.yml uses two includes YAML files from two repositories.</p><p>The first is the Docker build YAML that builds a Docker image from the dataframez project’s Dockerfile.</p><p>The second is the PyPi pipeline that runs the dataframez unit tests and static code analysis tests. It then deploys the dataframez package to PyPi if the rules are met (a commit to the master branch).</p><p>The dataframez .gitlab-ci.yml combines the two external pipelines into one. Notice that this file defines a variable called IMAGE_NAME which equals $CI_REGISTRY_IMAGE. The Docker build job uses $CI_REGISTRY_IMAGEto name the created Docker image.</p><p>IMAGE_NAME is used in the PyPi pipeline as the Docker image that runs the jobs in the workflow. The workflow of the pipeline is configured so the Docker build job runs first if the Dockerfile or requirements.txt are updated. This ensures that the PyPi pipeline is always using the most updated Docker image.</p><p>Now when any branch in the dataframez project is committed to, the CI/CD pipeline will get triggered to run.</p><h3>Closing Thoughts</h3><p>While this PyPi pipeline is just one of many reusable pipelines that can be created for nearly any type of project, the baseline process of how to build reusable pipelines is relatively similar. GitLab CI holds many more avenues to explore. Hopefully, I was able to give you a solid overview of how CI/CD pipelines work in GitLab.</p><h3>Ready to accelerate your digital transformation?</h3><p>At Hashmap, we work with our clients to build better, together.</p><p>If you’d like additional assistance in this area, <a href="https://www.hashmapinc.com/solutionconsulting"><strong>Hashmap</strong></a> offers a range of enablement workshops and consulting service packages as part of our consulting service offerings, and would be glad to work through your specifics in this area.</p><p><em>Feel free to share on other channels and be sure and keep up with all new content from Hashmap </em><a href="http://hashmapinc.com/"><strong><em>here</em></strong></a><em>. To listen in on a casual conversation about all things data engineering and the cloud, check out Hashmap’s podcast </em><a href="https://www.hashmapinc.com/hashmapontap"><strong><em>Hashmap on Tap</em></strong></a><strong><em> </em></strong><em>as well on Spotify, Apple, Google, and other popular streaming apps.</em></p><p><a href="https://www.hashmapinc.com/hashmapontap">Hashmap on Tap | Hashmap Podcast</a></p><h3>Other Tools and Content You Might Like</h3><ul><li><a href="https://medium.com/hashmapinc/how-we-automated-snowflake-data-profiler-cfe93ea5703c">How We Automated Snowflake Data Profiler</a></li><li><a href="https://medium.com/hashmapinc/5-steps-to-converting-python-jobs-to-pyspark-4b9988ad027a">5 Steps to Converting Python Jobs to PySpark</a></li><li><a href="https://www.hashmapinc.com/snowflake-utilities-accelerators">Snowflake Utilities &amp; Accelerators | Do more with Snowflake | Hashmap</a></li><li><a href="https://www.hashmapinc.com/megabytes">Hashmap Megabytes | Bite-Size Video Series</a></li></ul><p><a href="http://www.linkedin.com/in/samuel-kohlleffel"><strong><em>Sam Kohlleffel</em></strong></a><strong><em> </em></strong><em>is in Hashmap’s RTE Internship program developing data and cloud applications and is also a student at Texas A&amp;M University studying Economics, Math, and Statistics.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c898de30b1e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hashmapinc/creating-reusable-ci-cd-pipelines-with-gitlab-4c898de30b1e">Creating Reusable CI/CD Pipelines with GitLab</a> was originally published in <a href="https://medium.com/hashmapinc">Hashmap, an NTT DATA Company</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating a React App Hosted on AWS S3 (Part 3): Snowflake Healthcheck]]></title>
            <link>https://medium.com/hashmapinc/automating-a-react-app-hosted-on-aws-s3-part-3-snowflake-healthcheck-2037d4475892?source=rss-886c759dd690------2</link>
            <guid isPermaLink="false">https://medium.com/p/2037d4475892</guid>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Sam Kohlleffel]]></dc:creator>
            <pubDate>Fri, 09 Oct 2020 13:17:13 GMT</pubDate>
            <atom:updated>2020-11-06T13:17:06.042Z</atom:updated>
            <content:encoded><![CDATA[<h4>Automating a React app with CircleCI and GitHub</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FeHvc4iump3_H6WgHVgY8w.jpeg" /></figure><h3>Introduction to Part 3 of the Series</h3><p>This is the final article in a three-part series. In this demo, I will automate a React app that is hosted on S3 with GitHub and CircleCI. <a href="https://reactjs.org/docs/getting-started.html">React</a> is an amazing tool that developers use to build interactive and component-based user interfaces. <a href="https://circleci.com/docs/">CircleCI</a> is a CI/CD tool that enables project automation. If you choose to follow along, you will have an automated, working React app hosted on S3 by the end of this demonstration.</p><p>If you missed the first part of the series where I demonstrate how to set up an S3 bucket and IAM user on AWS, be sure to check it out <a href="https://medium.com/hashmapinc/automating-a-react-app-hosted-on-aws-s3-snowflake-healthcheck-e3fd0feb9f05">here</a>. The React app we are automating today is the same app we created and hosted on S3 in part 2. If you haven’t done so, feel free to <a href="https://medium.com/hashmapinc/automating-a-react-app-hosted-on-aws-s3-part-2-snowflake-healthcheck-8dfbdc74d33d">read part 2</a> of the series so you can follow along.</p><p>I’ve also been highlighting certain aspects of <a href="http://snowflake.com/">Snowflake</a> that merit consideration if you are considering a cloud data platform. We focus on building Snowflake utilities because the ratio of requests that we get to implement Snowflake for customers versus all other cloud data platforms is over 6:1 — the data speaks for itself.</p><p>Here are my final three aspects to consider that I believe set Snowflake apart from other platforms:</p><ol><li>Snowflake’s autosuspend and autoresume allow you to avoid a great deal of manual effort and control costs at the same time.</li><li>Snowflake enables you to dynamically switch compute on the fly.</li><li>Snowflake’s UI is intuitive and easy to pick up and become productive with quickly.</li></ol><p>During this series, I’ve been building the basic automation framework we are using to develop<a href="https://www.hashmapinc.com/snowflakehealthcheck?utm_campaign=Snowflake%20Healthcheck&amp;utm_content=144381210&amp;utm_medium=social&amp;utm_source=linkedin&amp;hss_channel=lcp-6823448"> Snowflake Healthcheck</a>. <strong>Healthcheck is the latest Snowflake utility in development at Hashmap to help users measure and improve the health of their Snowflake environment. </strong>However, this series is not specific to<a href="https://www.hashmapinc.com/snowflakehealthcheck?utm_campaign=Snowflake%20Healthcheck&amp;utm_content=144381210&amp;utm_medium=social&amp;utm_source=linkedin&amp;hss_channel=lcp-6823448"> Snowflake Healthcheck</a> and the concepts learned here can be applied to any React app hosted on S3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZcI7QdOCxCsNRXudggjQuw.png" /><figcaption>React App Hosted on S3</figcaption></figure><p>If you have been following along, you should have a working React app deployed on an S3 bucket that looks similar to the above screenshot. The app works correctly and we can manually update the app on S3 by repeating the process we used in <a href="https://medium.com/hashmapinc/automating-a-react-app-hosted-on-aws-s3-part-2-snowflake-healthcheck-8dfbdc74d33d">part 2</a>.</p><p>However, this process is error-prone and inefficient. Wouldn’t it be great if there was a way to update our deployed application with a simple git push? This is where CircleCI and automation come into play.</p><h3>Automate a React App Using CircleCI</h3><p>Let’s work on automating the deployment of the app. Before tackling automation with CircleCI, we need to link our React project to a remote GitHub repository. Here is the <a href="https://docs.github.com/en/free-pro-team@latest/github/importing-your-projects-to-github/adding-an-existing-project-to-github-using-the-command-line">tutorial</a> I used.</p><p>Now that you have linked your project with a GitHub repo, let’s automate the app. First, create a free <a href="https://circleci.com/signup/">CircleCI</a> account. Then, navigate to <strong>Pipelines </strong>and add a project. As you can see, I have all of my personal GitHub repositories listed. The <strong>snowflake-healthcheck </strong>repository isn’t listed because it is owned by Hashmap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yUtW7glKS139WBZTS57BCw.png" /><figcaption>GitHub Repositories Listed in CircleCI</figcaption></figure><p><strong>Set Up Project </strong>on the desired repo and <strong>Add Config</strong>. This will commit a config.yml file to the chosen repo on a branch called <strong>circleci-project-setup.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RsOrglg6hxTOqgZt4If-IA.png" /><figcaption>circleci-project-setup Branch with .circleci Folder in Git Repo</figcaption></figure><p>On this branch, CircleCI pulls the code from master and adds a .circleci directory to the project. Inside the directory is the config.yml file. This is where we will configure our automation for the React app.</p><p>To get this remote branch on your terminal, you need to checkout a new local branch and pull the code from the remote branch into the local branch.</p><ol><li>Create and checkout a new local branch: git checkout -b react-automation</li><li>Pull the code from the remote branch: git pull origin circleci-project-setup</li></ol><p>Now you should have the config.yml file in your local branch. Please note that I create and checkout a branch called “<strong>react-automation</strong>”. Name your branch anything you like.</p><h4><strong>Setting Up the Config File</strong></h4><p>You should see the .circleci folder inside the root of your project. It’s time to automate our React app!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dfefed46ba20f841eae700e6fdd73cc3/href">https://medium.com/media/dfefed46ba20f841eae700e6fdd73cc3/href</a></iframe><p>Copy the above code and paste it into your config.yml file. Change both occurrences of &lt;your_React_app_directory&gt; to the relative path of the directory that contains your React app files. Also, change &lt;your_S3_bucket&gt; to your S3 bucket name.</p><p><strong>Important: </strong>Notice the last three lines of code in config.yml that are commented out. In normal circumstances, I would uncomment those lines of code. If they are uncommented, the <strong>deploy_react</strong> job will <strong>only</strong> run when I change is made to the <strong>master branch </strong>of the git repo. In the file’s current state, the job runs every time I commit and push from any branch in the git repo. This means that the S3 bucket will update anytime there is a git push. For a real project, it is best practice to only update the files in the S3 bucket when the <strong>master</strong> branch is changed. Therefore, after you are done testing the automation for your project, you should uncomment the last three lines of code so the app updates in S3 only when <strong>master</strong> is changed.</p><p>Before diving into the specifics of the above config file, I will briefly cover how config.yml files are used in CircleCI. There are two major concepts to understand: jobs and workflows.</p><p>Every job contains steps. These steps serve as instructions for the job. There can be multiple steps defined in one job. A workflow assigns which jobs to run when it is triggered. A workflow is triggered when there is a git push from a local branch to the remote branch.</p><p>My config.yml is simple. I have one job and one workflow. The <strong>deploy_react </strong>job contains three steps and runs on a Nodejs Docker image that is provided by CircleCI. This image comes pre-installed with node 14.11.0.</p><p>The <strong>first step</strong> runs checkout. This command checks out the current version of the code in my working git branch.</p><p>The <strong>second step </strong>installs the dependencies that are required to upload the React app to AWS S3. Let’s go through the major commands.</p><p>npm install:</p><blockquote>Installs the node dependencies from package.json</blockquote><p>sudo apt-get update &amp;&amp; sudo apt-get install -y python-dev:</p><blockquote>Installs python</blockquote><p>sudo curl -O <a href="https://bootstrap.pypa.io/get-pip.py">https://bootstrap.pypa.io/get-pip.py</a>:</p><blockquote>Gets a zip file that contains a copy of pip</blockquote><p>sudo python get-pip.py:</p><blockquote>Installs pip</blockquote><p>sudo pip install awscli — upgrade:</p><blockquote>Installs the AWS CLI</blockquote><p>The <strong>final step</strong> builds the static files of the React app and deploys those static files to my AWS S3 bucket.</p><p>npm run build:</p><blockquote>Packages the static React files up for production</blockquote><p>aws s3 sync build/ s3://&lt;your_S3_bucket&gt; --delete:</p><blockquote>Syncs the files in the S3 bucket with the files in the <strong>build</strong> directory</blockquote><p>The <strong>deploy_react </strong>job completes all of the tasks that we manually performed in part 2 of the series. It packages up the React app and deploys it to an S3 bucket. This job is called in my <strong>build_and_deploy </strong>workflow.</p><h4>CircleCI Environment Variables</h4><p><strong>Important: </strong>Notice that there is no step that runs aws configure</p><p>How does CircleCI connect to my AWS account? The answer is <a href="https://circleci.com/docs/2.0/env-vars/">environment variables</a>.</p><p>Environment variables in CircleCI allow developers to securely add important variables to a config.yml file. Let’s set up a few environment variables for our project. In CircleCI, navigate to <strong>Project &gt; Your-Project &gt; Project Settings &gt;Environment Variables. </strong>Your screen should look similar to this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u2OKeMSxBD6zfCqNbvMjhw.png" /><figcaption>My CircleCI Environment Variables for Snowflake Healthcheck</figcaption></figure><p>To create a new environment variable, <strong>Add Variable</strong>. Then, enter a variable <strong>Name</strong> and <strong>Value</strong>. Please note that all characters of an environment variable <strong>Name</strong> must be uppercase. I make two environment variables for this project.</p><ol><li><strong>AWS_ACCESS_KEY_ID</strong></li><li><strong>AWS_SECRET_ACCESS_KEY</strong></li></ol><p>Both <strong>AWS_ACCESS_KEY_ID </strong>and <strong>AWS_SECRET_ACCESS_KEY</strong> can be found in the <strong>new_user_credentials.csv </strong>that you created in part 1 of the series. Enter those values found in the <strong>new_user_credentials.csv</strong> as the <strong>Values</strong> for your variables in CircleCI.</p><p>Including <strong>AWS_ACCESS_KEY_ID </strong>and <strong>AWS_SECRET_ACCESS_KEY </strong>as environment variables automatically configures AWS for us. We do not have to worry about running aws configure as we did in part 2. Make sure to name the above two variables <strong>exactly</strong> as I did. The AWS CLI looks for specific, CircleCI provided variable names to connect with AWS.</p><p>If I had included these important variables in my config.yml file, anyone could access my AWS account just by looking at the file on the GitHub repository. This would have been a security issue.</p><h4>Testing the Automation</h4><p>Now that we have configured our config file, it’s time to see if our automation actually works. Before we do this, change the &lt;p&gt; in App.js from <strong>“Edit src/App.js and save to reload”</strong> to <strong>“Testing Automation”</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WLA63ySuEqL0KxvL3F2Xvw.png" /><figcaption>App.js with New Text</figcaption></figure><p>This is not a functional change, but it ensures our automation actually adds the new React files to the S3 bucket and deletes the old files.</p><p>Let’s commit and push this change to our remote branch and see if it updates our React app in S3. You can watch the progress in the CircleCI console by going to the project’s <strong>Pipelines. </strong>To see the files updated in S3, navigate back to the <strong>Static Website Hosting </strong>endpoint URL in the S3 bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4VY58tD3d--ACkHkBIeHMg.png" /><figcaption>Our Automated React App</figcaption></figure><h3>Congratulations!</h3><p>You have successfully automated your React app. You can now make changes locally on your machine and push those changes to your GitHub branch to automatically update your React app in your S3 bucket.</p><p>This is the automation framework for Snowflake Healthcheck by Hashmap. It is currently in development, but I’ll be sure to update this article when it is released so you can check it out!</p><h3>Ready to accelerate your digital transformation?</h3><p>At Hashmap, we work with our clients to build better, together.</p><p>If you’d like additional assistance in this area, <a href="http://hashmapinc.com/snowflake"><strong>Hashmap</strong></a> offers a range of enablement workshops and consulting service packages as part of our consulting service offerings, and would be glad to work through your specifics in this area.</p><p>How does Snowflake compare to other data platforms? Our technical experts have implemented over 250 cloud/data projects in the last 3 years and conducted unbiased, detailed analyses across 34 business and technical dimensions, <a href="https://www.hashmapinc.com/snowflake-benchmarking">ranking each cloud data platform.</a></p><p><a href="https://www.hashmapinc.com/snowflake-benchmarking">2021 Cloud Data Platform Benchmark Analysis</a></p><p><em>Feel free to share on other channels and be sure and keep up with all new content from Hashmap </em><a href="http://hashmapinc.com/"><strong><em>here</em></strong></a><em>. To listen in on a casual conversation about all things data engineering and the cloud, check out Hashmap’s podcast </em><a href="https://www.hashmapinc.com/hashmapontap"><strong><em>Hashmap on Tap</em></strong></a><strong><em> </em></strong><em>as well on Spotify, Apple, Google, and other popular streaming apps.</em></p><p><a href="https://www.hashmapinc.com/hashmapontap">Hashmap on Tap | Hashmap Podcast</a></p><h3>Other Tools and Content You Might Like</h3><ul><li><a href="https://www.hashmapinc.com/snowflakeinspector">Snowflake Inspector | Interactive Visual Exploration of Snowflake | Hashmap</a></li><li><a href="https://www.hashmapinc.com/megabytes">Hashmap Megabytes | Bite-Size Video Series</a></li><li><a href="https://www.hashmapinc.com/snowflakedataprofiler">Snowflake Data Profiler | Statistical DQ Analysis for Snowflake | Hashmap</a></li><li><a href="https://medium.com/hashmapinc/supercharge-your-snowflake-billing-statement-with-user-metrics-ad5720f7ea95">Supercharge Your Snowflake Billing Statement with User Metrics</a></li></ul><p><a href="http://www.linkedin.com/in/samuel-kohlleffel"><strong><em>Sam Kohlleffel</em></strong></a><strong><em> </em></strong><em>is in Hashmap’s RTE Internship program developing data and cloud applications and is also a student at Texas A&amp;M University studying Economics, Math, and Statistics.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2037d4475892" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hashmapinc/automating-a-react-app-hosted-on-aws-s3-part-3-snowflake-healthcheck-2037d4475892">Automating a React App Hosted on AWS S3 (Part 3): Snowflake Healthcheck</a> was originally published in <a href="https://medium.com/hashmapinc">Hashmap, an NTT DATA Company</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating a React App Hosted on AWS S3 (Part 2): Snowflake Healthcheck]]></title>
            <link>https://medium.com/hashmapinc/automating-a-react-app-hosted-on-aws-s3-part-2-snowflake-healthcheck-8dfbdc74d33d?source=rss-886c759dd690------2</link>
            <guid isPermaLink="false">https://medium.com/p/8dfbdc74d33d</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[snowflake-healthcheck]]></category>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Sam Kohlleffel]]></dc:creator>
            <pubDate>Thu, 08 Oct 2020 13:28:07 GMT</pubDate>
            <atom:updated>2020-11-06T12:52:18.837Z</atom:updated>
            <content:encoded><![CDATA[<h4>Building and Hosting a React App with an S3 Bucket</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y-CbjTZsF1vc51uuJkMGIg.jpeg" /></figure><h3>Introduction to Part 2 of the Series</h3><p>This is the second article in a three-part series. If you missed the first part of the series where I demonstrate how to set up an S3 bucket and IAM user on AWS, be sure to check it out <a href="https://medium.com/hashmapinc/automating-a-react-app-hosted-on-aws-s3-snowflake-healthcheck-e3fd0feb9f05">here</a>. In this demo, I will walk through the process of how to set up a sample React App and host that app using an AWS S3 Bucket.</p><p><a href="https://reactjs.org/docs/getting-started.html">React</a> is an amazing tool developers use to build interactive and component-based user interfaces. If you choose to follow along, you will have an automated, working React app hosted on S3 by the end of this demonstration.</p><p>During this series, I will be building the basic automation framework we are using to develop <a href="https://www.hashmapinc.com/snowflakehealthcheck?utm_campaign=Snowflake%20Healthcheck&amp;utm_content=144381210&amp;utm_medium=social&amp;utm_source=linkedin&amp;hss_channel=lcp-6823448">Snowflake Healthcheck</a>. <strong>Healthcheck is the latest Snowflake utility in development at Hashmap to help users measure and improve the health of their Snowflake environment. </strong>However, this series is not specific to <a href="https://www.hashmapinc.com/snowflakehealthcheck?utm_campaign=Snowflake%20Healthcheck&amp;utm_content=144381210&amp;utm_medium=social&amp;utm_source=linkedin&amp;hss_channel=lcp-6823448">Snowflake Healthcheck</a> and the concepts learned here can be applied to any React app hosted on S3.</p><p>Before we get to building the app, if you are considering a cloud data platform in AWS, Azure, or GCP, we highly recommend taking a hard look at <a href="http://snowflake.com/">Snowflake</a>. We’ve implemented more than 65 Snowflake projects since 2018 and one of our customers (the lead data scientist on the analytics team) said it best: “What we were able to do with Snowflake in just 2 days, can take up to 2 months in our current Hadoop platform”.</p><p>Below are three more aspects to consider that I believe set Snowflake apart from other platforms:</p><ol><li>Snowflake is cloud-native and brings no legacy baggage to the table.</li><li>Snowflake really is SQL, but there is also a range of connectors available for other tools such as Python, Kafka, Spark, etc.</li><li>Every virtual warehouse operates off the same copy of data.</li></ol><p>Alright, let’s get rolling with React and Snowflake Healthcheck.</p><h3>Building a React App</h3><p>To start, we need to build a working React app locally in the terminal. This step is very simple. First, we need to install npm. Npm is the package manager for javascript. Let’s use <a href="https://brew.sh/">Homebrew</a> to install npm.</p><p>Once homebrew is installed, run brew install node. This installs the stable release of Nodejs and npm on your machine.</p><p>Now, we’re ready to create the React app. To initiate the app for Snowflake Healthcheck, I run npx create-react-app snowflake_healthcheck in the terminal.</p><p>The command for creating a React app is broken down as follows: npx create-react-app &lt;app name&gt; where &lt;app name&gt; is the directory in which the React app files will be located. After I run the above command, my app files are located in the <strong>snowflake_healthcheck</strong> directory. You can name your app anything you like. Just keep in mind that every character in your &lt;app name&gt; must be lowercase.</p><p>To test that the app is working, I am going to cd into the <strong>snowflake_healthcheck</strong> directory and run npm start in the terminal. This command will take me to the React app webpage. It looks like everything is working correctly:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NJVoVjN7v835Mnr-twkWdw.png" /><figcaption>React App Webpage</figcaption></figure><h3>Host React App on S3 Bucket</h3><p>Before we can host the React app, we need to install the <strong>AWS CLI</strong> tool. This tool allows you to interact with your AWS account from the local terminal. To install this tool easily, it is recommended to have <a href="https://www.python.org/downloads/">python</a> installed. Once python is installed, run pip install awscli. After you have the CLI tool, run aws s3 ls to confirm the installation. If it installs correctly, you should get an AWS error.</p><p>The tool is installed, but you still need to configure your AWS IAM account that you made earlier.</p><p>To do this, run aws configure. You will be asked to enter your <strong>AWS Access Key ID. </strong>To find the Access Key, you need to open <strong>new_user_credentials.csv</strong> and copy the <strong>Access Key ID </strong>value then paste it into the terminal. You will then be asked to enter your <strong>AWS Secret Key ID</strong>. This can once again be found in the .csv file. For the <strong>Default region name</strong>, enter your AWS region. My region is <strong>us-east-1</strong>. Leave the <strong>Default output format </strong>as blank.</p><p>To confirm everything was set up correctly, I run aws s3 ls again:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s-gtjhD_R27FoOoO8H75Kg.png" /><figcaption>My S3 Buckets as Listed in the Terminal</figcaption></figure><p>As you can see, this command lists my S3 buckets including the <strong>react-test-healthcheck </strong>bucket that I created in the AWS Console earlier.</p><p>Now that you have the AWS CLI installed, cd into the directory containing the React app. Then, run npm run build. This command creates a <strong>build </strong>directory and uses that directory to package the app up for production. The <strong>build </strong>directory contains all of the js, HTML, and CSS files that are needed to power the React app.</p><p>Once the app is packaged up, run:</p><p>aws s3 sync build/ s3://&lt;bucket name&gt; --delete</p><p>Specifically, I run:</p><p>aws s3 sync build/ s3://react-test-healthcheck --delete</p><p>This command synchronizes the files in the <strong>build </strong>directory with the files in the <strong>react-test-healthcheck </strong>bucket<strong>. </strong>The --delete tag ensures that the S3 bucket deletes any files that do not match the files in the <strong>build</strong> directory.</p><p>Time to see if the app deployed to S3 correctly. Sign in to the AWS Console and navigate to the S3 bucket containing our app. Once inside the S3 bucket, click on <strong>Properties</strong> then <strong>Static Website Hosting.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3BjtHHqF7ptlL1tj3-Ty0A.png" /><figcaption>S3 Bucket Endpoint Link</figcaption></figure><p>Let’s click on the <strong>Endpoint </strong>URL and see what we get! <br><strong>Optional: </strong>Notice that while the React app works it isn’t HTTPS secured. If you need to secure your React app connection, you can follow this <a href="https://support.cloudflare.com/hc/en-us/articles/360037983412-Configuring-an-Amazon-Web-Services-static-site-to-use-Cloudflare">Cloudflare tutorial</a>. Please note that Cloudflare is the DNS provider we use. If you choose to use a different DNS provider, steps to achieve HTTPS may vary slightly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EW1cQ4GS9qCnt23tWFa2Zw.png" /><figcaption>React App Webpage Hosted on Our S3 Bucket</figcaption></figure><h3>Closing Thoughts</h3><p>We now have a React app with a public-facing endpoint. This is a major accomplishment, but what if there was a way to automatically update the app when I make a change? Stay tuned for the <a href="https://medium.com/hashmapinc/automating-a-react-app-hosted-on-aws-s3-part-3-snowflake-healthcheck-2037d4475892">final part</a> of the series where I show you how to automate the S3 hosted React app with <a href="https://circleci.com/docs/">CircleCI</a> and GitHub:</p><p><a href="https://medium.com/hashmapinc/automating-a-react-app-hosted-on-aws-s3-part-3-snowflake-healthcheck-2037d4475892">Automating a React App Hosted on AWS S3 (Part 3): Snowflake Healthcheck</a></p><h3>Ready to accelerate your digital transformation?</h3><p>At Hashmap, we work with our clients to build better, together.</p><p>If you’d like additional assistance in this area, <a href="http://hashmapinc.com/snowflake"><strong>Hashmap</strong></a> offers a range of enablement workshops and consulting service packages as part of our consulting service offerings, and would be glad to work through your specifics in this area.</p><p>How does Snowflake compare to other data platforms? Our technical experts have implemented over 250 cloud/data projects in the last 3 years and conducted unbiased, detailed analyses across 34 business and technical dimensions, <a href="https://www.hashmapinc.com/snowflake-benchmarking">ranking each cloud data platform.</a></p><p><a href="https://www.hashmapinc.com/snowflake-benchmarking">2021 Cloud Data Platform Benchmark Analysis</a></p><p><em>Feel free to share on other channels and be sure and keep up with all new content from Hashmap </em><a href="http://hashmapinc.com/"><strong><em>here</em></strong></a><em>. To listen in on a casual conversation about all things data engineering and the cloud, check out Hashmap’s podcast </em><a href="https://www.hashmapinc.com/hashmapontap"><strong><em>Hashmap on Tap</em></strong></a><strong><em> </em></strong><em>as well on Spotify, Apple, Google, and other popular streaming apps.</em></p><p><a href="https://www.hashmapinc.com/hashmapontap">Hashmap on Tap | Hashmap Podcast</a></p><h3>Other Tools and Content You Might Like</h3><ul><li><a href="https://www.hashmapinc.com/snowflakedataprofiler">Snowflake Data Profiler | Statistical DQ Analysis for Snowflake | Hashmap</a></li><li><a href="https://www.hashmapinc.com/snowflakeinspector">Snowflake Inspector | Interactive Visual Exploration of Snowflake | Hashmap</a></li><li><a href="https://medium.com/hashmapinc/how-we-automated-snowflake-data-profiler-cfe93ea5703c">How We Automated Snowflake Data Profiler</a></li><li><a href="https://www.hashmapinc.com/megabytes">Hashmap Megabytes | Bite-Size Video Series</a></li></ul><p><a href="http://www.linkedin.com/in/samuel-kohlleffel"><strong><em>Sam Kohlleffel</em></strong></a><strong><em> </em></strong><em>is in Hashmap’s RTE Internship program developing data and cloud applications and is also a student at Texas A&amp;M University studying Economics, Math, and Statistics.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8dfbdc74d33d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hashmapinc/automating-a-react-app-hosted-on-aws-s3-part-2-snowflake-healthcheck-8dfbdc74d33d">Automating a React App Hosted on AWS S3 (Part 2): Snowflake Healthcheck</a> was originally published in <a href="https://medium.com/hashmapinc">Hashmap, an NTT DATA Company</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating a React App Hosted on AWS S3 — Snowflake Healthcheck]]></title>
            <link>https://medium.com/hashmapinc/automating-a-react-app-hosted-on-aws-s3-snowflake-healthcheck-e3fd0feb9f05?source=rss-886c759dd690------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3fd0feb9f05</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[snowflake-healthcheck]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Sam Kohlleffel]]></dc:creator>
            <pubDate>Tue, 06 Oct 2020 13:40:29 GMT</pubDate>
            <atom:updated>2020-11-06T12:35:10.918Z</atom:updated>
            <content:encoded><![CDATA[<h3>Automating a React App Hosted on AWS S3: Snowflake Healthcheck</h3><h4>Part 1: Setting up an IAM Account and S3 Bucket on AWS</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W8xfNnvuIF1hJD3kjJIWLw.jpeg" /></figure><h3>Introduction to the Series</h3><p>This is the first article in a three-part series that will walk through the process of how to set up a sample React App and host that app using an AWS S3 Bucket. Then, we’ll work through how to build automation for the app using CircleCI and GitHub.</p><p>During this series, I will be building the basic automation framework we are using to develop <a href="https://www.hashmapinc.com/snowflakehealthcheck?utm_campaign=Snowflake%20Healthcheck&amp;utm_content=144381210&amp;utm_medium=social&amp;utm_source=linkedin&amp;hss_channel=lcp-6823448">Snowflake Healthcheck</a>. <strong>Healthcheck is the latest Snowflake utility at Hashmap to help users measure and improve the health of their Snowflake environment.</strong></p><p>However, this series is not specific to <a href="https://healthcheck.snowflakeinspector.com/">Snowflake Healthcheck</a> and the concepts learned here can be applied to any React app hosted on S3.</p><p>If you haven’t taken <a href="http://snowflake.com/">Snowflake</a> for a test drive yet, I would encourage you to do that today. Also, with each article in this three-part series, I’ll quickly share three aspects to consider that I believe set Snowflake apart from other platforms:</p><ol><li>Snowflake speeds time to business impact and there is almost no infrastructure effort required, they take care of it for you.</li><li>Snowflake enables a modern data stack in the cloud with a very robust data integration and data consumption ecosystem that uses Snowflake’s virtual compute for everything from transformations to reporting and analytics.</li><li>Snowflake makes it quick and easy to get started with a <a href="https://signup.snowflake.com/">free 30-day trial that includes $400 in credits</a> and you’ll be up and running in minutes.</li></ol><h3>Getting Started with AWS</h3><p>Amazon Web Services (AWS) provides on-demand cloud computing platforms and APIs. I will use AWS to host the React application for this series. AWS has hundreds of services and resources but for the purposes of this tutorial, I will focus on two:</p><ol><li><strong>Identity Access and Management (IAM): </strong>allows users to securely manage their AWS services and resources.</li><li><strong>Simple Storage Service (S3): </strong>allows users to store objects in buckets that are scalable and secure.</li></ol><h3>Creating an IAM user in the AWS Console</h3><p>I set up a free AWS account prior to making this tutorial. If you want to follow along, set up a free <a href="https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/">AWS account</a>.</p><p>With the newly created root AWS account, let’s create an IAM user so we can securely manage AWS resources and services. It is best practice to create an IAM user to manage resources instead of using the root user.</p><p>Login to your root user account at <a href="https://aws.amazon.com/">aws.amazon.com</a>. Your page should look similar to this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0PXzrrwmMUwADeW_7nWKNA.png" /><figcaption>aws.amazon.com</figcaption></figure><p>Click the orange button in the top right that says <strong>Sign In to the Console</strong> and sign in as the root user. After signing in, your page should look similar to this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*URWK5Sy6_AgtLDDotZkIUg.png" /><figcaption>AWS Management Console</figcaption></figure><p>Next, click on the <strong>services</strong> tab in the top left, then go to <strong>IAM</strong> under <strong>Security, Identity, &amp; Compliance</strong>. This takes you to the <strong>IAM dashboard</strong>.</p><p>First, you should give your account an easy to remember alias. To do this, navigate to <strong>Dashboard </strong>on the left-hand side of the IAM console. Next, find where it says <strong>Sign-in URL for IAM users in this account </strong>and click <strong>customize</strong>. Try to give your IAM URL a simple alias. This makes signing into the AWS Console as an IAM user much easier to remember.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZOJCQmAsoFuOYvRKS4e81A.png" /><figcaption>IAM Dashboard</figcaption></figure><p>If you are following along, try to remember this account alias or write it down somewhere. You will need it later to sign in to your IAM user account.</p><p>Next, navigate to <strong>groups</strong> on the left-hand side under <strong>Access Management</strong> and click <strong>Create New Group</strong>. Give your group a name. I choose to call my group <strong>Administrators</strong> because I will be giving this group full access to AWS resources and services.</p><p>Now let’s attach a policy to the <strong>Administrators</strong> group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uDzBKpumL7vBeK5U--TNyA.png" /><figcaption>Group Policies</figcaption></figure><p>In the search bar, type “<strong>AdministratorAccess</strong>” and click the policy’s checkbox. Then, click through the next step and <strong>Create Group</strong>.</p><p>Now that you have an administrator group, go to the <strong>Users</strong> under <strong>Access Management</strong> on the left-hand side to create a new IAM user. Click <strong>Add user</strong>. Give your user both <strong>Programmatic</strong> and <strong>AWS Management Console</strong> access. You can leave the other options unchanged.</p><p>Move on to the user’s permissions page. You should see the group that you created earlier. Click the group’s checkbox to add the new user. This gives the user the permissions of that group. In our case, those are administrator permissions.</p><p>Next, click through until you get the option to <strong>Create User</strong>. After you create your new user, you should see this page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rTcYiVRBsP6s8NNva0-r1Q.png" /><figcaption>New User Successful Creation</figcaption></figure><p>Click on the <strong>Download.csv </strong>button. This .csv file contains the necessary credentials to sign in to the AWS Console as the IAM user you just created. Sign out of your root user account so you can set up your S3 bucket. We can now securely manage our AWS services with this IAM account!</p><h3>Setting up an S3 Bucket</h3><p>Now you’re ready to set up an S3 bucket to host the React app. First, open up your .csv file that contains your IAM user credentials. It should be named <strong>new_user_credentials.csv</strong>. Copy the Console login link and paste it into your browser:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r2Qawr2OJGvcMnkc9vcnoA.png" /><figcaption>IAM Sign In Page</figcaption></figure><p>Enter account alias (the one that you set up earlier), username, and password. Both username and password can be found in the .csv file.</p><p>After you sign in, find the <strong>services</strong> tab in the top left and navigate to <strong>S3</strong> which is located under <strong>Storage</strong>. Now, click <strong>Create bucket:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nUiKTMRTZEZ_yKusx4cV3A.png" /><figcaption>AWS S3</figcaption></figure><p>Enter a bucket name and region. I am going to call my bucket <strong>react-test-healthcheck</strong> and set the region to <strong>US East (N. Virginia)</strong>. Bucket names must be unique, so you will have to give yours a different name. This will be the bucket we will use to host our React App in part two of this series.</p><p>Click through <strong>Configure Options</strong>. For this tutorial, uncheck <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html"><strong>Block Public Access</strong></a><strong> </strong>when you reach <strong>Set Permissions</strong>. Finally, click <strong>next </strong>and <strong>Create Bucket</strong>. Click on your new S3 bucket and navigate to <strong>Permissions &gt;</strong> <strong>Bucket Policy:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/338adc557d8b3db734bef5505bd34bc8/href">https://medium.com/media/338adc557d8b3db734bef5505bd34bc8/href</a></iframe><p>Copy the above S3 policy, paste it to your <strong>Bucket policy editor</strong>, and save. Make sure to change where it says &lt;your s3 bucket name&gt; to the name you gave your bucket. This will give users access to the React webpage with <strong>Read-Only </strong>permissions. You can find more examples of S3 Policies <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html">here</a>. In general, be more specific with the bucket policies and permissions for real projects, but for the purpose of this tutorial, this policy will do. This is how your S3 <strong>Bucket Policy </strong>should look in the AWS Console:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s_WFHeildCYLoAL1HraLow.png" /><figcaption>Updated S3 Bucket Policy</figcaption></figure><p>Next, navigate to <strong>Properties &gt;</strong> <strong>Static Website Hosting </strong>and click <strong>Use this bucket to host a website</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WGfMJ9__5tzWIIC3WoZGSA.png" /><figcaption>S3 Static Website Hosting</figcaption></figure><p>This enables you to host your static React files on your S3 bucket. Under <strong>Index Document </strong>and <strong>Error Document </strong>enter “<strong>index.html</strong>”. After you’ve completed this step, click <strong>Save</strong>.</p><h4>Testing Our S3 Configuration</h4><p>Now that we’ve created and configured an S3 bucket to host a static website, let’s make sure that it works. To do this, upload a file called <strong>index.html </strong>to your S3 Bucket. Feel free to copy the below code snippet or make your own <strong>index.html </strong>file. The contents of the file aren’t important. Just ensure that it’s named <strong>index.html </strong>because that&#39;s the static file name we configured our S3 bucket to look for:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/70aa9be5819f71e63fc39272600e61d4/href">https://medium.com/media/70aa9be5819f71e63fc39272600e61d4/href</a></iframe><p>Now it’s time to upload <strong>index.html</strong>. Click on your S3 bucket if you aren’t already inside and go to <strong>Overview &gt; Upload &gt; Add files:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GJflbOzW_sbE9jICthd-vA.png" /><figcaption>Add a file to S3</figcaption></figure><p>Add <strong>index.html </strong>from your local machine to the S3 bucket. Next, navigate to <strong>Properties &gt; Static website hosting &gt; Endpoint </strong>and click on the URL:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PaByx_nKUl0Krm2U24Dbsw.png" /><figcaption>Our website!</figcaption></figure><h4>Clean Up</h4><p>Let’s clean up our S3 bucket so it can be ready to host a React app. Navigate to <strong>Overview </strong>and check <strong>index.html</strong>. Next, under <strong>Actions </strong>click <strong>Delete</strong>.</p><h3>Closing Thoughts</h3><p>Congratulations! We have successfully set up an IAM account and an S3 bucket on AWS. Stay tuned for <a href="https://medium.com/hashmapinc/automating-a-react-app-hosted-on-aws-s3-part-2-snowflake-healthcheck-8dfbdc74d33d">part two</a> of the series where we build a sample React application and deploy that app to our newly created S3 bucket! Also, be sure to checkout <a href="https://healthcheck.snowflakeinspector.com/">Snowflake Healthcheck</a>. It’s free, open-source, and easy to use!</p><p><a href="https://medium.com/hashmapinc/automating-a-react-app-hosted-on-aws-s3-part-2-snowflake-healthcheck-8dfbdc74d33d">Automating a React App Hosted on AWS S3 (Part 2): Snowflake Healthcheck</a></p><h3>Ready to accelerate your digital transformation?</h3><p>At Hashmap, we work with our clients to build better, together.</p><p>If you’d like additional assistance in this area, <a href="http://hashmapinc.com/snowflake"><strong>Hashmap</strong></a> offers a range of enablement workshops and consulting service packages as part of our consulting service offerings, and would be glad to work through your specifics in this area.</p><p>How does Snowflake compare to other data platforms? Our technical experts have implemented over 250 cloud/data projects in the last 3 years and conducted unbiased, detailed analyses across 34 business and technical dimensions, <a href="https://www.hashmapinc.com/snowflake-benchmarking">ranking each cloud data platform.</a></p><p><a href="https://www.hashmapinc.com/snowflake-benchmarking">2021 Cloud Data Platform Benchmark Analysis</a></p><p><em>Feel free to share on other channels and be sure and keep up with all new content from Hashmap </em><a href="http://hashmapinc.com/"><strong><em>here</em></strong></a><em>. To listen in on a casual conversation about all things data engineering and the cloud, check out Hashmap’s podcast </em><a href="https://www.hashmapinc.com/hashmapontap"><strong><em>Hashmap on Tap</em></strong></a><strong><em> </em></strong><em>as well on Spotify, Apple, Google, and other popular streaming apps.</em></p><p><a href="https://www.hashmapinc.com/hashmapontap">Hashmap on Tap | Hashmap Podcast</a></p><h3>Other Tools and Content You Might Like</h3><ul><li><a href="https://www.hashmapinc.com/snowflakeinspector">Snowflake Inspector | Interactive Visual Exploration of Snowflake | Hashmap</a></li><li><a href="https://www.hashmapinc.com/recommender">Recommender | Reduce Data &amp; Cloud Option Fatigue | Hashmap</a></li><li><a href="https://medium.com/hashmapinc/how-we-automated-snowflake-data-profiler-cfe93ea5703c">How We Automated Snowflake Data Profiler</a></li><li><a href="https://www.hashmapinc.com/megabytes">Hashmap Megabytes | Bite-Size Video Series</a></li></ul><p><a href="http://www.linkedin.com/in/samuel-kohlleffel"><strong><em>Sam Kohlleffel</em></strong></a><strong><em> </em></strong><em>is in Hashmap’s RTE Internship program developing data and cloud applications and is also a student at Texas A&amp;M University studying Economics, Math, and Statistics.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3fd0feb9f05" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hashmapinc/automating-a-react-app-hosted-on-aws-s3-snowflake-healthcheck-e3fd0feb9f05">Automating a React App Hosted on AWS S3 — Snowflake Healthcheck</a> was originally published in <a href="https://medium.com/hashmapinc">Hashmap, an NTT DATA Company</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How We Automated Snowflake Data Profiler]]></title>
            <link>https://medium.com/hashmapinc/how-we-automated-snowflake-data-profiler-cfe93ea5703c?source=rss-886c759dd690------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfe93ea5703c</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[snowflake-data-profiler]]></category>
            <category><![CDATA[snowflake]]></category>
            <dc:creator><![CDATA[Sam Kohlleffel]]></dc:creator>
            <pubDate>Mon, 21 Sep 2020 18:41:27 GMT</pubDate>
            <atom:updated>2020-11-06T12:15:52.602Z</atom:updated>
            <content:encoded><![CDATA[<h4>with a combination of GitHub, unit testing, and CircleCI</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L5KT3iRtvlAZXiapWl-mqQ.jpeg" /></figure><p>To kick things off, if you haven’t checked out <a href="http://snowflake.com/">Snowflake</a> yet, you definitely should. We get more requests from customers implementing Snowflake than all other cloud data platforms combined.</p><p>Snowflake enables a wide range of data workloads including data warehousing, data lakes, data engineering, data science, and more. Even better, it does this as a true SaaS service and requires virtually no maintenance and operational overhead.</p><p>With all the market demand that Snowflake is experiencing, as a Premier Partner, it makes sense to focus on adding even more value to the overall customer experience — that’s where Snowflake Data Profiler comes in.</p><p><a href="https://profiler.snowflakeinspector.com/">Snowflake Data Profiler</a> is a free, open-source tool that profiles the first 10,000 rows of any Snowflake table. Snowflake Data Profiler became generally available in early August and is accessible for free public use.</p><p>As with any deployed application, there are always improvements that can be made and features that can be added. One way to make changes to a deployed app is to SSH directly into the VM instance and make the changes there. From personal experience, I can tell you this method is a terrible way to update your deployed application.</p><p>It presents two major problems:</p><ol><li><strong>It is manual, error-prone, and inefficient.</strong></li><li><strong>The deployed application breaks if you make a mistake (which is often in my case).</strong></li></ol><p>The question then becomes — “how does a developer securely and efficiently make changes to a deployed application while ensuring at the same time it won’t break?”.</p><p>This is where automation comes into play. Automation is critical to the process of securely making changes to an application without ever having to manually access the running processes in the VM instance. Automation was a foreign concept to me only a few months ago.</p><h3>Let’s Look at Snowflake Data Profiler’s Automation</h3><p>There are different paths that one can take when automating an application. For the purposes of this article, I am going to talk about the methods and technologies we used to automate Snowflake Data Profiler.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YJjbmjj9UkDv1gleLsEtZw.png" /><figcaption>Snowflake Data Profiler Automation Flow</figcaption></figure><h4><strong>GitHub</strong></h4><p>GitHub is a free hosting service for software development that allows the use of version control.</p><p>Version control is extremely important for automating an application. It is a method of development in which programmers make changes and add features to a project on a separate, private “branch” of an application. This separate version of the application has no effect on the main, working version of the application. This means that even if changes or added features are made to the separate version of the code, the main version of the project’s code remains untouched. Below is an example of how version control in GitHub works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w3QP0Mxlw5_1o7iJcupPRw.png" /><figcaption>An example of GitHub version control</figcaption></figure><p>In GitHub, version control manifests with the use of branches. Generally, a project has a main, functioning version of the application on a branch called “master”. This branch is never directly changed. Instead, feature branches are used to make changes to the master branch. Feature branches start as a copy of the master branch by pulling its code. Then, additions or changes can be added and tested on these feature branches in isolation without changing the code of the master branch.</p><p>Changes are only made to the master branch when a pull request is made and approved. A pull request merges the additions of the feature branch with the existing master branch code. This means that the master branch now contains the additions of the feature branch. This process is repeated until all desired features are added to the application.</p><p>Developing with version control allows developers to safely add additions to their project without worrying about the main version of the code-breaking.</p><h4><strong>Unit Testing</strong></h4><p>Unit testing is an integral part of automation. Without tests, a developer cannot be completely certain that their code will work correctly once deployed.</p><p>Because Snowflake Data Profiler has a python-based backend, we use a combination of the built-in <a href="https://docs.python.org/3/library/unittest.html">Unittest library</a> and the <a href="https://docs.pytest.org/en/stable/contents.html">Pytest library</a>, which we install through pip. The accepted way to test code is to write tests for different functionality in the project. With Pytest, the only command that is needed to run the tests in the terminal is pytest.</p><p>In order to find and run the tests, Pytest looks for a specific naming convention. Every Python file that contains tests needs to have the following name structure: test_ + desired_filename.py. The desired filename can be anything. As long as the filename starts with test_, Pytest will know that there are tests in the file that need to be run. Within the file, the test function names need to start with test_ as well.</p><p>In the Snowflake Data Profiler project files, we have a test file that has the name test_profiler.py and a function within that file has the name test_get_profile. The test_profiler.py file contains tests for all of the functions found in our file profiler.py and the test_get_profile function contains tests for the get_profile function found in profiler.py.</p><h4><strong>CircleCI</strong></h4><p>CircleCI is a continuous integration and continuous delivery platform. This is where the automation process all comes together. A config.yml file is needed for CircleCI to work. Here is the config.yml file for Snowflake Data Profiler.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fb0469a4e01308db260c7255712e8671/href">https://medium.com/media/fb0469a4e01308db260c7255712e8671/href</a></iframe><p>Config files in CircleCI are used to designate jobs and workflows for project automation. Our config.yml file contains three jobs and one workflow. There are steps that are defined within each job. These steps serve as instructions for each job. When a job is called in a workflow, the job’s steps are executed. These three jobs within our workflow take the master branch code from GitHub and use that code to update our EC2 VM instance in a matter of minutes.</p><h4><strong>Job 1: </strong>docker/publish</h4><p>As you can see, we use a CircleCI orb in our config.yml file. A CircleCI orb is an open-source package of pre-built commands and jobs.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/77f23fed5450d6741c02d1d5d38a23ac/href">https://medium.com/media/77f23fed5450d6741c02d1d5d38a23ac/href</a></iframe><p>Specifically, we use a pre-built docker orb, circleci/docker@1.3.0, that contains a job for publishing images to DockerHub. Under workflows and jobs, we use the docker/publish job that is pre-defined in the orb we use.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cb72bd3e51467b488edecf0ca7b98763/href">https://medium.com/media/cb72bd3e51467b488edecf0ca7b98763/href</a></iframe><p>This job takes any feature GitHub branch under PR in the Snowflake Data Profiler repository and updates our Docker image with the new code. Under the docker/publish job, we define the image we want to update and the tag for the new image version.</p><h4><strong>Job 2: </strong>test_profiler</h4><p>The test_profiler job is a custom job that we build in the config.yml file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1a4a09334cd374b7d61fad975e9b5ebd/href">https://medium.com/media/1a4a09334cd374b7d61fad975e9b5ebd/href</a></iframe><p>We first designate the Docker image to use. Notice that it is the Docker image we build in the first job with the $CIRCLE_SHA1 tag. We then cd into our directory and run our unit tests with the pytest command.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d636aedfd3fbfe9e43094c61eaf22736/href">https://medium.com/media/d636aedfd3fbfe9e43094c61eaf22736/href</a></iframe><p>When we call the job in the workflow, we require that the docker/publish job is run before this job is executed. This ensures that the test_profiler job is using the most recent Docker image of Snowflake Data Profiler when it runs. After the test_profiler job is run, CircleCI notifies us of the results.</p><h4><strong>Job 3: </strong>deploy_profiler</h4><p>The deploy_profiler job is another custom job that we define in the config.yml file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fa31f7ff9a3c8d1d02ffe68e865f9091/href">https://medium.com/media/fa31f7ff9a3c8d1d02ffe68e865f9091/href</a></iframe><p>This job runs steps that SSH into the EC2 VM instance. Once inside the VM, a command is run that takes down the Docker container that the VM is currently running on and replaces it with a container based on the latest Docker image that was just created.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d649d906ef27d73ef472f5d8d62f8c4c/href">https://medium.com/media/d649d906ef27d73ef472f5d8d62f8c4c/href</a></iframe><p>Notice that this job is only called in the workflow if the feature branch pull request is accepted and the master branch is the branch that is changed. This step also requires that the test_profiler step passed. If the new image did not pass the unit tests, this step will not run and the older Docker image will remain in the EC2 instance.</p><p>With CircleCI and a config.yml file, the Snowflake Data Profiler deployment process is fully automated.</p><h4><strong>Closing Thoughts</strong></h4><p>Without the use of GitHub, unit tests, and CircleCI, it would be nearly impossible for us to continuously add updates to Snowflake Data Profiler. GitHub allows us to efficiently make additions to the project files without worrying about getting it right on the first try. Unit tests ensure that the additions we make do not break the application. CircleCI brings the entire automation process together. All we have to do is approve a PR in GitHub and, assuming all of the build jobs pass, CircleCI automatically updates our deployed application for us.</p><p>Automation makes updating a deployed application extremely reliable and repeatable. It removes the unnecessary, manual challenges of the deployment process. By applying automation to Snowflake Data Profiler, we are able to quickly get new features and minor changes out of production because even if those changes do not end up working, the automated tests we created catch the failure.</p><p>This allows us to initially focus on adding changes and value to an application rather than spending long hours worrying about how to correctly implement those changes in deployment. Also, if we decide to remove a recently added change, CircleCI allows us to roll back the application to a previous version before those changes were implemented.</p><p>Deploying an application always comes with challenges. However, after setting up automation for Snowflake Data Profiler, we don’t have to worry about the headaches that come with deploying additional changes.</p><h3>Ready to accelerate your digital transformation?</h3><p>At Hashmap, we work with our clients to build better, together.</p><p>If you want to go beyond the blogs and get to the heart of how you can pour jet fuel into your data and analytics tank, <a href="https://www.hashmapinc.com/reach-out">please reach out and let us take it from here</a>.</p><p><em>Feel free to share on other channels and be sure and keep up with all new content from Hashmap </em><a href="http://hashmapinc.com/"><strong><em>here</em></strong></a><em>. To listen in on a casual conversation about all things data engineering and the cloud, check out Hashmap’s podcast </em><a href="https://www.hashmapinc.com/hashmapontap"><strong><em>Hashmap on Tap</em></strong></a><strong><em> </em></strong><em>as well on Spotify, Apple, Google, and other popular streaming apps.</em></p><p><a href="https://www.hashmapinc.com/hashmapontap">Hashmap on Tap | Hashmap Podcast</a></p><h3>Other Tools and Content You Might Like</h3><ul><li><a href="https://www.hashmapinc.com/snowflakeinspector">Snowflake Inspector | Interactive Visual Exploration of Snowflake | Hashmap</a></li><li><a href="https://www.hashmapinc.com/recommender">Recommender | Reduce Data &amp; Cloud Option Fatigue | Hashmap</a></li><li><a href="https://medium.com/hashmapinc/snowflake-cheatsheet-3-approaches-to-creating-users-509ee2c40e3c">Snowflake Cheatsheet | 3 Approaches to Creating Users</a></li><li><a href="https://www.hashmapinc.com/megabytes">Hashmap Megabytes | Bite-Size Video Series</a></li></ul><p><a href="http://www.linkedin.com/in/samuel-kohlleffel"><strong><em>Sam Kohlleffel</em></strong></a><strong><em> </em></strong><em>is in Hashmap’s RTE Internship program developing data and cloud applications and is also a student at Texas A&amp;M University studying Economics, Math, and Statistics.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfe93ea5703c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hashmapinc/how-we-automated-snowflake-data-profiler-cfe93ea5703c">How We Automated Snowflake Data Profiler</a> was originally published in <a href="https://medium.com/hashmapinc">Hashmap, an NTT DATA Company</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Get a Snowflake Data Quality Assessment in 60 Seconds]]></title>
            <link>https://medium.com/hashmapinc/how-to-get-a-snowflake-data-quality-assessment-in-60-seconds-fc8f6520915?source=rss-886c759dd690------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc8f6520915</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[cloud-data-warehouse]]></category>
            <category><![CDATA[data-quality]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Sam Kohlleffel]]></dc:creator>
            <pubDate>Tue, 18 Aug 2020 14:01:02 GMT</pubDate>
            <atom:updated>2020-11-08T14:08:28.633Z</atom:updated>
            <content:encoded><![CDATA[<h4>Use Snowflake Data Profiler for fast, statistical DQ analysis of Snowflake tables</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nNkH2o8hCTKCCWPvEvT10A.jpeg" /></figure><h3>What is Data Profiling?</h3><p>The organization and preservation of your data are essential and when you’re using the <a href="http://snowflake.com/">Snowflake Data Cloud</a> you’ll find it’s organized by warehouse, database, schema, and table or view. Once your data is placed and organized, however, it can be a challenge to keep track of and monitor your tables’ data quality. To get the most value out of Snowflake (and all data platforms), we suggest using data profiling as a starting point.</p><p>Data profiling is an approach for providing automated, in-depth analyses of data quality and for identifying relationships in your data that aren’t always obvious at first glance. It is a great way to find quality issues at their source and is a common tool for jumpstarting advanced analysis of new data sets.</p><h3>Snowflake Data Profiler</h3><p><a href="https://profiler.snowflakeinspector.com/">Snowflake Data Profiler</a> is a simple, <a href="https://github.com/hashmapinc/snowflake-data-profiler">open-source tool</a> that can generate a report of any one of your Snowflake tables (or views) in a single click.</p><p>We chose to build utilities for Snowflake for a number of reasons, not the least of which is that Hashmap is getting more requests to implement Snowflake for customers than all other cloud data platforms combined, and for good reason.</p><ol><li>Snowflake just works, is SQL-first, and requires very little day-to-day management and operational overhead</li><li>The virtual warehousing and independent compute is unmatched with instant up/down elasticity and the required cost controls to go along with pay-by-second pricing</li><li>With Snowflake, you have your choice of all 3 major public clouds — AWS, Azure, and GCP</li></ol><h3>How does Snowflake Data Profiler work?</h3><p>Snowflake Data Profiler is a Python-based tool that leverages:</p><ul><li><a href="https://docs.snowflake.com/en/user-guide/python-connector.html">snowflake-connector-python</a></li><li><a href="https://pandas-profiling.github.io/pandas-profiling/docs/master/index.html">pandas-profiling</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ziQAQbBfXEsfFYmanm5Y5g.png" /></figure><h4>Connecting to the Snowflake Database</h4><p>First, the user posts their Snowflake information to a front-end webpage form. Once the post request makes its way to the Flask framework, we use Python to handle the Snowflake user data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DAgAIUObUf_ZA2Kd95i5mg.png" /></figure><p>To access the specified Snowflake table, the Profiler needs to first determine whether the given user information is correct. This is done by creating a connector object with the snowflake-connector-python module.</p><pre>con_object = connector.connect(<br>    user=sfUser,<br>    password=sfPswd,<br>    account=sfAccount,<br>    database=sfDatabase,<br>    schema=sfSchema,<br>    role=sfRole,<br>)</pre><blockquote>For our purposes, the connector object requires the user’s Snowflake username, password, account, database, and schema. Role is an optional argument.</blockquote><p>The connector object establishes a connection with Snowflake. However, if the connection fails, the user is notified that his or her submitted Snowflake information is incorrect.</p><p>After the connection is established, a cursor object is created from the connector. The cursor points to the table in Snowflake where the ‘execute’ and ‘fetch’ commands should run.</p><pre>cur = con.cursor()</pre><pre>if sfWarehouse:<br>    cur.execute(f&#39;use warehouse {sfWarehouse};&#39;)<br><br>cur.execute(f&#39;select * from {sfDatabase}.{sfSchema}.{sfTable} limit 10000;&#39;)</pre><pre>df = cur.fetch_pandas_all()</pre><blockquote>The cursor object requires the user’s Snowflake database, schema, and table that they would like to profile. Snowflake warehouse is an optional argument.</blockquote><blockquote>Once the cursor is created, a SQL command, which selects the Snowflake table from the database, is executed. A built-in cursor command is then used to fetch the Snowflake table and convert it into a pandas data frame.</blockquote><p>The cursor object allows us to not only query a table from the Snowflake database but also convert the table into a pandas data frame.</p><h4>Leveraging Technical Debt</h4><p>The Profiler can generate a report on any table regardless of size, but it currently only looks at the first 10,000 rows. We have understood since the beginning of our development that the 10,000-row limit was a temporary fix.</p><p>Our goal is to get the working Snowflake Data Profiler out the door, then to focus on scalability.</p><p>Using this method, we are able to provide users a working version of the application and measure how demand impacts backend performance. As more users profile their data and as we implement more advanced autoscaling, we can afford to remove these restrictions.</p><p>We are currently working to improve upon the row limit through the implementation of more advanced load scaling with <a href="https://kubernetes.io/">Kubernetes</a>. This means that Snowflake Data Profiler should have the option to greatly increase the row limit in the near future.</p><h4>Generating the Profile Report</h4><p>Now that our tool has a pandas data frame, the only thing left to do is create the profile report. Rather than building a custom profiling tool, the Snowflake Data Profiler utilizes pandas-profiling.</p><p>This is another example of how we leverage technical debt to our advantage. While we could build our own profiling tool, it would most likely take a while to develop. There are already viable options for completing this kind of task. Below is an example of how easy it is to profile a pandas data frame using pandas-profiling.</p><pre>profile = ProfileReport(<br>  data,<br>  title=&#39;Snowflake Data Profiler from Hashmap&#39;,<br>  progress_bar=False,<br>  explorative=True,<br>  correlations={<br>     &quot;pearson&quot;: {&quot;calculate&quot;: True},<br>     &quot;spearman&quot;: {&quot;calculate&quot;: False},<br>     &quot;kendall&quot;: {&quot;calculate&quot;: False},<br>     &quot;phi_k&quot;: {&quot;calculate&quot;: False},<br>     &quot;cramers&quot;: {&quot;calculate&quot;: False},<br> },<br>)<br><br>p = profile.to_html()</pre><blockquote>The ProfileReport function from pandas-profiling gives the user many parameters to work with. All that is required to run the report is a pandas data frame. Our pandas data frame is stored in the variable data.</blockquote><blockquote>We choose to expand upon the default report slightly. This includes changing the title of the report, setting explorative to True and configuring which correlations we need.</blockquote><p>Pandas-profiling is an amazing tool that allows you to take any pandas data frame and run detailed statistical analysis on it. Click <a href="https://profiler.snowflakeinspector.com/static/sample_reports/sample-profile.html">here</a> to see a sample pandas-profiling report.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AA_UZZNQ1wy_t4AaTY9rZg.png" /></figure><p>Pandas-profiling gives an in-depth analysis of any pandas data frame it is given. Once we generate the pandas-profiling report, our tool then returns the report to the user as an HTML response.</p><h3>Moving the App into Production</h3><h4>Hosting the Application</h4><p>We use an AWS EC2 instance to host our application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zlysI87oOpIeQeL3d_XHTg.png" /></figure><p>To run Snowflake Data Profiler in our EC2 instance, we utilize <a href="https://www.docker.com/">Docker</a> and Docker-compose.</p><p>We use both the latest Snowflake Data Profiler image and an Nginx image from DockerHub in our docker-compose file.</p><pre>version: &quot;3.1&quot;<br>services:<br>  nginx:<br>    depends_on: <br>      - snowflake_data_profiler<br>    image: nginx<br>    restart: always<br>    volumes:<br>      - ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf<br>      - ./certs:/etc/nginx/certs<br>    ports:<br>      - 80:80<br>      - 443:443<br><br>  snowflake_data_profiler:<br>    image: randypitcherii/snowflake_data_profiler:latest<br>    container_name: snowflake_data_profiler<br>    restart: always</pre><blockquote>As you can see in our docker-compose.yml, we pull the latest version of the Snowflake Data Profiler image. We also pull a pre-existing Nginx image from DockerHub and set it to depend on the Snowflake Data Profiler image.</blockquote><p>The docker-compose.yml along with the other project files are copied to the EC2 instance. Then, once we are inside our EC2 instance, a docker-compose up command is run to deploy our app on the EC2 VM.</p><h4>Securing Our Application</h4><p>We provide a secure connection on the Snowflake Data Profiler browser using Cloudflare and HTTPS certificates. This means that your Snowflake information is guaranteed to be encrypted and secured in transit to the EC2 web-server.</p><p>We never store your connection details or Snowflake data. Our Flask API is entirely stateless and forgets all of your details as soon as it finishes a request. This entirely removes the concern that one of our data stores may become compromised.</p><h4>Handling Post Data with WSGI</h4><p>To handle web requests from the browser, Snowflake Data Profiler utilizes Nginx, Gunicorn, and the Flask framework.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3tgiz2wWop6F2v_8CKP7lQ.png" /></figure><p>Once the user submits their Snowflake information, the post request is sent from the front-end webpage to the Nginx server. The Nginx server then decides what to do with the post request.</p><p><a href="https://www.nginx.com/">Nginx</a> is a fast and effective way to manage web traffic. It can handle static content quickly while it sends dynamic requests further down the line. In our case, Nginx sends the request to a <a href="https://docs.gunicorn.org/en/stable/">Gunicorn WSGI (Web Server Gateway Interface)</a>.</p><p>Gunicorn serves as a necessary go-between for the Nginx server and the Flask framework. Sending the post request to the Gunicorn server allows Flask and Python to serve incoming requests. Once the request is processed and the Snowflake table is profiled, Snowflake Data Profiler sends a profile report back to the user as an HTTP response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*67WSFbe1Eu6_nI-R7nhwvg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TPK4MYkaDIvuUX4D-VGRpw.png" /></figure><blockquote>These are sample screenshots of a profile report. The report makes its way back to the browser through Flask, Gunicorn, and Nginx in a matter of seconds.</blockquote><h3>Final Thoughts</h3><p>Snowflake Data Profiler is a safe and secure way to quickly gain a greater understanding of both the data quality and hidden relationships of your Snowflake data.</p><p>All it takes is a single click and you can profile the first 10,000 rows of one of your Snowflake tables. You can use it as many times as you’d like on as many tables as you’d like. Be sure to checkout <a href="https://profiler.snowflakeinspector.com/"><strong>Snowflake Data Profiler</strong></a>. It’s quick, open-source, secure, and easy to use!</p><p><em>Feel free to share on other channels and be sure and keep up with all new content from Hashmap </em><a href="http://hashmapinc.com/"><em>here</em></a><em>. To listen in on a casual conversation about all things data engineering and the cloud, check out Hashmap’s podcast </em><a href="https://www.hashmapinc.com/hashmapontap"><strong><em>Hashmap on Tap</em></strong></a><strong><em> </em></strong><em>as well on Spotify, Apple, Google, and other popular streaming apps.</em></p><p><a href="https://www.hashmapinc.com/hashmapontap">Hashmap on Tap | Hashmap Podcast</a></p><h3>Other Tools and Content You Might Like</h3><ul><li><a href="https://www.hashmapinc.com/snowflakeinspector">Snowflake Inspector | Interactive Visual Exploration of Snowflake | Hashmap</a></li><li><a href="https://www.hashmapinc.com/recommender">Recommender | Reduce Data &amp; Cloud Option Fatigue | Hashmap</a></li><li><a href="https://medium.com/hashmapinc/snowflake-cheatsheet-3-approaches-to-creating-users-509ee2c40e3c">Snowflake Cheatsheet | 3 Approaches to Creating Users</a></li><li><a href="https://www.hashmapinc.com/megabytes">Hashmap Megabytes | Bite-Size Video Series</a></li></ul><p><a href="http://www.linkedin.com/in/samuel-kohlleffel"><strong><em>Sam Kohlleffel</em></strong></a><strong><em> </em></strong><em>is in Hashmap’s RTE Internship program developing data and cloud applications and is also a student at Texas A&amp;M University studying Economics, Math, and Statistics.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc8f6520915" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hashmapinc/how-to-get-a-snowflake-data-quality-assessment-in-60-seconds-fc8f6520915">How to Get a Snowflake Data Quality Assessment in 60 Seconds</a> was originally published in <a href="https://medium.com/hashmapinc">Hashmap, an NTT DATA Company</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>