<?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 Free To Fork on Medium]]></title>
        <description><![CDATA[Stories by Free To Fork on Medium]]></description>
        <link>https://medium.com/@free2fork?source=rss-563d96732324------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JZKcQZtpdmn2JNRNT161rg.png</url>
            <title>Stories by Free To Fork on Medium</title>
            <link>https://medium.com/@free2fork?source=rss-563d96732324------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 11:00:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@free2fork/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[Local great expectations to Cloud GX with Snowflake]]></title>
            <link>https://medium.com/@free2fork/local-great-expectations-to-cloud-gx-with-snowflake-905ea0de03f4?source=rss-563d96732324------2</link>
            <guid isPermaLink="false">https://medium.com/p/905ea0de03f4</guid>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[data-quality]]></category>
            <category><![CDATA[great-expectations]]></category>
            <dc:creator><![CDATA[Free To Fork]]></dc:creator>
            <pubDate>Fri, 28 Jul 2023 21:31:40 GMT</pubDate>
            <atom:updated>2023-07-28T21:44:51.794Z</atom:updated>
            <content:encoded><![CDATA[<p>Below follows a full tutorial to run in one single Jupyter Notebook(in Anaconda environment with installed great expectations) your local great expectations checks against a Snowflake dataset and send it to great expectations cloud aka GX Cloud. Hope it helps!</p><pre>import great_expectations as gx<br>import os<br>from great_expectations.checkpoint import Checkpoint</pre><pre>os.environ[&quot;GX_CLOUD_ACCESS_TOKEN&quot;] = &quot;Your token&quot;<br># your organization_id is indicated on https://app.greatexpectations.io/tokens page<br>os.environ[&quot;GX_CLOUD_ORGANIZATION_ID&quot;] = &quot;Your GX Cloud Org ID&quot;<br># Get this in the website<br><br>context = gx.get_context(cloud_mode=True)<br>connection_string = &quot;Your Snowflake connection string, example in GE official docs&quot;</pre><pre># Give your datasource a name<br>datasource_name = &quot;name_your_datasource&quot;<br>datasource = context.sources.add_sql(name=&quot;the_you_want_for_your_datasource&quot;, connection_string=connection_string)<br><br># Give your first Asset a name<br>asset_name = &quot;name_for_your_assets&quot;<br><br>datasource = context.get_datasource(&quot;name_your_datasource&quot;)<br><br>my_table_name = &#39;NAME OF YOUR SNOWFLAKE TABLE”&#39;<br>asset = datasource.add_table_asset(name=&quot;name_for_your_assets&quot;, table_name=my_table_name)<br>my_asset = context.get_datasource(&quot;name_your_datasource&quot;).get_asset(&quot;name_for_your_assets&quot;)<br><br># Build batch request<br>batch_request = asset.build_batch_request()</pre><pre>expectation_suite_name = &quot;give_your_suite_name&quot;<br>assert expectation_suite_name is not None, &quot;Please set expectation_suite_name.&quot;<br><br>expectation_suite = context.add_expectation_suite(<br>    expectation_suite_name=expectation_suite_name<br>)<br><br><br># Get an existing Expectation Suite<br>expectation_suite_id = expectation_suite.ge_cloud_id<br>expectation_suite = context.get_expectation_suite(ge_cloud_id=expectation_suite_id)<br><br><br>column_name = &quot;a_snowflake_column_name&quot; # set column name you want to test here<br>assert column_name is not None, &quot;Please set column_name.&quot; #dont change just an alert<br><br># Look up all expectations types here - https://greatexpectations.io/expectations/<br>expectation_configuration = gx.core.ExpectationConfiguration(**{<br>  &quot;expectation_type&quot;: &quot;expect_column_min_to_be_between&quot;,<br>  &quot;kwargs&quot;: {<br>    &quot;column&quot;: column_name,<br>    &quot;min_value&quot;: 0.1<br>  },<br>  &quot;meta&quot;:{},<br>})<br><br>expectation_suite.add_expectation(<br>    expectation_configuration=expectation_configuration<br>)<br>print(expectation_suite)<br><br># Save the Expectation Suite<br>context.save_expectation_suite(expectation_suite=expectation_suite)</pre><pre>checkpoint_name = &quot;give_your_checkpoint_a_name&quot; # name your checkpoint here<br><br>assert checkpoint_name is not None, &quot;Please set checkpoint_name.&quot;<br><br>checkpoint_config = {<br>  &quot;name&quot;: checkpoint_name,<br>  &quot;validations&quot;: [{<br>      &quot;expectation_suite_name&quot;: expectation_suite_name,<br>      &quot;expectation_suite_ge_cloud_id&quot;: expectation_suite.ge_cloud_id,<br>      &quot;batch_request&quot;: {<br>          &quot;datasource_name&quot;: datasource.name,<br>          &quot;data_asset_name&quot;: asset.name,<br>      },<br>  }],<br>  &quot;config_version&quot;: 1,<br>  &quot;class_name&quot;: &quot;Checkpoint&quot;<br>}<br><br>context.add_or_update_checkpoint(**checkpoint_config)<br>checkpoint = context.get_checkpoint(checkpoint_name)<br><br>checkpoint.run()</pre><p>Go to your GX Cloud account and the test should be there.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=905ea0de03f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jupyter Notebook + Bigquery + pandas]]></title>
            <link>https://medium.com/@free2fork/jupyter-notebook-bigquery-pandas-d62654d36437?source=rss-563d96732324------2</link>
            <guid isPermaLink="false">https://medium.com/p/d62654d36437</guid>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[bigquery]]></category>
            <category><![CDATA[pandas-dataframe]]></category>
            <category><![CDATA[jupyter-notebook]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Free To Fork]]></dc:creator>
            <pubDate>Wed, 28 Jul 2021 22:40:14 GMT</pubDate>
            <atom:updated>2023-07-28T21:35:40.732Z</atom:updated>
            <content:encoded><![CDATA[<h4>Using Anaconda</h4><p>Activate your environment then start Jupyter and in the first cell run:</p><pre>!pip install google-cloud-bigquery google-cloud-bigquery-storage - upgrade</pre><pre>!gcloud auth application-default login</pre><pre>import pydata_google_auth<br>credentials = pydata_google_auth.get_user_credentials([&#39;https://www.googleapis.com/auth/bigquery&#39;],)</pre><p>It’ll ask you to visit a link, choose your account then copy the code and insert into the required field back in the Jupyter cell.</p><pre>uery = &quot;&quot;&quot;SELECT<br> *<br>FROM `your_project_id.data_set_name.table_name`<br>LIMIT 15&quot;&quot;&quot;</pre><p>Finally the DataFrame</p><pre>import pandas as pd<br>df = pd.read_gbq(query, project_id=project_id, dialect=&#39;standard&#39;, credentials=credentials)<br>df</pre><h4>Without Anaconda</h4><p>Just install Jupyter Notebook with</p><p><em>pip install ipython</em></p><p>Start Jupyter from your command line</p><p>Then follow the same 4 steps above inside you Jupyter Notebook.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d62654d36437" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>