Skip to content

Commit

Permalink
Deployed 545e7c0 to 0.11 with MkDocs 1.5.3 and mike 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dpguthrie committed Apr 6, 2024
1 parent d6b31f4 commit 8bb4261
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions 0.11/guide/intro/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,7 @@ <h3 id="interfaces">Interfaces<a class="headerlink" href="#interfaces" title="Pe
<ul>
<li><code>cloud</code> - instance of the <code>_AdminClient</code> class, which contains methods to create, read, update, and delete dbt Cloud resources</li>
<li><code>metadata</code> - instance of the <code>_MetadataClient</code> class, which contains methods to retrieve metadata generated from a dbt Cloud job run</li>
<li><code>sl</code> - instance of the <code>_SemanticLayerClient</code> class, which contains methods to interact with dbt Cloud's Semantic Layer via a GraphQL API</li>
</ul>
<p><strong><code>cloud</code></strong></p>
<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">dbtc</span> <span class="kn">import</span> <span class="n">dbtCloudClient</span>
Expand Down Expand Up @@ -786,6 +787,26 @@ <h3 id="interfaces">Interfaces<a class="headerlink" href="#interfaces" title="Pe
<span class="n">node_name</span> <span class="o">=</span> <span class="n">node</span><span class="p">[</span><span class="s1">&#39;name&#39;</span><span class="p">]</span>
<span class="o">...</span>
</code></pre></div>
<p><strong><code>sl</code></strong></p>
<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">dbtc</span> <span class="kn">import</span> <span class="n">dbtCloudClient</span>

<span class="n">client</span> <span class="o">=</span> <span class="n">dbtCloudClient</span><span class="p">(</span><span class="n">environment_id</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>

<span class="n">query_result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">sl</span><span class="o">.</span><span class="n">query</span><span class="p">(</span>
<span class="n">metrics</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;total_revenue&#39;</span><span class="p">,</span> <span class="s1">&#39;total_profit&#39;</span><span class="p">,</span> <span class="s1">&#39;total_customers&#39;</span><span class="p">],</span>
<span class="n">group_by</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;customer__region&#39;</span><span class="p">,</span> <span class="s1">&#39;customer__nation&#39;</span><span class="p">,</span> <span class="s1">&#39;metric_time__quarter&#39;</span><span class="p">],</span>
<span class="p">)</span>

<span class="c1"># As a default the `result` attribute will be a pandas.DataFrame</span>
<span class="n">query_result</span><span class="o">.</span><span class="n">result</span>

<span class="c1"># Also view the SQL</span>
<span class="n">query_result</span><span class="o">.</span><span class="n">sql</span>

<span class="c1"># Or do something based on the status of the query</span>
<span class="k">if</span> <span class="n">query_result</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="s1">&#39;SUCCESSFUL&#39;</span><span class="p">:</span>
<span class="o">...</span>
</code></pre></div>
<h2 id="cli">CLI<a class="headerlink" href="#cli" title="Permanent link">&para;</a></h2>
<p>This package also comes with a command-line utility, <code>dbtc</code>. All of the methods available through the <code>cloud</code> or <code>metadata</code> properties on the <code>dbtCloudClient</code> class are available through the command line as well.</p>
<p>The command line interface also accepts additional environment variables:</p>
Expand Down
2 changes: 1 addition & 1 deletion 0.11/search/search_index.json

Large diffs are not rendered by default.

Binary file modified 0.11/sitemap.xml.gz
Binary file not shown.

0 comments on commit 8bb4261

Please sign in to comment.