<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Data Wrangling on Posit Open Source</title>
    <link>https://opensource.posit.co/topics/data-wrangling/</link>
    <description>Recent content in Data Wrangling on Posit Open Source</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 03 Dec 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://opensource.posit.co/topics/data-wrangling/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>mlfeatures: feature engineering with recipes</title>
      <link>https://opensource.posit.co/blog/2026-12-03_mlfeatures-recipes/</link>
      <pubDate>Thu, 03 Dec 2026 00:00:00 +0000</pubDate>
      <guid>https://opensource.posit.co/blog/2026-12-03_mlfeatures-recipes/</guid>
      <dc:creator>Emil Hvitfeldt</dc:creator><description><![CDATA[<script src="https://cdn.jsdelivr.net/npm/requirejs@2.3.6/require.min.js" integrity="sha384-c9c+LnTbwQ3aujuU7ULEPVvgLs+Fn6fJUvIGTsuu1ZcCf11fiEubah0ttpca4ntM sha384-6V1/AdqZRWk1KAlWbKBlGhN7VG4iE/yAZcO6NZPMF8od0vukrvr0tg4qY6NSrItx" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js" integrity="sha384-ZvpUoO/+PpLXR1lu4jmpXWu80pZlYUAfxl5NsBMWOEPSjUn/6Z/hRTt8+pR6L4N2" crossorigin="anonymous" data-relocate-top="true"></script>
<script type="application/javascript">define('jquery', [],function() {return window.jQuery;})</script>
<p>You have probably written this code before:
a pile of preprocessing that imputes here, scales there,
one-hot encodes a hand-typed list of columns,
and quietly breaks the day someone adds a column to the source table.</p>
<p>We present <a href="https://tidymodels.github.io/mlfeatures/" target="_blank" rel="noopener">mlfeatures</a>,
a Python library for data preprocessing and feature engineering.
You specify what you want to happen as a <strong>recipe</strong>,
which is a declared sequence of <strong>steps</strong> that you fit once and apply anywhere.
There is a lot to cover, so this is the first of three blog posts.
The second and third will cover how mlfeatures works with <a href="https://scikit-learn.org/" target="_blank" rel="noopener">scikit-learn</a> and with <a href="https://pola.rs/" target="_blank" rel="noopener">polars</a>.
This one covers the recipe itself and the two ideas
that make it different from a scikit-learn pipeline:
<strong>selectors</strong> and <strong>roles</strong>.</p>
<div class="callout callout-note" role="note" aria-label="Note">
<div class="callout-header">
<span class="callout-title">Join us live</span>
</div>
<div class="callout-body">
<p>We will talk about mlfeatures next Tuesday 12pm ET / 9am PT (December 8) at the Data Science Lab.
<a href="https://events.zoom.us/ev/ApTgbXfayxBte4tEQA-D_09stCkOkSJmS5ODfzJdYbvRujqrLvif~AiPekDHhQ_V2bF9o_UeDz-wC2nelt4nibrrf3ip1aBKxt89ZcTEBnMYo6A" target="_blank" rel="noopener">Register here</a>.</p>
</div>
</div>
<p>You can install it with:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">pip install mlfeatures</span></span></code></pre></div></div>
<h2 id="the-problem-mlfeatures-solves">The problem mlfeatures solves
</h2>
<p>Feature engineering is often the most impactful part of a machine learning pipeline,
and it can often get quite complicated as we add more and more operations.
Additionally we have to be careful that we do everything correctly to avoid things like data leakage.</p>
<p>Traditionally in scikit-learn, you would use a <code>ColumnTransformer()</code>,
combined with a series of transformers or pipelines to specify which features should be handled by which transformations.</p>
<p>In scikit-learn that tends to look like this:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">numeric_plain</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&#34;sqft&#34;</span><span class="p">,</span> <span class="s2">&#34;lot_size&#34;</span><span class="p">,</span> <span class="s2">&#34;year_built&#34;</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="n">numeric_geo</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&#34;geo_lat&#34;</span><span class="p">,</span> <span class="s2">&#34;geo_lon&#34;</span><span class="p">,</span> <span class="s2">&#34;geo_elevation&#34;</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="n">categorical</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&#34;neighborhood&#34;</span><span class="p">,</span> <span class="s2">&#34;style&#34;</span><span class="p">,</span> <span class="s2">&#34;roof&#34;</span><span class="p">]</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">pre</span> <span class="o">=</span> <span class="n">ColumnTransformer</span><span class="p">([</span>
</span></span><span class="line"><span class="cl">    <span class="p">(</span><span class="s2">&#34;plain&#34;</span><span class="p">,</span> <span class="n">plain_pipe</span><span class="p">,</span> <span class="n">numeric_plain</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">    <span class="p">(</span><span class="s2">&#34;pca&#34;</span><span class="p">,</span> <span class="n">pca_branch</span><span class="p">,</span> <span class="n">numeric_geo</span> <span class="o">+</span> <span class="n">categorical</span><span class="p">),</span>
</span></span><span class="line"><span class="cl"><span class="p">])</span></span></span></code></pre></div></div>
<p>Spelling out all the columns isn&rsquo;t that bad when we don&rsquo;t have many of them,
but it is a chore to keep up to date, especially if our data set has a lot of columns.</p>
<p>Three literal lists, each a copy of the schema that nothing checks.
If someone adds <code>garage_sqft</code> to the table,
it is silently not imputed and not scaled.
And because <code>ColumnTransformer</code> branches run in parallel,
you cannot scale the PCA output together with the plain numerics without nesting yet another pipeline.</p>
<p>In mlfeatures we take a different approach.
You declare a recipe as a sequence of steps,
and each step says <em>what kind of columns</em> it applies to
rather than <em>which columns</em> it applies to today.</p>
<h2 id="specify-fit-transform">Specify, fit, transform
</h2>
<p>A recipe has three phases:</p>
<ol>
<li>Specify: declare the steps. No data is touched.</li>
<li>Fit: estimate what each step needs (medians, levels, means, PCA loadings) from the training data.</li>
<li>Transform: apply those stored estimates to any data frame, training or new.</li>
</ol>
<p>We&rsquo;ll use the credit data that ships with mlfeatures.
It has a categorical target, <code>Status</code>,
and a mix of numeric and string features with some missing values.</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">sklearn.model_selection</span> <span class="kn">import</span> <span class="n">train_test_split</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">mlfeatures</span> <span class="kn">import</span> <span class="n">Recipe</span><span class="p">,</span> <span class="n">StepDummy</span><span class="p">,</span> <span class="n">StepImputeMedian</span><span class="p">,</span> <span class="n">StepImputeMode</span><span class="p">,</span> <span class="n">StepNormalize</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">mlfeatures</span> <span class="kn">import</span> <span class="n">Selectors</span> <span class="k">as</span> <span class="n">s</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">mlfeatures.data</span> <span class="kn">import</span> <span class="n">credit</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">credit_train</span><span class="p">,</span> <span class="n">credit_test</span> <span class="o">=</span> <span class="n">train_test_split</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">credit</span><span class="p">,</span> <span class="n">train_size</span><span class="o">=</span><span class="mf">0.75</span><span class="p">,</span> <span class="n">stratify</span><span class="o">=</span><span class="n">credit</span><span class="p">[</span><span class="s2">&#34;Status&#34;</span><span class="p">],</span> <span class="n">random_state</span><span class="o">=</span><span class="mi">1</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">credit_train</span><span class="o">.</span><span class="n">head</span><span class="p">()</span></span></span></code></pre></div></div>
<div><style>
.dataframe > thead > tr,
.dataframe > tbody > tr {
  text-align: right;
  white-space: pre-wrap;
}
</style>
<small>shape: (5, 14)</small>
<table>
  <thead>
      <tr>
          <th>Status</th>
          <th>Seniority</th>
          <th>Home</th>
          <th>Time</th>
          <th>Age</th>
          <th>Marital</th>
          <th>Records</th>
          <th>Job</th>
          <th>Expenses</th>
          <th>Income</th>
          <th>Assets</th>
          <th>Debt</th>
          <th>Amount</th>
          <th>Price</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>str</td>
          <td>i64</td>
          <td>str</td>
          <td>i64</td>
          <td>i64</td>
          <td>str</td>
          <td>str</td>
          <td>str</td>
          <td>i64</td>
          <td>i64</td>
          <td>i64</td>
          <td>i64</td>
          <td>i64</td>
          <td>i64</td>
      </tr>
      <tr>
          <td>&quot;good&quot;</td>
          <td>1</td>
          <td>&quot;owner&quot;</td>
          <td>36</td>
          <td>21</td>
          <td>&quot;single&quot;</td>
          <td>&quot;no&quot;</td>
          <td>&quot;fixed&quot;</td>
          <td>35</td>
          <td>127</td>
          <td>10000</td>
          <td>0</td>
          <td>850</td>
          <td>1014</td>
      </tr>
      <tr>
          <td>&quot;good&quot;</td>
          <td>28</td>
          <td>&quot;owner&quot;</td>
          <td>30</td>
          <td>54</td>
          <td>&quot;married&quot;</td>
          <td>&quot;no&quot;</td>
          <td>&quot;fixed&quot;</td>
          <td>45</td>
          <td>234</td>
          <td>15000</td>
          <td>0</td>
          <td>1250</td>
          <td>2166</td>
      </tr>
      <tr>
          <td>&quot;bad&quot;</td>
          <td>2</td>
          <td>&quot;rent&quot;</td>
          <td>60</td>
          <td>36</td>
          <td>&quot;separated&quot;</td>
          <td>&quot;yes&quot;</td>
          <td>&quot;freelance&quot;</td>
          <td>35</td>
          <td>null</td>
          <td>0</td>
          <td>0</td>
          <td>2000</td>
          <td>2676</td>
      </tr>
      <tr>
          <td>&quot;good&quot;</td>
          <td>12</td>
          <td>&quot;owner&quot;</td>
          <td>60</td>
          <td>38</td>
          <td>&quot;married&quot;</td>
          <td>&quot;no&quot;</td>
          <td>&quot;fixed&quot;</td>
          <td>75</td>
          <td>120</td>
          <td>5000</td>
          <td>0</td>
          <td>1100</td>
          <td>1172</td>
      </tr>
      <tr>
          <td>&quot;bad&quot;</td>
          <td>0</td>
          <td>&quot;parents&quot;</td>
          <td>24</td>
          <td>21</td>
          <td>&quot;single&quot;</td>
          <td>&quot;yes&quot;</td>
          <td>&quot;partime&quot;</td>
          <td>35</td>
          <td>126</td>
          <td>0</td>
          <td>0</td>
          <td>1150</td>
          <td>1586</td>
      </tr>
  </tbody>
</table>
</div>
<p>Specifying a recipe means starting with <code>Recipe()</code> and chaining steps on with <code>.add()</code>:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">recipe</span> <span class="o">=</span> <span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">Recipe</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">credit_train</span><span class="p">,</span> <span class="n">target</span><span class="o">=</span><span class="s2">&#34;Status&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">StepImputeMedian</span><span class="p">(</span><span class="n">s</span><span class="o">.</span><span class="n">numeric_features</span><span class="p">()))</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">StepImputeMode</span><span class="p">(</span><span class="n">s</span><span class="o">.</span><span class="n">nominal_features</span><span class="p">()))</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">StepDummy</span><span class="p">(</span><span class="n">s</span><span class="o">.</span><span class="n">nominal_features</span><span class="p">()))</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">StepNormalize</span><span class="p">(</span><span class="n">s</span><span class="o">.</span><span class="n">numeric_features</span><span class="p">()))</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">recipe</span></span></span></code></pre></div></div>
<pre><code>Recipe (untrained)
  Inputs: 14 columns (1 target)
  Steps:
    step_impute_median(select(role='feature', type=NumericType))                [untrained]
    step_impute_mode(select(role='feature', type=(String, Categorical, Enum)))  [untrained]
    step_dummy(select(role='feature', type=(String, Categorical, Enum)))        [untrained]
    step_normalize(select(role='feature', type=NumericType))                    [untrained]
</code></pre>
<p>Nothing has been computed.
The recipe is just a description,
and it prints each step&rsquo;s selector exactly as written, tagged <code>[untrained]</code>.
The <code>data=</code> argument is optional and only used to check column names and show you what&rsquo;s there;
nothing is estimated from it.</p>
<p>We can read what this recipe does in almost plain English.
We specify a recipe on the <code>credit_train</code> with the target being <code>&quot;Status&quot;</code>, everything else being features.
Then we impute missing values of the numeric features with medians,
impute missing values of the nominal features by their modes,
create dummy variables from the nominal features,
and finally normalize all the numeric features.</p>
<p>There are a couple of things to take note of here.
The only time we specified something as a string was when we specified the target,
everything else uses selectors, which we will get back to later in the post.
One of the reasons why we do this is as an act of protection from previous steps that might remove a feature.
Using selectors makes it so we don&rsquo;t have to manually track each feature.
Also, a recipe is a linear sequence of steps,
not a graph of interconnected processes.
This is not because we couldn&rsquo;t support a graph.
We just believe it isn&rsquo;t needed, and it would complicate the design of mlfeatures.</p>
<p>Calling <code>.fit()</code> on the training data does the estimating.
It hands back a <em>new</em> object, a <code>FittedRecipe</code>,
and leaves the recipe itself alone,
so one specification can be fitted to many data sets (every fold of a cross-validation, for example).</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">fitted</span> <span class="o">=</span> <span class="n">recipe</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">credit_train</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">fitted</span></span></span></code></pre></div></div>
<pre><code>Recipe (trained)
  Inputs: 23 columns (22 features, 1 target)
  Steps:
    step_impute_median(Seniority, Time, Age, Expenses, Income, Assets, Debt, Amount, Price)                                                                                                                                                                                  [trained]
    step_impute_mode(Home, Marital, Records, Job)                                                                                                                                                                                                                            [trained]
    step_dummy(Home, Marital, Records, Job → Home_other, Home_owner, Home_parents, Home_priv, Home_rent, Marital_married, Marital_separated, Marital_single, Marital_widow, Records_yes, Job_freelance, Job_others, Job_partime)                                             [trained]
    step_normalize(Seniority, Time, Age, Expenses, Income, Assets, Debt, Amount, Price, Home_other, Home_owner, Home_parents, Home_priv, Home_rent, Marital_married, Marital_separated, Marital_single, Marital_widow, Records_yes, Job_freelance, Job_others, Job_partime)  [trained]
</code></pre>
<p>Now every step is <code>[trained]</code> and lists the concrete columns it resolved to.
Notice the last step.
We wrote <code>s.numeric_features()</code> twice,
but the normalize step operates on more columns than the imputation step did,
because the dummy step in between created a bunch of new indicator columns and the selector picked them up.
Selectors are evaluated on the data the step sees in the sequence,
not the data the recipe sees at the beginning.</p>
<p>Finally, <code>.transform()</code> applies the stored estimates to any data frame.
It never re-estimates anything,
so the test set is filled with the <em>training</em> medians and scaled by the <em>training</em> means:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">fitted</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">credit_test</span><span class="p">)</span><span class="o">.</span><span class="n">head</span><span class="p">()</span></span></span></code></pre></div></div>
<div><style>
.dataframe > thead > tr,
.dataframe > tbody > tr {
  text-align: right;
  white-space: pre-wrap;
}
</style>
<small>shape: (5, 23)</small>
<table>
  <thead>
      <tr>
          <th>Status</th>
          <th>Seniority</th>
          <th>Time</th>
          <th>Age</th>
          <th>Expenses</th>
          <th>Income</th>
          <th>Assets</th>
          <th>Debt</th>
          <th>Amount</th>
          <th>Price</th>
          <th>Home_other</th>
          <th>Home_owner</th>
          <th>Home_parents</th>
          <th>Home_priv</th>
          <th>Home_rent</th>
          <th>Marital_married</th>
          <th>Marital_separated</th>
          <th>Marital_single</th>
          <th>Marital_widow</th>
          <th>Records_yes</th>
          <th>Job_freelance</th>
          <th>Job_others</th>
          <th>Job_partime</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>str</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
      </tr>
      <tr>
          <td>&quot;good&quot;</td>
          <td>0.256525</td>
          <td>0.932128</td>
          <td>-0.814945</td>
          <td>1.162917</td>
          <td>2.353534</td>
          <td>-0.481696</td>
          <td>2.10856</td>
          <td>2.560203</td>
          <td>1.250825</td>
          <td>-0.278202</td>
          <td>-0.946206</td>
          <td>-0.467881</td>
          <td>-0.23793</td>
          <td>1.893895</td>
          <td>0.623887</td>
          <td>-0.172001</td>
          <td>-0.542203</td>
          <td>-0.122003</td>
          <td>-0.462644</td>
          <td>-0.553287</td>
          <td>-0.193851</td>
          <td>-0.346977</td>
      </tr>
      <tr>
          <td>&quot;bad&quot;</td>
          <td>-0.355733</td>
          <td>-0.302985</td>
          <td>-0.449476</td>
          <td>0.237705</td>
          <td>-0.574492</td>
          <td>0.050584</td>
          <td>0.362355</td>
          <td>1.396303</td>
          <td>1.408383</td>
          <td>-0.278202</td>
          <td>1.056536</td>
          <td>-0.467881</td>
          <td>-0.23793</td>
          <td>-0.527854</td>
          <td>0.623887</td>
          <td>-0.172001</td>
          <td>-0.542203</td>
          <td>-0.122003</td>
          <td>-0.462644</td>
          <td>-0.553287</td>
          <td>-0.193851</td>
          <td>-0.346977</td>
      </tr>
      <tr>
          <td>&quot;good&quot;</td>
          <td>-0.355733</td>
          <td>0.932128</td>
          <td>-1.180413</td>
          <td>-1.047312</td>
          <td>-0.625637</td>
          <td>-0.483297</td>
          <td>-0.272628</td>
          <td>-0.021538</td>
          <td>-0.630322</td>
          <td>-0.278202</td>
          <td>-0.946206</td>
          <td>2.136656</td>
          <td>-0.23793</td>
          <td>-0.527854</td>
          <td>-1.602375</td>
          <td>-0.172001</td>
          <td>1.843776</td>
          <td>-0.122003</td>
          <td>-0.462644</td>
          <td>-0.553287</td>
          <td>-0.193851</td>
          <td>-0.346977</td>
      </tr>
      <tr>
          <td>&quot;good&quot;</td>
          <td>2.705559</td>
          <td>0.520424</td>
          <td>1.560598</td>
          <td>-1.047312</td>
          <td>1.062134</td>
          <td>1.296306</td>
          <td>-0.272628</td>
          <td>0.126595</td>
          <td>0.221128</td>
          <td>-0.278202</td>
          <td>1.056536</td>
          <td>-0.467881</td>
          <td>-0.23793</td>
          <td>-0.527854</td>
          <td>-1.602375</td>
          <td>-0.172001</td>
          <td>-0.542203</td>
          <td>8.194093</td>
          <td>-0.462644</td>
          <td>1.806839</td>
          <td>-0.193851</td>
          <td>-0.346977</td>
      </tr>
      <tr>
          <td>&quot;good&quot;</td>
          <td>-0.84554</td>
          <td>-1.538097</td>
          <td>-1.454514</td>
          <td>-1.047312</td>
          <td>-0.651209</td>
          <td>-0.483297</td>
          <td>-0.272628</td>
          <td>-0.296642</td>
          <td>-0.249954</td>
          <td>-0.278202</td>
          <td>-0.946206</td>
          <td>2.136656</td>
          <td>-0.23793</td>
          <td>-0.527854</td>
          <td>-1.602375</td>
          <td>-0.172001</td>
          <td>1.843776</td>
          <td>-0.122003</td>
          <td>-0.462644</td>
          <td>-0.553287</td>
          <td>-0.193851</td>
          <td>2.881169</td>
      </tr>
  </tbody>
</table>
</div>
<p>A quick note on data frames:
the examples in this series use polars because
that is how the bundled datasets are stored,
but mlfeatures works with pandas too.
Under the hood every step is written once against <a href="https://narwhals-dev.github.io/narwhals/" target="_blank" rel="noopener">narwhals</a>,
a compatibility layer for data frame libraries,
so a recipe returns the same kind of data frame you gave it:
polars in, polars out; pandas in, pandas out.
The third post in this series looks at this in more detail.</p>
<p>That is the whole lifecycle,
and it is the part that keeps test data from leaking into your preprocessing.</p>
<h2 id="a-chain-of-transformers-that-keep-their-names">A chain of transformers that keep their names
</h2>
<p>If you have used a scikit-learn <code>Pipeline</code>, a recipe will look familiar.
It is a chain, and each step is applied to the output of the one before it.
The step that fits the median imputation produces a data frame,
the mode imputation is fitted on <em>that</em>,
the dummy step on the result of <em>that</em>, and so on.
<code>.transform()</code> replays the same chain in the same order.</p>
<p>The difference is what travels along the chain.
By default a scikit-learn transformer hands the next one a NumPy array (you can ask for data frames with <code>set_output</code>),
so by the second step the column names and dtypes are at best a convention.
And you have to keep features of different types separate, since a NumPy array can&rsquo;t mix numeric and non-numeric data.
In a recipe, what passes from step to step is always a named, typed data frame,
along with the roles and the record of which step produced each column.
That is what lets a step&rsquo;s <code>columns</code> be a <em>description</em> resolved against the previous step&rsquo;s output.</p>
<p>We can watch it happen on the Ames housing data by fitting the chain one step at a time.
After the dummy step, the string columns have been replaced by indicator columns.</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">mlfeatures</span> <span class="kn">import</span> <span class="n">StepDummy</span><span class="p">,</span> <span class="n">StepNormalize</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">mlfeatures.data</span> <span class="kn">import</span> <span class="n">ames_mini</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">base</span> <span class="o">=</span> <span class="n">Recipe</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">ames_mini</span><span class="p">,</span> <span class="n">target</span><span class="o">=</span><span class="s2">&#34;Sale_Price&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">dummied</span> <span class="o">=</span> <span class="n">base</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">StepDummy</span><span class="p">(</span><span class="n">s</span><span class="o">.</span><span class="n">col</span><span class="p">(</span><span class="s2">&#34;Bldg_Type&#34;</span><span class="p">,</span> <span class="s2">&#34;Street&#34;</span><span class="p">)))</span>
</span></span><span class="line"><span class="cl"><span class="n">dummied</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">ames_mini</span><span class="p">)</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">ames_mini</span><span class="p">)</span></span></span></code></pre></div></div>
<div><style>
.dataframe > thead > tr,
.dataframe > tbody > tr {
  text-align: right;
  white-space: pre-wrap;
}
</style>
<small>shape: (2_930, 14)</small>
<table>
  <thead>
      <tr>
          <th>Neighborhood</th>
          <th>Exterior_1st</th>
          <th>Gr_Liv_Area</th>
          <th>Year_Built</th>
          <th>Garage_Cars</th>
          <th>Garage_Area</th>
          <th>Latitude</th>
          <th>Longitude</th>
          <th>Sale_Price</th>
          <th>Bldg_Type_OneFam</th>
          <th>Bldg_Type_Twnhs</th>
          <th>Bldg_Type_TwnhsE</th>
          <th>Bldg_Type_TwoFmCon</th>
          <th>Street_Pave</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>str</td>
          <td>str</td>
          <td>i64</td>
          <td>i64</td>
          <td>i64</td>
          <td>i64</td>
          <td>f64</td>
          <td>f64</td>
          <td>i64</td>
          <td>i8</td>
          <td>i8</td>
          <td>i8</td>
          <td>i8</td>
          <td>i8</td>
      </tr>
      <tr>
          <td>&quot;North_Ames&quot;</td>
          <td>&quot;BrkFace&quot;</td>
          <td>1656</td>
          <td>1960</td>
          <td>2</td>
          <td>528</td>
          <td>42.054035</td>
          <td>-93.619754</td>
          <td>215000</td>
          <td>1</td>
          <td>0</td>
          <td>0</td>
          <td>0</td>
          <td>1</td>
      </tr>
      <tr>
          <td>&quot;North_Ames&quot;</td>
          <td>&quot;VinylSd&quot;</td>
          <td>896</td>
          <td>1961</td>
          <td>1</td>
          <td>730</td>
          <td>42.053014</td>
          <td>-93.619756</td>
          <td>105000</td>
          <td>1</td>
          <td>0</td>
          <td>0</td>
          <td>0</td>
          <td>1</td>
      </tr>
      <tr>
          <td>&quot;North_Ames&quot;</td>
          <td>&quot;Wd Sdng&quot;</td>
          <td>1329</td>
          <td>1958</td>
          <td>1</td>
          <td>312</td>
          <td>42.052659</td>
          <td>-93.619387</td>
          <td>172000</td>
          <td>1</td>
          <td>0</td>
          <td>0</td>
          <td>0</td>
          <td>1</td>
      </tr>
      <tr>
          <td>&quot;North_Ames&quot;</td>
          <td>&quot;BrkFace&quot;</td>
          <td>2110</td>
          <td>1968</td>
          <td>2</td>
          <td>522</td>
          <td>42.051245</td>
          <td>-93.61732</td>
          <td>244000</td>
          <td>1</td>
          <td>0</td>
          <td>0</td>
          <td>0</td>
          <td>1</td>
      </tr>
      <tr>
          <td>&quot;Gilbert&quot;</td>
          <td>&quot;VinylSd&quot;</td>
          <td>1629</td>
          <td>1997</td>
          <td>2</td>
          <td>482</td>
          <td>42.060899</td>
          <td>-93.638933</td>
          <td>189900</td>
          <td>1</td>
          <td>0</td>
          <td>0</td>
          <td>0</td>
          <td>1</td>
      </tr>
      <tr>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
      </tr>
      <tr>
          <td>&quot;Mitchell&quot;</td>
          <td>&quot;HdBoard&quot;</td>
          <td>1003</td>
          <td>1984</td>
          <td>2</td>
          <td>588</td>
          <td>41.988964</td>
          <td>-93.604776</td>
          <td>142500</td>
          <td>1</td>
          <td>0</td>
          <td>0</td>
          <td>0</td>
          <td>1</td>
      </tr>
      <tr>
          <td>&quot;Mitchell&quot;</td>
          <td>&quot;HdBoard&quot;</td>
          <td>902</td>
          <td>1983</td>
          <td>2</td>
          <td>484</td>
          <td>41.988314</td>
          <td>-93.60268</td>
          <td>131000</td>
          <td>1</td>
          <td>0</td>
          <td>0</td>
          <td>0</td>
          <td>1</td>
      </tr>
      <tr>
          <td>&quot;Mitchell&quot;</td>
          <td>&quot;HdBoard&quot;</td>
          <td>970</td>
          <td>1992</td>
          <td>0</td>
          <td>0</td>
          <td>41.98651</td>
          <td>-93.606847</td>
          <td>132000</td>
          <td>1</td>
          <td>0</td>
          <td>0</td>
          <td>0</td>
          <td>1</td>
      </tr>
      <tr>
          <td>&quot;Mitchell&quot;</td>
          <td>&quot;HdBoard&quot;</td>
          <td>1389</td>
          <td>1974</td>
          <td>2</td>
          <td>418</td>
          <td>41.990921</td>
          <td>-93.60019</td>
          <td>170000</td>
          <td>1</td>
          <td>0</td>
          <td>0</td>
          <td>0</td>
          <td>1</td>
      </tr>
      <tr>
          <td>&quot;Mitchell&quot;</td>
          <td>&quot;HdBoard&quot;</td>
          <td>2000</td>
          <td>1993</td>
          <td>3</td>
          <td>650</td>
          <td>41.989265</td>
          <td>-93.599996</td>
          <td>188000</td>
          <td>1</td>
          <td>0</td>
          <td>0</td>
          <td>0</td>
          <td>1</td>
      </tr>
  </tbody>
</table>
</div>
<p>Now add a normalize step that asks for <code>s.numeric_features()</code>.
We wrote no column names,
but the step is fitted on the dummy step&rsquo;s output,
so the selector can see the new indicator columns.</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">chained</span> <span class="o">=</span> <span class="n">dummied</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">StepNormalize</span><span class="p">(</span><span class="n">s</span><span class="o">.</span><span class="n">numeric_features</span><span class="p">()))</span>
</span></span><span class="line"><span class="cl"><span class="n">chained</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">ames_mini</span><span class="p">)</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">ames_mini</span><span class="p">)</span></span></span></code></pre></div></div>
<div><style>
.dataframe > thead > tr,
.dataframe > tbody > tr {
  text-align: right;
  white-space: pre-wrap;
}
</style>
<small>shape: (2_930, 14)</small>
<table>
  <thead>
      <tr>
          <th>Neighborhood</th>
          <th>Exterior_1st</th>
          <th>Gr_Liv_Area</th>
          <th>Year_Built</th>
          <th>Garage_Cars</th>
          <th>Garage_Area</th>
          <th>Latitude</th>
          <th>Longitude</th>
          <th>Sale_Price</th>
          <th>Bldg_Type_OneFam</th>
          <th>Bldg_Type_Twnhs</th>
          <th>Bldg_Type_TwnhsE</th>
          <th>Bldg_Type_TwoFmCon</th>
          <th>Street_Pave</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>str</td>
          <td>str</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>i64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
      </tr>
      <tr>
          <td>&quot;North_Ames&quot;</td>
          <td>&quot;BrkFace&quot;</td>
          <td>0.309212</td>
          <td>-0.375473</td>
          <td>0.307157</td>
          <td>0.257179</td>
          <td>1.062069</td>
          <td>0.900517</td>
          <td>215000</td>
          <td>0.456263</td>
          <td>-0.188917</td>
          <td>-0.293875</td>
          <td>-0.147005</td>
          <td>0.064117</td>
      </tr>
      <tr>
          <td>&quot;North_Ames&quot;</td>
          <td>&quot;VinylSd&quot;</td>
          <td>-1.194223</td>
          <td>-0.34241</td>
          <td>-1.006668</td>
          <td>1.195897</td>
          <td>1.00661</td>
          <td>0.900439</td>
          <td>105000</td>
          <td>0.456263</td>
          <td>-0.188917</td>
          <td>-0.293875</td>
          <td>-0.147005</td>
          <td>0.064117</td>
      </tr>
      <tr>
          <td>&quot;North_Ames&quot;</td>
          <td>&quot;Wd Sdng&quot;</td>
          <td>-0.337661</td>
          <td>-0.441599</td>
          <td>-1.006668</td>
          <td>-0.746598</td>
          <td>0.987327</td>
          <td>0.914786</td>
          <td>172000</td>
          <td>0.456263</td>
          <td>-0.188917</td>
          <td>-0.293875</td>
          <td>-0.147005</td>
          <td>0.064117</td>
      </tr>
      <tr>
          <td>&quot;North_Ames&quot;</td>
          <td>&quot;BrkFace&quot;</td>
          <td>1.207317</td>
          <td>-0.11097</td>
          <td>0.307157</td>
          <td>0.229296</td>
          <td>0.910521</td>
          <td>0.995227</td>
          <td>244000</td>
          <td>0.456263</td>
          <td>-0.188917</td>
          <td>-0.293875</td>
          <td>-0.147005</td>
          <td>0.064117</td>
      </tr>
      <tr>
          <td>&quot;Gilbert&quot;</td>
          <td>&quot;VinylSd&quot;</td>
          <td>0.255801</td>
          <td>0.847855</td>
          <td>0.307157</td>
          <td>0.043412</td>
          <td>1.434908</td>
          <td>0.15424</td>
          <td>189900</td>
          <td>0.456263</td>
          <td>-0.188917</td>
          <td>-0.293875</td>
          <td>-0.147005</td>
          <td>0.064117</td>
      </tr>
      <tr>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
          <td>&hellip;</td>
      </tr>
      <tr>
          <td>&quot;Mitchell&quot;</td>
          <td>&quot;HdBoard&quot;</td>
          <td>-0.982555</td>
          <td>0.418037</td>
          <td>0.307157</td>
          <td>0.536006</td>
          <td>-2.472464</td>
          <td>1.483328</td>
          <td>142500</td>
          <td>0.456263</td>
          <td>-0.188917</td>
          <td>-0.293875</td>
          <td>-0.147005</td>
          <td>0.064117</td>
      </tr>
      <tr>
          <td>&quot;Mitchell&quot;</td>
          <td>&quot;HdBoard&quot;</td>
          <td>-1.182354</td>
          <td>0.384974</td>
          <td>0.307157</td>
          <td>0.052706</td>
          <td>-2.50777</td>
          <td>1.564886</td>
          <td>131000</td>
          <td>0.456263</td>
          <td>-0.188917</td>
          <td>-0.293875</td>
          <td>-0.147005</td>
          <td>0.064117</td>
      </tr>
      <tr>
          <td>&quot;Mitchell&quot;</td>
          <td>&quot;HdBoard&quot;</td>
          <td>-1.047836</td>
          <td>0.682541</td>
          <td>-2.320492</td>
          <td>-2.196499</td>
          <td>-2.60576</td>
          <td>1.402743</td>
          <td>132000</td>
          <td>0.456263</td>
          <td>-0.188917</td>
          <td>-0.293875</td>
          <td>-0.147005</td>
          <td>0.064117</td>
      </tr>
      <tr>
          <td>&quot;Mitchell&quot;</td>
          <td>&quot;HdBoard&quot;</td>
          <td>-0.218968</td>
          <td>0.087408</td>
          <td>0.307157</td>
          <td>-0.254004</td>
          <td>-2.366163</td>
          <td>1.661775</td>
          <td>170000</td>
          <td>0.456263</td>
          <td>-0.188917</td>
          <td>-0.293875</td>
          <td>-0.147005</td>
          <td>0.064117</td>
      </tr>
      <tr>
          <td>&quot;Mitchell&quot;</td>
          <td>&quot;HdBoard&quot;</td>
          <td>0.989715</td>
          <td>0.715604</td>
          <td>1.620981</td>
          <td>0.824127</td>
          <td>-2.456114</td>
          <td>1.669324</td>
          <td>188000</td>
          <td>0.456263</td>
          <td>-0.188917</td>
          <td>-0.293875</td>
          <td>-0.147005</td>
          <td>0.064117</td>
      </tr>
  </tbody>
</table>
</div>
<p>The normalize step lists the indicators (<code>Bldg_Type_OneFam</code>, <code>Street_Pave</code>, and so on) next to the original numeric columns,
even though none of them existed when we wrote the recipe.</p>
<h2 id="selectors-say-what-not-which">Selectors: say what, not which
</h2>
<p>Selectors are <em>descriptions</em> of columns,
and they live in the <code>Selectors</code> namespace,
which the mlfeatures docs import as <code>s</code>.
You can select by name, by type, by role (more on that next),
or by which step created a column:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">s</span><span class="o">.</span><span class="n">col</span><span class="p">(</span><span class="s2">&#34;Income&#34;</span><span class="p">,</span> <span class="s2">&#34;Assets&#34;</span><span class="p">)</span>        <span class="c1"># by name</span>
</span></span><span class="line"><span class="cl"><span class="n">s</span><span class="o">.</span><span class="n">starts_with</span><span class="p">(</span><span class="s2">&#34;Garage&#34;</span><span class="p">)</span>          <span class="c1"># by name pattern</span>
</span></span><span class="line"><span class="cl"><span class="n">s</span><span class="o">.</span><span class="n">numeric</span><span class="p">()</span>                      <span class="c1"># by type</span>
</span></span><span class="line"><span class="cl"><span class="n">s</span><span class="o">.</span><span class="n">has_role</span><span class="p">(</span><span class="s2">&#34;geo&#34;</span><span class="p">)</span>                <span class="c1"># by role</span>
</span></span><span class="line"><span class="cl"><span class="n">s</span><span class="o">.</span><span class="n">has_source</span><span class="p">(</span><span class="n">step_type</span><span class="o">=</span><span class="n">StepDummy</span><span class="p">)</span>  <span class="c1"># by the step that produced it</span></span></span></code></pre></div></div>
<p>They compose with <code>&amp;</code>, <code>|</code>, <code>~</code>,
and <code>-</code>, so &ldquo;every numeric feature except the ones in the <code>geo</code> group&rdquo; is one expression.
We&rsquo;ll use that shortly.</p>
<p>You may have noticed we have been using <code>s.numeric_features()</code> and not <code>s.numeric()</code>.
That is deliberate and it brings us to roles.</p>
<h2 id="roles-what-a-column-is-for">Roles: what a column is for
</h2>
<p>In scikit-learn, &ldquo;which column is the target&rdquo; is something you track yourself,
by splitting <code>X</code> and <code>y</code> before anything else happens.
In a recipe, it is a property of the column in the data frame, called a <strong>role</strong>.</p>
<p>The two roles you will use constantly are <code>&quot;feature&quot;</code> (a column used as model input) and <code>&quot;target&quot;</code> (the column being predicted).
When we wrote <code>Recipe(data=credit_train, target=&quot;Status&quot;)</code>,
<code>Status</code> got the <code>target</code> role and every other column became a feature by default.</p>
<p>This is why <code>s.numeric_features()</code> exists.
It is <code>s.numeric()</code> restricted to the feature role,
so it leaves out a numeric target.
A plain type selector knows nothing about roles,
so it would happily normalize the thing you&rsquo;re trying to predict, which is almost never what you want.</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">recipe</span> <span class="o">=</span> <span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">Recipe</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">ames_mini</span><span class="p">,</span> <span class="n">target</span><span class="o">=</span><span class="s2">&#34;Sale_Price&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">StepNormalize</span><span class="p">(</span><span class="n">s</span><span class="o">.</span><span class="n">numeric_features</span><span class="p">()))</span>  <span class="c1"># leaves Sale_Price alone</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">StepNormalize</span><span class="p">(</span><span class="n">s</span><span class="o">.</span><span class="n">numeric</span><span class="p">()))</span>  <span class="c1"># includes Sale_Price</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">recipe</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">ames_mini</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code>Recipe (trained)
  Inputs: 11 columns (10 features, 1 target)
  Steps:
    step_normalize(Gr_Liv_Area, Year_Built, Garage_Cars, Garage_Area, Latitude, Longitude)              [trained]
    step_normalize(Gr_Liv_Area, Year_Built, Garage_Cars, Garage_Area, Latitude, Longitude, Sale_Price)  [trained]
</code></pre>
<p>You can name the features yourself with <code>features=</code>.
A role is just a string, though, so you can invent your own.
Here we tag the coordinates <code>geo</code>,
and then normalize every numeric feature <em>except</em> those.</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">polars</span> <span class="k">as</span> <span class="nn">pl</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">recipe</span> <span class="o">=</span> <span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">Recipe</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">ames_mini</span><span class="p">,</span> <span class="n">target</span><span class="o">=</span><span class="s2">&#34;Sale_Price&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">set_roles</span><span class="p">(</span><span class="n">geo</span><span class="o">=</span><span class="p">[</span><span class="s2">&#34;Latitude&#34;</span><span class="p">,</span> <span class="s2">&#34;Longitude&#34;</span><span class="p">])</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">StepNormalize</span><span class="p">(</span><span class="n">s</span><span class="o">.</span><span class="n">numeric_features</span><span class="p">()</span> <span class="o">-</span> <span class="n">s</span><span class="o">.</span><span class="n">has_role</span><span class="p">(</span><span class="s2">&#34;geo&#34;</span><span class="p">)))</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">fitted</span> <span class="o">=</span> <span class="n">recipe</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">ames_mini</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">fitted</span></span></span></code></pre></div></div>
<pre><code>Recipe (trained)
  Inputs: 11 columns (10 features, 2 geos, 1 target)
  Steps:
    step_normalize(Gr_Liv_Area, Year_Built, Garage_Cars, Garage_Area)  [trained]
</code></pre>
<p>Roles can also change part way through a recipe.
<code>add_role()</code>, <code>update_role()</code>,
and <code>remove_role()</code> take effect at the point they are written:
steps after them see the new role, steps before them do not.
Here the dummy columns get an <code>indicator</code> role so the normalization
that follows can skip them:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">mlfeatures</span> <span class="kn">import</span> <span class="n">StepDummy</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">recipe</span> <span class="o">=</span> <span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">Recipe</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">ames_mini</span><span class="p">,</span> <span class="n">target</span><span class="o">=</span><span class="s2">&#34;Sale_Price&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">StepDummy</span><span class="p">(</span><span class="n">s</span><span class="o">.</span><span class="n">nominal_features</span><span class="p">()))</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">add_role</span><span class="p">(</span><span class="n">s</span><span class="o">.</span><span class="n">has_source</span><span class="p">(</span><span class="n">step_type</span><span class="o">=</span><span class="n">StepDummy</span><span class="p">),</span> <span class="n">role</span><span class="o">=</span><span class="s2">&#34;indicator&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">StepNormalize</span><span class="p">(</span><span class="n">s</span><span class="o">.</span><span class="n">numeric_features</span><span class="p">()</span> <span class="o">-</span> <span class="n">s</span><span class="o">.</span><span class="n">has_role</span><span class="p">(</span><span class="s2">&#34;indicator&#34;</span><span class="p">)))</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">fitted</span> <span class="o">=</span> <span class="n">recipe</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">ames_mini</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">fitted</span><span class="o">.</span><span class="n">summary</span><span class="p">()</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">pl</span><span class="o">.</span><span class="n">col</span><span class="p">(</span><span class="s2">&#34;roles&#34;</span><span class="p">)</span><span class="o">.</span><span class="n">str</span><span class="o">.</span><span class="n">contains</span><span class="p">(</span><span class="s2">&#34;indicator&#34;</span><span class="p">))</span><span class="o">.</span><span class="n">head</span><span class="p">()</span></span></span></code></pre></div></div>
<div><style>
.dataframe > thead > tr,
.dataframe > tbody > tr {
  text-align: right;
  white-space: pre-wrap;
}
</style>
<small>shape: (5, 5)</small>
<table>
  <thead>
      <tr>
          <th>name</th>
          <th>dtype</th>
          <th>roles</th>
          <th>source</th>
          <th>sparse</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>str</td>
          <td>str</td>
          <td>str</td>
          <td>str</td>
          <td>bool</td>
      </tr>
      <tr>
          <td>&quot;Neighborhood_Blueste&quot;</td>
          <td>&quot;int&quot;</td>
          <td>&quot;feature, indicator&quot;</td>
          <td>&quot;dummy&quot;</td>
          <td>false</td>
      </tr>
      <tr>
          <td>&quot;Neighborhood_Briardale&quot;</td>
          <td>&quot;int&quot;</td>
          <td>&quot;feature, indicator&quot;</td>
          <td>&quot;dummy&quot;</td>
          <td>false</td>
      </tr>
      <tr>
          <td>&quot;Neighborhood_Brookside&quot;</td>
          <td>&quot;int&quot;</td>
          <td>&quot;feature, indicator&quot;</td>
          <td>&quot;dummy&quot;</td>
          <td>false</td>
      </tr>
      <tr>
          <td>&quot;Neighborhood_Clear_Creek&quot;</td>
          <td>&quot;int&quot;</td>
          <td>&quot;feature, indicator&quot;</td>
          <td>&quot;dummy&quot;</td>
          <td>false</td>
      </tr>
      <tr>
          <td>&quot;Neighborhood_College_Creek&quot;</td>
          <td>&quot;int&quot;</td>
          <td>&quot;feature, indicator&quot;</td>
          <td>&quot;dummy&quot;</td>
          <td>false</td>
      </tr>
  </tbody>
</table>
</div>
<p>That <code>has_source()</code> selector is the last one worth a closer look.</p>
<h2 id="selecting-by-where-a-column-came-from">Selecting by where a column came from
</h2>
<p>A fitted recipe tracks the <em>lineage</em> of every column:
which step produced it and which columns it was derived from.
A selector can ask for it.</p>
<p><code>s.has_source(step_type=StepDummy)</code> means &ldquo;the columns that <code>StepDummy</code> produced&rdquo;.
Every step also has an <code>id</code> (it defaults to the step&rsquo;s short name, like <code>&quot;dummy&quot;</code>, and a second step of the same type becomes <code>&quot;dummy_2&quot;</code>),
so you can be more specific with <code>s.has_source(&quot;dummy_2&quot;)</code>,
or name steps yourself with <code>id=</code>.</p>
<p>The lineage is also queryable after the fact.
If a model flags a PCA component as important,
you can ask what it was built from:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">mlfeatures</span> <span class="kn">import</span> <span class="n">StepPca</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">recipe</span> <span class="o">=</span> <span class="n">Recipe</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">ames_mini</span><span class="p">,</span> <span class="n">target</span><span class="o">=</span><span class="s2">&#34;Sale_Price&#34;</span><span class="p">)</span><span class="o">.</span><span class="n">add</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">StepPca</span><span class="p">(</span><span class="n">s</span><span class="o">.</span><span class="n">col</span><span class="p">(</span><span class="s2">&#34;Garage_Cars&#34;</span><span class="p">,</span> <span class="s2">&#34;Garage_Area&#34;</span><span class="p">,</span> <span class="s2">&#34;Gr_Liv_Area&#34;</span><span class="p">),</span> <span class="n">num_comp</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">fitted</span> <span class="o">=</span> <span class="n">recipe</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">ames_mini</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">fitted</span><span class="o">.</span><span class="n">lineage</span><span class="o">.</span><span class="n">ancestors</span><span class="p">(</span><span class="s2">&#34;PC1&#34;</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code>{'Garage_Area', 'Garage_Cars', 'Gr_Liv_Area'}
</code></pre>
<h2 id="putting-it-together">Putting it together
</h2>
<p>Back to the scenario from the start:
encode the categories, compress the encoded columns together with the geographic columns using PCA,
then normalize everything numeric, <em>including</em> the new components.
Here it is as a recipe on the Ames housing data (we only encode two of the categorical columns to keep the output readable).
The first normalize standardizes the PCA inputs,
which matters because latitude and longitude are on a very different scale from the 0/1 indicators:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">mlfeatures</span> <span class="kn">import</span> <span class="n">StepPca</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">ames_train</span><span class="p">,</span> <span class="n">ames_test</span> <span class="o">=</span> <span class="n">train_test_split</span><span class="p">(</span><span class="n">ames_mini</span><span class="p">,</span> <span class="n">train_size</span><span class="o">=</span><span class="mf">0.8</span><span class="p">,</span> <span class="n">random_state</span><span class="o">=</span><span class="mi">502</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">compress</span> <span class="o">=</span> <span class="n">s</span><span class="o">.</span><span class="n">has_source</span><span class="p">(</span><span class="n">step_type</span><span class="o">=</span><span class="n">StepDummy</span><span class="p">)</span> <span class="o">|</span> <span class="n">s</span><span class="o">.</span><span class="n">col</span><span class="p">(</span><span class="s2">&#34;Latitude&#34;</span><span class="p">,</span> <span class="s2">&#34;Longitude&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">recipe</span> <span class="o">=</span> <span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">Recipe</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">ames_train</span><span class="p">,</span> <span class="n">target</span><span class="o">=</span><span class="s2">&#34;Sale_Price&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">StepDummy</span><span class="p">(</span><span class="n">s</span><span class="o">.</span><span class="n">col</span><span class="p">(</span><span class="s2">&#34;Bldg_Type&#34;</span><span class="p">,</span> <span class="s2">&#34;Street&#34;</span><span class="p">)))</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">StepNormalize</span><span class="p">(</span><span class="n">compress</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">StepPca</span><span class="p">(</span><span class="n">compress</span><span class="p">,</span> <span class="n">num_comp</span><span class="o">=</span><span class="mi">3</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">StepNormalize</span><span class="p">(</span><span class="n">s</span><span class="o">.</span><span class="n">numeric_features</span><span class="p">()))</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">fitted</span> <span class="o">=</span> <span class="n">recipe</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">ames_train</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">fitted</span></span></span></code></pre></div></div>
<pre><code>Recipe (trained)
  Inputs: 10 columns (9 features, 1 target)
  Steps:
    step_dummy(Bldg_Type, Street → Bldg_Type_OneFam, Bldg_Type_Twnhs, Bldg_Type_TwnhsE, Bldg_Type_TwoFmCon, Street_Pave)                 [trained]
    step_normalize(Latitude, Longitude, Bldg_Type_OneFam, Bldg_Type_Twnhs, Bldg_Type_TwnhsE, Bldg_Type_TwoFmCon, Street_Pave)            [trained]
    step_pca(Latitude, Longitude, Bldg_Type_OneFam, Bldg_Type_Twnhs, Bldg_Type_TwnhsE, Bldg_Type_TwoFmCon, Street_Pave → PC1, PC2, PC3)  [trained]
    step_normalize(Gr_Liv_Area, Year_Built, Garage_Cars, Garage_Area, PC1, PC2, PC3)                                                     [trained]
</code></pre>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">fitted</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">ames_test</span><span class="p">)</span><span class="o">.</span><span class="n">head</span><span class="p">()</span></span></span></code></pre></div></div>
<div><style>
.dataframe > thead > tr,
.dataframe > tbody > tr {
  text-align: right;
  white-space: pre-wrap;
}
</style>
<small>shape: (5, 10)</small>
<table>
  <thead>
      <tr>
          <th>Neighborhood</th>
          <th>Exterior_1st</th>
          <th>Gr_Liv_Area</th>
          <th>Year_Built</th>
          <th>Garage_Cars</th>
          <th>Garage_Area</th>
          <th>Sale_Price</th>
          <th>PC1</th>
          <th>PC2</th>
          <th>PC3</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>str</td>
          <td>str</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
          <td>i64</td>
          <td>f64</td>
          <td>f64</td>
          <td>f64</td>
      </tr>
      <tr>
          <td>&quot;Old_Town&quot;</td>
          <td>&quot;Wd Sdng&quot;</td>
          <td>0.076542</td>
          <td>-2.522462</td>
          <td>-2.340051</td>
          <td>-2.217032</td>
          <td>148000</td>
          <td>0.346995</td>
          <td>-0.348378</td>
          <td>0.421788</td>
      </tr>
      <tr>
          <td>&quot;Bloomington_Heights&quot;</td>
          <td>&quot;VinylSd&quot;</td>
          <td>0.187633</td>
          <td>1.047201</td>
          <td>1.645233</td>
          <td>0.739286</td>
          <td>226500</td>
          <td>-2.551539</td>
          <td>2.128751</td>
          <td>-0.750674</td>
      </tr>
      <tr>
          <td>&quot;Clear_Creek&quot;</td>
          <td>&quot;Wd Sdng&quot;</td>
          <td>1.74089</td>
          <td>-2.092781</td>
          <td>0.316805</td>
          <td>-0.527708</td>
          <td>240000</td>
          <td>0.506054</td>
          <td>0.170912</td>
          <td>-0.309718</td>
      </tr>
      <tr>
          <td>&quot;Brookside&quot;</td>
          <td>&quot;Wd Sdng&quot;</td>
          <td>-0.394081</td>
          <td>-1.563942</td>
          <td>0.316805</td>
          <td>-0.152302</td>
          <td>100000</td>
          <td>0.387593</td>
          <td>-0.297109</td>
          <td>0.216065</td>
      </tr>
      <tr>
          <td>&quot;Timberland&quot;</td>
          <td>&quot;VinylSd&quot;</td>
          <td>0.268427</td>
          <td>1.014149</td>
          <td>1.645233</td>
          <td>1.574563</td>
          <td>270000</td>
          <td>0.527388</td>
          <td>-0.779915</td>
          <td>-0.646561</td>
      </tr>
  </tbody>
</table>
</div>
<p>A few things to notice.
There is one selector, <code>compress</code>,
that unions &ldquo;whatever the dummy step made&rdquo; with two named columns,
and the living area, year built,
and garage columns flow past the PCA untouched (they are only normalized, at the end).
There are no nested branches to reconcile,
just a list of steps in the order they run.
And if a rare neighborhood goes missing from a particular training split,
nothing in the recipe needs editing,
because nothing in it names a dummy column.</p>
<p>If you want to know what each step did,
<code>fitted.summary()</code> gives you the column-by-column accounting,
and the recipe prints as a readable record of the whole pipeline.</p>
<h2 id="whats-next">What&rsquo;s next
</h2>
<p>A recipe is a specification you fit once and apply anywhere,
which also means you can save a fitted recipe to JSON or YAML and load it back in production without the training data (see <code>to_json()</code> and <code>from_json()</code>).</p>
<p>In the next two posts, we&rsquo;ll look at how recipes fit into the rest of your stack:
In the meantime, the <a href="https://tidymodels.github.io/mlfeatures/" target="_blank" rel="noopener">mlfeatures documentation</a> has the full list of steps and six worked examples ported from <a href="https://www.tmwr.org/" target="_blank" rel="noopener"><em>Tidy Modeling with R</em></a>.
and tuning, then with polars and the <code>df.mlf</code> accessor.
In the meantime, the <a href="https://tidymodels.github.io/mlfeatures/" target="_blank" rel="noopener">mlfeatures documentation</a> has the full list of steps and six worked examples ported from <em>Tidy Modeling with R</em>.</p>
<p>mlfeatures is new and there are plenty of great things to come.
This is mainly focused on additional steps that will be useful to users.
This initial release provides a solid foundation and a set of steps that should cover a lot of basic cases.</p>
<p>A note on where this comes from:
mlfeatures is a Python port of the R package <a href="https://opensource.posit.co/software/recipes">recipes</a>, part of tidymodels.
If you have used recipes, most of this will feel familiar.
We have been working on the R package for quite a while and think that it is worth porting to our Python users as well.
We know that 1:1 ports are usually not great, so we took the best of recipes,
added some cool things,
and made sure that it was as pythonic as possible.</p>
<p>Two differences are deliberate:
mlfeatures follows scikit-learn&rsquo;s vocabulary (&ldquo;feature&rdquo; and &ldquo;target&rdquo; rather than &ldquo;predictor&rdquo; and &ldquo;outcome&rdquo;),
and role changes such as <code>add_role()</code> take effect at the point you write them,
whereas in R they are applied up front no matter where they appear.</p>
]]></description>
      <enclosure url="https://opensource.posit.co/blog/2026-12-03_mlfeatures-recipes/featured.png" length="272675" type="image/png" />
    </item>
    <item>
      <title>haven 2.6.0</title>
      <link>https://opensource.posit.co/blog/2026-12-02_haven-2-6-0/</link>
      <pubDate>Wed, 02 Dec 2026 00:00:00 +0000</pubDate>
      <guid>https://opensource.posit.co/blog/2026-12-02_haven-2-6-0/</guid>
      <dc:creator>Hadley Wickham</dc:creator><description><![CDATA[<p>We&rsquo;re pleased to announce the release of <a href="https://haven.tidyverse.org" target="_blank" rel="noopener">haven</a> 2.6.0. haven lets you read and write SAS, SPSS, and Stata files from R. You can install it from CRAN with:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">install.packages</span><span class="p">(</span><span class="s">&#34;haven&#34;</span><span class="p">)</span></span></span></code></pre></div></div>
<p>The big news in this release is that <code>write_sas()</code> is back: haven now writes <code>.sas7bdat</code> files that SAS can actually open. This release also introduces a new way to work with file metadata, makes reading a bit more pleasant, and includes a large number of smaller fixes. You can see a full list of changes in the <a href="https://github.com/tidyverse/haven/releases/tag/v2.6.0" target="_blank" rel="noopener">release notes</a>.</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">library</span><span class="p">(</span><span class="n">haven</span><span class="p">)</span></span></span></code></pre></div></div>
<h2 id="write_sas-is-back"><code>write_sas()</code> is back
</h2>
<p><code>write_sas()</code> was deprecated in haven 2.5.2 because the files it produced couldn&rsquo;t reliably be read by SAS. The cause turned out to be an incorrectly computed header checksum in ReadStat, the C library that powers haven. That&rsquo;s now fixed, so SAS can read the files haven writes, and <code>write_sas()</code> is no longer deprecated.</p>
<p>Along the way we fixed a number of other problems with the SAS writer:</p>
<ul>
<li>Tagged missing values (e.g. <code>tagged_na(&quot;a&quot;)</code>) are now written in the format SAS expects, so they come back as <code>.A</code> in SAS.</li>
<li>Variable names starting with an underscore are written correctly.</li>
<li>Dates and date-times on or after 4000-03-01 are no longer off by one day. (SAS doesn&rsquo;t treat years divisible by 4000 as leap years, and now neither does haven when reading SAS files.)</li>
</ul>
<p>So if you need to hand a dataset to a SAS user, you can now simply:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="n">df</span> <span class="o">&lt;-</span> <span class="nf">data.frame</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">  <span class="n">id</span> <span class="o">=</span> <span class="m">1</span><span class="o">:</span><span class="m">3</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="n">visit</span> <span class="o">=</span> <span class="nf">as.Date</span><span class="p">(</span><span class="nf">c</span><span class="p">(</span><span class="s">&#34;2026-01-15&#34;</span><span class="p">,</span> <span class="s">&#34;2026-02-12&#34;</span><span class="p">,</span> <span class="s">&#34;2026-03-19&#34;</span><span class="p">)),</span>
</span></span><span class="line"><span class="cl">  <span class="n">score</span> <span class="o">=</span> <span class="nf">c</span><span class="p">(</span><span class="m">12.5</span><span class="p">,</span> <span class="kc">NA</span><span class="p">,</span> <span class="m">9.25</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">path</span> <span class="o">&lt;-</span> <span class="nf">tempfile</span><span class="p">(</span><span class="n">fileext</span> <span class="o">=</span> <span class="s">&#34;.sas7bdat&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nf">write_sas</span><span class="p">(</span><span class="n">df</span><span class="p">,</span> <span class="n">path</span><span class="p">)</span></span></span></code></pre></div></div>
<h2 id="richer-metadata-with-meta">Richer metadata with <code>meta()</code>
</h2>
<p>SAS, SPSS, and Stata files carry a lot of metadata beyond the data itself: display formats, column widths, measurement levels, file timestamps, and more. Previously haven stored a handful of these as ad hoc attributes like <code>format.sas</code>, <code>width</code>, and <code>display_width</code>, ignoring the rest. haven 2.6.0 replaces these slapdash attributes with a single <code>meta()</code> accessor backed by <a href="https://rconsortium.github.io/S7/" target="_blank" rel="noopener">S7</a> classes, one per format, for both data frames and variables.</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="n">iris_sas_path</span> <span class="o">&lt;-</span> <span class="nf">system.file</span><span class="p">(</span><span class="s">&#34;examples&#34;</span><span class="p">,</span> <span class="s">&#34;iris.sas7bdat&#34;</span><span class="p">,</span> <span class="n">package</span> <span class="o">=</span> <span class="s">&#34;haven&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">iris_sas</span> <span class="o">&lt;-</span> <span class="nf">read_sas</span><span class="p">(</span><span class="n">iris_sas_path</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nf">meta</span><span class="p">(</span><span class="n">iris_sas</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code>&lt;haven::meta_df_sas&gt;
@created   : 2016-06-08 22:38:50 UTC
@modified  : 2016-06-08 22:38:50 UTC
@table_name: &quot;IRIS&quot;
</code></pre>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">meta</span><span class="p">(</span><span class="n">iris_sas</span><span class="o">$</span><span class="n">Species</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code>&lt;haven::meta_var_sas&gt;
@format  : &quot;$6&quot;
@informat: &quot;$6&quot;
@width   : 6
</code></pre>
<p>Metadata that haven reads is used again when writing, so it survives a round trip. This release also captures metadata that haven previously ignored:</p>
<ul>
<li><strong>SAS</strong>: variable informats, table names, and the transport file version.</li>
<li><strong>SPSS</strong>: measurement levels, alignment, and (read-only) multiple response sets.</li>
<li><strong>Stata</strong>: storage types and the file version.</li>
</ul>
<p>You can create metadata from scratch with the format-specific constructors like <code>meta_var_sas()</code>. For example, here we give our data a SAS date format and a numeric format with two decimal places, then write it out:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">meta</span><span class="p">(</span><span class="n">df</span><span class="o">$</span><span class="n">visit</span><span class="p">)</span> <span class="o">&lt;-</span> <span class="nf">meta_var_sas</span><span class="p">(</span><span class="n">format</span> <span class="o">=</span> <span class="s">&#34;DATE9.&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nf">meta</span><span class="p">(</span><span class="n">df</span><span class="o">$</span><span class="n">score</span><span class="p">)</span> <span class="o">&lt;-</span> <span class="nf">meta_var_sas</span><span class="p">(</span><span class="n">format</span> <span class="o">=</span> <span class="s">&#34;8.2&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nf">write_sas</span><span class="p">(</span><span class="n">df</span><span class="p">,</span> <span class="n">path</span><span class="p">)</span></span></span></code></pre></div></div>
<p>SAS users opening this file will now see <code>15JAN2026</code> for <code>visit</code> and two decimal places of precision for <code>score</code>.</p>
<p>The same approach works for SPSS, where you might want to change a variable&rsquo;s measure type:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="n">iris_sav_path</span> <span class="o">&lt;-</span> <span class="nf">system.file</span><span class="p">(</span><span class="s">&#34;examples&#34;</span><span class="p">,</span> <span class="s">&#34;iris.sav&#34;</span><span class="p">,</span> <span class="n">package</span> <span class="o">=</span> <span class="s">&#34;haven&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">iris_sav</span> <span class="o">&lt;-</span> <span class="nf">read_sav</span><span class="p">(</span><span class="n">iris_sav_path</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nf">meta</span><span class="p">(</span><span class="n">iris_sav</span><span class="o">$</span><span class="n">Species</span><span class="p">)</span><span class="o">@</span><span class="n">measure</span> <span class="o">&lt;-</span> <span class="s">&#34;ordinal&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nf">meta</span><span class="p">(</span><span class="n">iris_sav</span><span class="o">$</span><span class="n">Species</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code>&lt;haven::meta_var_spss&gt;
@format       : &quot;F8.0&quot;
@display_width: 8
@measure      : &quot;ordinal&quot;
@alignment    : &quot;right&quot;
</code></pre>
<p>If you want to strip metadata, use the new <code>zap_meta()</code>, which supersedes <code>zap_formats()</code> and <code>zap_widths()</code>.</p>
<p>If you only need the metadata from a file (or just the column names and types), use <code>n_max = 0</code>. haven now stops parsing right after the file header, so this is fast even for very large files:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">read_sav</span><span class="p">(</span><span class="n">iris_sav_path</span><span class="p">,</span> <span class="n">n_max</span> <span class="o">=</span> <span class="m">0</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code># A tibble: 0 × 5
# ℹ 5 variables: Sepal.Length &lt;dbl&gt;, Sepal.Width &lt;dbl&gt;, Petal.Length &lt;dbl&gt;,
#   Petal.Width &lt;dbl&gt;, Species &lt;dbl+lbl&gt;
</code></pre>
<h2 id="reading-improvements">Reading improvements
</h2>
<p>All <code>read_*()</code> functions gain a <code>progress</code> argument. As in readr, a progress bar is shown by default in interactive sessions when reading large files; turn it off with <code>options(haven.show_progress = FALSE)</code>.</p>
<p><code>col_select</code> now fully implements the tidyselect interface, so columns are returned in the order you request them and you can rename them as you go:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">read_sas</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">  <span class="n">iris_sas_path</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="n">col_select</span> <span class="o">=</span> <span class="nf">c</span><span class="p">(</span><span class="n">species</span> <span class="o">=</span> <span class="n">Species</span><span class="p">,</span> <span class="nf">starts_with</span><span class="p">(</span><span class="s">&#34;Petal&#34;</span><span class="p">))</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span></span></span></code></pre></div></div>
<pre><code># A tibble: 150 × 3
   species Petal_Length Petal_Width
   &lt;chr&gt;          &lt;dbl&gt;       &lt;dbl&gt;
 1 setosa           1.4         0.2
 2 setosa           1.4         0.2
 3 setosa           1.3         0.2
 4 setosa           1.5         0.2
 5 setosa           1.4         0.2
 6 setosa           1.7         0.4
 7 setosa           1.4         0.3
 8 setosa           1.5         0.2
 9 setosa           1.4         0.2
10 setosa           1.5         0.1
# ℹ 140 more rows
</code></pre>
<h2 id="other-improvements">Other improvements
</h2>
<p>A few other changes worth highlighting:</p>
<ul>
<li><code>read_sas()</code> can now read files produced by JMP and files with zero rows, and supports all SAS date, time, and datetime formats. It also uses the data file&rsquo;s encoding for catalog files that don&rsquo;t specify their own, fixing garbled value labels in UTF-8 catalogs.</li>
<li><code>write_dta()</code> now stores each numeric column using the smallest Stata storage type that exactly represents its values, like Stata&rsquo;s <code>compress</code>, which can substantially reduce file sizes. It also gives an informative error for value labels outside the range Stata can store, rather than silently converting them to missing values.</li>
<li><code>write_xpt()</code> supports long variable labels in version 8 files, and errors on variable names that are too long instead of silently truncating them.</li>
<li><code>write_sav()</code> supports value labels for strings longer than 8 bytes.</li>
<li><code>labelled_spss()</code> vectors containing <code>NA</code> can now be combined with <code>rbind()</code> and <code>dplyr::bind_rows()</code>.</li>
</ul>
<h2 id="breaking-changes">Breaking changes
</h2>
<p>This release includes a few breaking changes:</p>
<ul>
<li><code>read_*()</code> no longer read compressed (<code>.gz</code>, <code>.bz2</code>, <code>.xz</code>, <code>.zip</code>) files. Decompress them first.</li>
<li><code>read_*()</code> no longer attach the <code>format.*</code>, <code>width</code>, <code>display_width</code>, or <code>notes</code> attributes. Use <code>meta()</code> instead.</li>
<li><code>read_sas()</code> no longer accepts <code>cols_only</code>, which has been deprecated since haven 2.2.0. Use <code>col_select</code> instead.</li>
</ul>
<p>haven also no longer depends on crayon or readr, giving it a lighter dependency footprint.</p>
<h2 id="acknowledgements">Acknowledgements
</h2>
<p>A big thanks to everyone who contributed to this release by filing issues, submitting pull requests, and discussing ideas: <a href="https://github.com/ankonyeni" target="_blank" rel="noopener">@ankonyeni</a>, <a href="https://github.com/bms63" target="_blank" rel="noopener">@bms63</a>, <a href="https://github.com/cpiraux" target="_blank" rel="noopener">@cpiraux</a>, <a href="https://github.com/d2yh" target="_blank" rel="noopener">@d2yh</a>, <a href="https://github.com/gorcha" target="_blank" rel="noopener">@gorcha</a>, <a href="https://github.com/gowerc" target="_blank" rel="noopener">@gowerc</a>, <a href="https://github.com/hadley" target="_blank" rel="noopener">@hadley</a>, <a href="https://github.com/jeroen" target="_blank" rel="noopener">@jeroen</a>, <a href="https://github.com/jeroenjanssens" target="_blank" rel="noopener">@jeroenjanssens</a>, <a href="https://github.com/jplavulca" target="_blank" rel="noopener">@jplavulca</a>, <a href="https://github.com/LeonidasZhak" target="_blank" rel="noopener">@LeonidasZhak</a>, <a href="https://github.com/MarcusPenthin" target="_blank" rel="noopener">@MarcusPenthin</a>, <a href="https://github.com/nathanj3" target="_blank" rel="noopener">@nathanj3</a>, <a href="https://github.com/nickharrigan" target="_blank" rel="noopener">@nickharrigan</a>, <a href="https://github.com/rolsen-dft" target="_blank" rel="noopener">@rolsen-dft</a>, <a href="https://github.com/sasutils" target="_blank" rel="noopener">@sasutils</a>, <a href="https://github.com/sims1253" target="_blank" rel="noopener">@sims1253</a>, <a href="https://github.com/szimmer" target="_blank" rel="noopener">@szimmer</a>, <a href="https://github.com/taekop" target="_blank" rel="noopener">@taekop</a>, and <a href="https://github.com/vthanik" target="_blank" rel="noopener">@vthanik</a>.</p>
]]></description>
      <enclosure url="https://opensource.posit.co/blog/2026-12-02_haven-2-6-0/featured.jpg" length="260704" type="image/jpeg" />
    </item>
    <item>
      <title>Data Validation Libraries for Polars (2026 Edition)</title>
      <link>https://opensource.posit.co/blog/2026-11-30_validation-libs-2026/</link>
      <pubDate>Mon, 30 Nov 2026 00:00:00 +0000</pubDate>
      <guid>https://opensource.posit.co/blog/2026-11-30_validation-libs-2026/</guid>
      <dc:creator>Rich Iannone</dc:creator><description><![CDATA[<p>In the middle of 2025 we published a <a href="https://opensource.posit.co/blog/2025-06-04_validation-libs-2025/" target="_blank" rel="noopener">survey of data validation
libraries for
Polars</a>,
comparing five Python packages that could check a Polars DataFrame
against a set of expectations. A year and a half later, enough has
changed to make a second look worthwhile. Polars is now at <code>v2.2</code>,
following the <code>v2.0</code> release in October 2026. All five libraries from
the first survey have had new releases, and two of them have moved up a
major version. Several newer libraries have also appeared, and some of
them take approaches we didn&rsquo;t see at all the first time around:
validation through function decorators, schemas written as
<code>typing.Protocol</code> classes, and a single schema that both validates data
and generates it.</p>
<p>This edition covers nine libraries. The five returning ones are
<strong>Pandera</strong>, <strong>Patito</strong>, <strong>Pointblank</strong>, <strong>Validoopsie</strong>, and
<strong>Dataframely</strong>, and the four newcomers are <strong>Daffy</strong>, <strong>checkedframe</strong>,
<strong>Pavise</strong>, and <strong>polspec</strong>. We&rsquo;ll run every one of them against the
same small table we used in 2025, so you can compare the examples with
each other and with the earlier edition. One thing kept coming up as we
looked at them: more and more of these libraries use
<a href="https://narwhals-dev.github.io/narwhals/" target="_blank" rel="noopener">Narwhals</a>, a compatibility
layer that lets the same code work with Polars, Pandas, PyArrow, and
several other DataFrame libraries. That trend gets a section of its own
near the end.</p>
<div class="callout callout-note" role="note" aria-label="Note">
<div class="callout-body">
<p>As in 2025, Great Expectations is not included here. It remains one of
the most established validation frameworks in the Python ecosystem,
but it still doesn&rsquo;t offer native Polars support (the <a href="https://github.com/great-expectations/great_expectations/issues/10702" target="_blank" rel="noopener">issue proposing
Narwhals</a>
as a route to it remains open).</p>
</div>
</div>
<h2 id="the-libraries-at-a-glance">The Libraries at a Glance
</h2>
<p>The table below summarizes the nine libraries. The star counts are from
GitHub at the end of November 2026 and are only meant to give a rough
sense of how well known each project is. Several of the smaller projects
here are well made and actively maintained, and a low count often says
more about a library&rsquo;s age than about its quality.</p>
<div id="gebcumwjvl" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
<style>
#gebcumwjvl table {
          font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }
#gebcumwjvl thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#gebcumwjvl p { margin: 0; padding: 0; }
 #gebcumwjvl .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }
 #gebcumwjvl .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #gebcumwjvl .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
 #gebcumwjvl .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-top-color: #FFFFFF; border-top-width: 0; }
 #gebcumwjvl .gt_heading { background-color: #FFFFFF; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #gebcumwjvl .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #gebcumwjvl .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #gebcumwjvl .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; overflow-x: hidden; }
 #gebcumwjvl .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
 #gebcumwjvl .gt_column_spanner_outer:first-child { padding-left: 0; }
 #gebcumwjvl .gt_column_spanner_outer:last-child { padding-right: 0; }
 #gebcumwjvl .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
 #gebcumwjvl .gt_spanner_row { border-bottom-style: hidden; }
 #gebcumwjvl .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }
 #gebcumwjvl .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }
 #gebcumwjvl .gt_from_md> :first-child { margin-top: 0; }
 #gebcumwjvl .gt_from_md> :last-child { margin-bottom: 0; }
 #gebcumwjvl .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }
 #gebcumwjvl .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; }
 #gebcumwjvl .gt_indent_1 { text-indent: 5px; }
 #gebcumwjvl .gt_indent_2 { text-indent: calc(5px * 2); }
 #gebcumwjvl .gt_indent_3 { text-indent: calc(5px * 3); }
 #gebcumwjvl .gt_indent_4 { text-indent: calc(5px * 4); }
 #gebcumwjvl .gt_indent_5 { text-indent: calc(5px * 5); }
 #gebcumwjvl .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; vertical-align: top; }
 #gebcumwjvl .gt_row_group_first td { border-top-width: 2px; }
 #gebcumwjvl .gt_row_group_first th { border-top-width: 2px; }
 #gebcumwjvl .gt_striped { color: #333333; background-color: #F4F4F4; }
 #gebcumwjvl .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #gebcumwjvl .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #gebcumwjvl .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #gebcumwjvl .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #gebcumwjvl .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #gebcumwjvl .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #gebcumwjvl .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #gebcumwjvl .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #gebcumwjvl .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; text-align: left; }
 #gebcumwjvl .gt_left { text-align: left; }
 #gebcumwjvl .gt_center { text-align: center; }
 #gebcumwjvl .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #gebcumwjvl .gt_font_normal { font-weight: normal; }
 #gebcumwjvl .gt_font_bold { font-weight: bold; }
 #gebcumwjvl .gt_font_italic { font-style: italic; }
 #gebcumwjvl .gt_super { font-size: 65%; }
 #gebcumwjvl .gt_footnotes { color: font-color(#FFFFFF); background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #gebcumwjvl .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #gebcumwjvl .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #gebcumwjvl .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; text-align: left; }
 #gebcumwjvl .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #gebcumwjvl .gt_asterisk { font-size: 100%; vertical-align: 0; }
</style>
<table style="table-layout: fixed;; width: 0px" class="gt_table" data-quarto-disable-processing="true" data-quarto-bootstrap="false">
<colgroup>
  <col style="width:130px;"/>
  <col style="width:80px;"/>
  <col style="width:70px;"/>
  <col style="width:240px;"/>
  <col style="width:260px;"/>
</colgroup>
<thead>
<tr class="gt_col_headings">
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="lib">Library</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="version">Version</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" scope="col" id="stars">⭐</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="style">Approach</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="backends">DataFrames</th>
</tr>
</thead>
<tbody class="gt_table_body">
  <tr class="gt_group_heading_row">
    <th class="gt_group_heading" colspan="5" scope="colgroup" id="Returning-from-2025">Returning from 2025</th>
  </tr>
  <tr>
    <td headers="Returning-from-2025 lib" class="gt_row gt_left"><a href="https://github.com/unionai-oss/pandera">Pandera</a></td>
    <td headers="Returning-from-2025 version" class="gt_row gt_left">0.36.0</td>
    <td headers="Returning-from-2025 stars" class="gt_row gt_right">4,542</td>
    <td headers="Returning-from-2025 style" class="gt_row gt_left">Schema objects or class-based models</td>
    <td headers="Returning-from-2025 backends" class="gt_row gt_left">Polars, Pandas, PyArrow, Ibis, PySpark, DataFusion</td>
  </tr>
  <tr>
    <td headers="Returning-from-2025 lib" class="gt_row gt_left"><a href="https://github.com/JakobGM/patito">Patito</a></td>
    <td headers="Returning-from-2025 version" class="gt_row gt_left">0.8.6</td>
    <td headers="Returning-from-2025 stars" class="gt_row gt_right">644</td>
    <td headers="Returning-from-2025 style" class="gt_row gt_left">Pydantic-style models</td>
    <td headers="Returning-from-2025 backends" class="gt_row gt_left">Polars</td>
  </tr>
  <tr>
    <td headers="Returning-from-2025 lib" class="gt_row gt_left"><a href="https://github.com/posit-dev/pointblank">Pointblank</a></td>
    <td headers="Returning-from-2025 version" class="gt_row gt_left">1.3.0</td>
    <td headers="Returning-from-2025 stars" class="gt_row gt_right">506</td>
    <td headers="Returning-from-2025 style" class="gt_row gt_left">Chained validation steps with reports</td>
    <td headers="Returning-from-2025 backends" class="gt_row gt_left">Polars, Pandas, PySpark, DuckDB and other databases</td>
  </tr>
  <tr>
    <td headers="Returning-from-2025 lib" class="gt_row gt_left"><a href="https://github.com/akmalsoliev/Validoopsie">Validoopsie</a></td>
    <td headers="Returning-from-2025 version" class="gt_row gt_left">1.8.1</td>
    <td headers="Returning-from-2025 stars" class="gt_row gt_right">91</td>
    <td headers="Returning-from-2025 style" class="gt_row gt_left">Chained checks with impact levels</td>
    <td headers="Returning-from-2025 backends" class="gt_row gt_left">Anything Narwhals supports</td>
  </tr>
  <tr>
    <td headers="Returning-from-2025 lib" class="gt_row gt_left"><a href="https://github.com/Quantco/dataframely">Dataframely</a></td>
    <td headers="Returning-from-2025 version" class="gt_row gt_left">3.1.3</td>
    <td headers="Returning-from-2025 stars" class="gt_row gt_right">630</td>
    <td headers="Returning-from-2025 style" class="gt_row gt_left">Polars-native schema classes</td>
    <td headers="Returning-from-2025 backends" class="gt_row gt_left">Polars</td>
  </tr>
  <tr class="gt_group_heading_row">
    <th class="gt_group_heading" colspan="5" scope="colgroup" id="New-in-This-Edition">New in This Edition</th>
  </tr>
  <tr>
    <td headers="New-in-This-Edition lib" class="gt_row gt_left"><a href="https://github.com/vertti/daffy">Daffy</a></td>
    <td headers="New-in-This-Edition version" class="gt_row gt_left">3.3.0</td>
    <td headers="New-in-This-Edition stars" class="gt_row gt_right">60</td>
    <td headers="New-in-This-Edition style" class="gt_row gt_left">Decorators on functions</td>
    <td headers="New-in-This-Edition backends" class="gt_row gt_left">Polars, Pandas, Modin, PyArrow</td>
  </tr>
  <tr>
    <td headers="New-in-This-Edition lib" class="gt_row gt_left"><a href="https://github.com/CangyuanLi/checkedframe">checkedframe</a></td>
    <td headers="New-in-This-Edition version" class="gt_row gt_left">0.1.0</td>
    <td headers="New-in-This-Edition stars" class="gt_row gt_right">18</td>
    <td headers="New-in-This-Edition style" class="gt_row gt_left">Schema classes with flexible custom checks</td>
    <td headers="New-in-This-Edition backends" class="gt_row gt_left">Polars, Pandas, Modin, PyArrow, cuDF</td>
  </tr>
  <tr>
    <td headers="New-in-This-Edition lib" class="gt_row gt_left"><a href="https://github.com/kitagry/pavise">Pavise</a></td>
    <td headers="New-in-This-Edition version" class="gt_row gt_left">0.3.2</td>
    <td headers="New-in-This-Edition stars" class="gt_row gt_right">5</td>
    <td headers="New-in-This-Edition style" class="gt_row gt_left">Schemas as typing.Protocol classes</td>
    <td headers="New-in-This-Edition backends" class="gt_row gt_left">Polars, Pandas</td>
  </tr>
  <tr>
    <td headers="New-in-This-Edition lib" class="gt_row gt_left"><a href="https://github.com/MaxwellB13/polspec">polspec</a></td>
    <td headers="New-in-This-Edition version" class="gt_row gt_left">2.1.0</td>
    <td headers="New-in-This-Edition stars" class="gt_row gt_right">2</td>
    <td headers="New-in-This-Edition style" class="gt_row gt_left">One schema to validate and generate data</td>
    <td headers="New-in-This-Edition backends" class="gt_row gt_left">Polars 2</td>
  </tr>
</tbody>
</table>
</div>
<h2 id="the-test-case">The Test Case
</h2>
<p>To keep the comparison fair, every library in this survey validates the
same Polars DataFrame. It&rsquo;s the table from the 2025 edition, unchanged:
five users, each with an ID, an age, an email address, and a score. Two
of its rows have deliberate problems. The fifth user is 95 years old,
which is outside the age range we&rsquo;ll allow, and the third user&rsquo;s email
address isn&rsquo;t an email address at all.</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">polars</span> <span class="k">as</span> <span class="nn">pl</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">user_data</span> <span class="o">=</span> <span class="n">pl</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">({</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;user_id&#34;</span><span class="p">:</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">],</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;age&#34;</span><span class="p">:</span> <span class="p">[</span><span class="mi">25</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="mi">22</span><span class="p">,</span> <span class="mi">45</span><span class="p">,</span> <span class="mi">95</span><span class="p">],</span>  <span class="c1"># &lt;- includes a very high age</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;email&#34;</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl">        <span class="s2">&#34;user1@example.com&#34;</span><span class="p">,</span> <span class="s2">&#34;user2@example.com&#34;</span><span class="p">,</span> <span class="s2">&#34;invalid-email&#34;</span><span class="p">,</span>  <span class="c1"># &lt;- has an invalid email</span>
</span></span><span class="line"><span class="cl">        <span class="s2">&#34;user4@example.com&#34;</span><span class="p">,</span> <span class="s2">&#34;user5@example.com&#34;</span>
</span></span><span class="line"><span class="cl">    <span class="p">],</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;score&#34;</span><span class="p">:</span> <span class="p">[</span><span class="mf">85.5</span><span class="p">,</span> <span class="mf">92.0</span><span class="p">,</span> <span class="mf">78.3</span><span class="p">,</span> <span class="mf">88.7</span><span class="p">,</span> <span class="mf">95.2</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="p">})</span></span></span></code></pre></div></div>
<p>Each library will check the same five things. The columns should have
the expected types (integers for the ID and age, a string for the email,
a float for the score). Every <code>user_id</code> should be greater than zero,
every <code>age</code> should be between 18 and 80, every <code>email</code> should match a
simple email pattern, and every <code>score</code> should be between 0 and 100.
There are exactly two problems to find. What makes the comparison
interesting is how differently each one finds those problems, reports
them, and lets you deal with them.</p>
<h2 id="pandera">Pandera
</h2>
<p><strong>Pandera</strong> is the oldest and most widely used library in this survey,
and it keeps getting broader. Polars support arrived in early 2024, and
since the last survey the project has added a Narwhals-based backend
(<code>v0.32.0</code>, June 2026), first-class validation of PyArrow tables
(<code>v0.33.0</code>), and support for Apache DataFusion (<code>v0.35.0</code>). The Narwhals
backend lets Pandera&rsquo;s Polars, Ibis, and PySpark schemas share one
implementation instead of maintaining three, which makes it clear that
working across DataFrame libraries is a priority for the project.</p>
<p>The schema itself looks just as it did in 2025. Each column gets a type
and a list of checks, and you apply the schema to the data with
<code>validate()</code>:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pandera.polars</span> <span class="k">as</span> <span class="nn">pa</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="n">pa</span><span class="o">.</span><span class="n">DataFrameSchema</span><span class="p">({</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;user_id&#34;</span><span class="p">:</span> <span class="n">pa</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">pl</span><span class="o">.</span><span class="n">Int64</span><span class="p">,</span> <span class="n">checks</span><span class="o">=</span><span class="n">pa</span><span class="o">.</span><span class="n">Check</span><span class="o">.</span><span class="n">gt</span><span class="p">(</span><span class="mi">0</span><span class="p">)),</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;age&#34;</span><span class="p">:</span> <span class="n">pa</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">pl</span><span class="o">.</span><span class="n">Int64</span><span class="p">,</span> <span class="n">checks</span><span class="o">=</span><span class="p">[</span><span class="n">pa</span><span class="o">.</span><span class="n">Check</span><span class="o">.</span><span class="n">ge</span><span class="p">(</span><span class="mi">18</span><span class="p">),</span> <span class="n">pa</span><span class="o">.</span><span class="n">Check</span><span class="o">.</span><span class="n">le</span><span class="p">(</span><span class="mi">80</span><span class="p">)]),</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;email&#34;</span><span class="p">:</span> <span class="n">pa</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">pl</span><span class="o">.</span><span class="n">String</span><span class="p">,</span> <span class="n">checks</span><span class="o">=</span><span class="n">pa</span><span class="o">.</span><span class="n">Check</span><span class="o">.</span><span class="n">str_matches</span><span class="p">(</span><span class="sa">r</span><span class="s2">&#34;^[^@]+@[^@]+\.[^@]+$&#34;</span><span class="p">)),</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;score&#34;</span><span class="p">:</span> <span class="n">pa</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">pl</span><span class="o">.</span><span class="n">Float64</span><span class="p">,</span> <span class="n">checks</span><span class="o">=</span><span class="n">pa</span><span class="o">.</span><span class="n">Check</span><span class="o">.</span><span class="n">in_range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">100</span><span class="p">))</span>
</span></span><span class="line"><span class="cl"><span class="p">})</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">try</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">    <span class="n">schema</span><span class="o">.</span><span class="n">validate</span><span class="p">(</span><span class="n">user_data</span><span class="p">,</span> <span class="n">lazy</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="k">except</span> <span class="n">pa</span><span class="o">.</span><span class="n">errors</span><span class="o">.</span><span class="n">SchemaErrors</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">    <span class="nb">print</span><span class="p">(</span><span class="n">e</span><span class="o">.</span><span class="n">failure_cases</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code>shape: (2, 6)
┌───────────────┬────────────────┬────────┬─────────────────────────────────┬──────────────┬───────┐
│ failure_case  ┆ schema_context ┆ column ┆ check                           ┆ check_number ┆ index │
│ ---           ┆ ---            ┆ ---    ┆ ---                             ┆ ---          ┆ ---   │
│ str           ┆ str            ┆ str    ┆ str                             ┆ i32          ┆ i32   │
╞═══════════════╪════════════════╪════════╪═════════════════════════════════╪══════════════╪═══════╡
│ 95            ┆ Column         ┆ age    ┆ less_than_or_equal_to(80)       ┆ 1            ┆ 4     │
│ invalid-email ┆ Column         ┆ email  ┆ str_matches('^[^@]+@[^@]+\.[^@… ┆ 0            ┆ 2     │
└───────────────┴────────────────┴────────┴─────────────────────────────────┴──────────────┴───────┘
</code></pre>
<p>We need to correct something we said in 2025. We wrote then that
<strong>Pandera</strong> stops at the first failure, and while that is its default
behavior, passing <code>lazy=True</code> makes it run every check and collect all
of the failures before raising (<em>lazy</em> here means holding back the error
until every check has run). The result is the table above, a Polars
DataFrame of failure cases with the offending value, the column, the
check that failed, and the row index. Because the failures are
themselves data, you can filter them, join them back to the original
table, or write them to a log with the tools you already use.</p>
<p>What still sets <strong>Pandera</strong> apart is its statistical checks. A schema
can include hypothesis tests (a two-sample t-test between groups, for
instance), which makes it a good fit for data science work where the
distribution of a column matters as much as its individual values. It
also offers a class-based <code>DataFrameModel</code> API that works with static
type checkers, so the same schema can describe a function&rsquo;s inputs and
outputs as well as validate them at runtime.</p>
<h2 id="patito">Patito
</h2>
<p><strong>Patito</strong> brings the model-based style of Pydantic to DataFrames. A
schema is a class, each column is an annotated attribute, and
constraints use the same <code>Field</code> syntax that Pydantic users already
know:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">patito</span> <span class="k">as</span> <span class="nn">pt</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Annotated</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">class</span> <span class="nc">UserModel</span><span class="p">(</span><span class="n">pt</span><span class="o">.</span><span class="n">Model</span><span class="p">):</span>
</span></span><span class="line"><span class="cl">    <span class="n">user_id</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="n">pt</span><span class="o">.</span><span class="n">Field</span><span class="p">(</span><span class="n">gt</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="n">age</span><span class="p">:</span> <span class="n">Annotated</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="n">pt</span><span class="o">.</span><span class="n">Field</span><span class="p">(</span><span class="n">ge</span><span class="o">=</span><span class="mi">18</span><span class="p">,</span> <span class="n">le</span><span class="o">=</span><span class="mi">80</span><span class="p">)]</span>
</span></span><span class="line"><span class="cl">    <span class="n">email</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="n">pt</span><span class="o">.</span><span class="n">Field</span><span class="p">(</span><span class="n">pattern</span><span class="o">=</span><span class="sa">r</span><span class="s2">&#34;^[^@]+@[^@]+\.[^@]+$&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="n">score</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="n">pt</span><span class="o">.</span><span class="n">Field</span><span class="p">(</span><span class="n">ge</span><span class="o">=</span><span class="mf">0.0</span><span class="p">,</span> <span class="n">le</span><span class="o">=</span><span class="mf">100.0</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">try</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">    <span class="n">UserModel</span><span class="o">.</span><span class="n">validate</span><span class="p">(</span><span class="n">user_data</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="k">except</span> <span class="n">pt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">DataFrameValidationError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">    <span class="nb">print</span><span class="p">(</span><span class="n">e</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code>2 validation errors for UserModel
age
  1 row with out of bound values. (type=value_error.rowvalue)
email
  1 row with out of bound values. (type=value_error.rowvalue)
</code></pre>
<p><strong>Patito</strong> reports every failure in a single pass, grouped by column,
and its messages read like Pydantic&rsquo;s own. The library has changed less
than the others since 2025 (its most recent release, <code>v0.8.6</code>, came out
in February), which makes sense for a tool that already does what it
sets out to do. It&rsquo;s still Polars-only, and it still has its most
distinctive feature: you can turn the rows of a validated DataFrame into
instances of the model, complete with any methods or properties you
define on the class. That&rsquo;s handy in applications that already use
Pydantic and need to treat the same records both as a table and as
objects. Its <code>.examples()</code> method, which generates valid test data from
a model, is also worth knowing about.</p>
<h2 id="pointblank">Pointblank
</h2>
<p><strong>Pointblank</strong>, which we develop at Posit, treats validation as a series
of steps and collects the results into a report. Each step is a method
on a <code>Validate</code> object, thresholds decide how many failing rows trigger
a warning, an error, or a critical state, and <code>interrogate()</code> runs the
whole plan:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pointblank</span> <span class="k">as</span> <span class="nn">pb</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="n">pb</span><span class="o">.</span><span class="n">Schema</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">columns</span><span class="o">=</span><span class="p">[(</span><span class="s2">&#34;user_id&#34;</span><span class="p">,</span> <span class="s2">&#34;Int64&#34;</span><span class="p">),</span> <span class="p">(</span><span class="s2">&#34;age&#34;</span><span class="p">,</span> <span class="s2">&#34;Int64&#34;</span><span class="p">),</span> <span class="p">(</span><span class="s2">&#34;email&#34;</span><span class="p">,</span> <span class="s2">&#34;String&#34;</span><span class="p">),</span> <span class="p">(</span><span class="s2">&#34;score&#34;</span><span class="p">,</span> <span class="s2">&#34;Float64&#34;</span><span class="p">)]</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">validation</span> <span class="o">=</span> <span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">pb</span><span class="o">.</span><span class="n">Validate</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">user_data</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s2">&#34;An example.&#34;</span><span class="p">,</span> <span class="n">tbl_name</span><span class="o">=</span><span class="s2">&#34;users&#34;</span><span class="p">,</span> <span class="n">thresholds</span><span class="o">=</span><span class="p">(</span><span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.3</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">col_vals_gt</span><span class="p">(</span><span class="n">columns</span><span class="o">=</span><span class="s2">&#34;user_id&#34;</span><span class="p">,</span> <span class="n">value</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">col_vals_between</span><span class="p">(</span><span class="n">columns</span><span class="o">=</span><span class="s2">&#34;age&#34;</span><span class="p">,</span> <span class="n">left</span><span class="o">=</span><span class="mi">18</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="mi">80</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">col_vals_regex</span><span class="p">(</span><span class="n">columns</span><span class="o">=</span><span class="s2">&#34;email&#34;</span><span class="p">,</span> <span class="n">pattern</span><span class="o">=</span><span class="sa">r</span><span class="s2">&#34;^[^@]+@[^@]+\.[^@]+$&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">col_vals_between</span><span class="p">(</span><span class="n">columns</span><span class="o">=</span><span class="s2">&#34;score&#34;</span><span class="p">,</span> <span class="n">left</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="mi">100</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">col_schema_match</span><span class="p">(</span><span class="n">schema</span><span class="o">=</span><span class="n">schema</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">interrogate</span><span class="p">()</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">validation</span></span></span></code></pre></div></div>
<div id="pb_tbl" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
<style>
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans&display=swap');
#pb_tbl table {
          font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }
#pb_tbl thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#pb_tbl p { margin: 0; padding: 0; }
 #pb_tbl .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 90%; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }
 #pb_tbl .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #pb_tbl .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
 #pb_tbl .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
 #pb_tbl .gt_heading { background-color: #FFFFFF; text-align: left; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #pb_tbl .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #pb_tbl .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #pb_tbl .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; overflow-x: hidden; }
 #pb_tbl .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
 #pb_tbl .gt_column_spanner_outer:first-child { padding-left: 0; }
 #pb_tbl .gt_column_spanner_outer:last-child { padding-right: 0; }
 #pb_tbl .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
 #pb_tbl .gt_spanner_row { border-bottom-style: hidden; }
 #pb_tbl .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }
 #pb_tbl .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }
 #pb_tbl .gt_from_md> :first-child { margin-top: 0; }
 #pb_tbl .gt_from_md> :last-child { margin-bottom: 0; }
 #pb_tbl .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }
 #pb_tbl .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; }
 #pb_tbl .gt_indent_1 { text-indent: 5px; }
 #pb_tbl .gt_indent_2 { text-indent: calc(5px * 2); }
 #pb_tbl .gt_indent_3 { text-indent: calc(5px * 3); }
 #pb_tbl .gt_indent_4 { text-indent: calc(5px * 4); }
 #pb_tbl .gt_indent_5 { text-indent: calc(5px * 5); }
 #pb_tbl .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; vertical-align: top; }
 #pb_tbl .gt_row_group_first td { border-top-width: 2px; }
 #pb_tbl .gt_row_group_first th { border-top-width: 2px; }
 #pb_tbl .gt_striped { color: #333333; background-color: #F4F4F4; }
 #pb_tbl .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #pb_tbl .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #pb_tbl .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #pb_tbl .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #pb_tbl .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #pb_tbl .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #pb_tbl .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #pb_tbl .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #pb_tbl .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #pb_tbl .gt_left { text-align: left; }
 #pb_tbl .gt_center { text-align: center; }
 #pb_tbl .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #pb_tbl .gt_font_normal { font-weight: normal; }
 #pb_tbl .gt_font_bold { font-weight: bold; }
 #pb_tbl .gt_font_italic { font-style: italic; }
 #pb_tbl .gt_super { font-size: 65%; }
 #pb_tbl .gt_footnotes { color: font-color(#FFFFFF); background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #pb_tbl .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #pb_tbl .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #pb_tbl .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #pb_tbl .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #pb_tbl .gt_asterisk { font-size: 100%; vertical-align: 0; }
</style>
<table style="table-layout: fixed;; width: 0px" class="gt_table" aria-labelledby="pb_tbl-title" aria-describedby="pb_tbl-subtitle" data-quarto-disable-processing="true" data-quarto-bootstrap="false">
<colgroup>
  <col style="width:4px;"/>
  <col style="width:35px;"/>
  <col style="width:190px;"/>
  <col style="width:120px;"/>
  <col style="width:120px;"/>
  <col style="width:50px;"/>
  <col style="width:50px;"/>
  <col style="width:60px;"/>
  <col style="width:60px;"/>
  <col style="width:60px;"/>
  <col style="width:30px;"/>
  <col style="width:30px;"/>
  <col style="width:30px;"/>
  <col style="width:65px;"/>
</colgroup>
<thead>
  <tr class="gt_heading">
    <td colspan="14" class="gt_heading gt_title gt_font_normal" id="pb_tbl-title" style="color: #444444;font-size: 28px;text-align: left;font-weight: bold; text-align: left;">Pointblank Validation</td>
  </tr>
  <tr class="gt_heading">
    <td colspan="14" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border" id="pb_tbl-subtitle" style="text-align: left;"><div><span style='text-decoration-style: solid; text-decoration-color: #ADD8E6; text-decoration-line: underline; text-underline-position: under; color: #333333; font-variant-numeric: tabular-nums; padding-left: 4px; margin-right: 5px; padding-right: 2px;'>An example.</span><div style="padding-top: 10px; padding-bottom: 5px;"><span style='background-color: #0075FF; color: #FFFFFF; padding: 0.5em 0.5em; position: inherit; text-transform: uppercase; margin: 5px 0px 5px 0px; border: solid 1px #0075FF; font-weight: bold; padding: 2px 15px 2px 15px; font-size: 10px;'>Polars</span><span style='background-color: none; color: #222222; padding: 0.5em 0.5em; position: inherit; margin: 5px 10px 5px -4px; border: solid 1px #0075FF; font-weight: bold; padding: 2px 15px 2px 15px; font-size: 10px;'>users</span><span><span style="background-color: #AAAAAA; color: white; padding: 0.5em 0.5em; position: inherit; text-transform: uppercase; margin: 5px 0px 5px 5px; border: solid 1px #AAAAAA; font-weight: bold; padding: 2px 15px 2px 15px; font-size: smaller;">WARNING</span><span style="background-color: none; color: #333333; padding: 0.5em 0.5em; position: inherit; margin: 5px 0px 5px -4px; font-weight: bold; border: solid 1px #AAAAAA; padding: 2px 15px 2px 15px; font-size: smaller; margin-right: 5px;">0.1</span><span style="background-color: #EBBC14; color: white; padding: 0.5em 0.5em; position: inherit; text-transform: uppercase; margin: 5px 0px 5px 1px; border: solid 1px #EBBC14; font-weight: bold; padding: 2px 15px 2px 15px; font-size: smaller;">ERROR</span><span style="background-color: none; color: #333333; padding: 0.5em 0.5em; position: inherit; margin: 5px 0px 5px -4px; font-weight: bold; border: solid 1px #EBBC14; padding: 2px 15px 2px 15px; font-size: smaller; margin-right: 5px;">0.2</span><span style="background-color: #FF3300; color: white; padding: 0.5em 0.5em; position: inherit; text-transform: uppercase; margin: 5px 0px 5px 1px; border: solid 1px #FF3300; font-weight: bold; padding: 2px 15px 2px 15px; font-size: smaller;">CRITICAL</span><span style="background-color: none; color: #333333; padding: 0.5em 0.5em; position: inherit; margin: 5px 0px 5px -4px; font-weight: bold; border: solid 1px #FF3300; padding: 2px 15px 2px 15px; font-size: smaller;">0.3</span></span></div></div></td>
  </tr>
<tr class="gt_col_headings">
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-status_color"></th>
  <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-i"></th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-type_upd">STEP</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-columns_upd">COLUMNS</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-values_upd">VALUES</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-tbl">TBL</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-eval">EVAL</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-test_units">UNITS</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-pass">PASS</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-fail">FAIL</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-w_upd">W</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-e_upd">E</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-c_upd">C</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-extract_upd">EXT</th>
</tr>
</thead>
<tbody class="gt_table_body">
  <tr>
    <td style="height: 40px; background-color: #4CA64C; color: transparent;font-size: 0px;" headers="pb_tbl-status_color" class="gt_row gt_left">#4CA64C</td>
    <td style="height: 40px; color: #666666;font-size: 13px;font-weight: bold;" headers="pb_tbl-i" class="gt_row gt_right">1</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" headers="pb_tbl-type_upd" class="gt_row gt_left">
        <div style="margin: 0; padding: 0; display: inline-block; height: 30px; vertical-align: middle; width: 16%;">
            <!--?xml version="1.0" encoding="UTF-8"?--><?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="30px" viewBox="0 0 67 67" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="background: #FFFFFF;">
    <title>col_vals_gt</title>
    <g id="pb_tbl-type_upd-0-Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="pb_tbl-type_upd-0-col_vals_gt" transform="translate(1.500000, 1.500000)" fill-rule="nonzero">
            <path d="M55,0 C57.4852813,0 59.7352813,1.00735931 61.363961,2.63603897 C62.9926407,4.26471863 64,6.51471863 64,9 L64,9 L64,64 L9,64 C6.51471862,64 4.26471862,62.9926407 2.63603897,61.363961 C1.00735931,59.7352814 0,57.4852814 0,55 L0,55 L0,9 C0,6.51471863 1.00735931,4.26471863 2.63603897,2.63603897 C4.26471862,1.00735931 6.51471862,0 9,0 L9,0 L55,0 Z" id="pb_tbl-type_upd-0-rectangle" stroke="#000000" stroke-width="2" fill="#FFFFFF"></path>
            <path d="M48.7619048,10 L15.2380953,10 C12.3466667,10 10,12.3466667 10,15.2380952 L10,48.7619048 C10,51.6533333 12.3466667,54 15.2380953,54 L48.7619048,54 C51.6533333,54 54,51.6533333 54,48.7619048 L54,15.2380952 C54,12.3466667 51.6533333,10 48.7619048,10 Z M25.2638095,44.3828571 L24.0695238,42.6647619 L39.5847619,32 L24.0695238,21.3352381 L25.2638095,19.6171429 L43.2828572,32 L25.2638095,44.3828571 Z" id="pb_tbl-type_upd-0-greater_than" fill="#000000"></path>
        </g>
    </g>
</svg>
        </div>
        <div style="font-family: 'IBM Plex Mono', monospace, courier; color: black; font-size: 11px; display: inline-block; vertical-align: middle;">
            <div>col_vals_gt()</div>
        </div>
        </td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_tbl-columns_upd" class="gt_row gt_left">user_id</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_tbl-values_upd" class="gt_row gt_left">0</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" headers="pb_tbl-tbl" class="gt_row gt_center"><svg width="25px" height="25px" viewBox="0 0 25 25" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="vertical-align: middle;">
    <g id="pb_tbl-tbl-0-unchanged" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="pb_tbl-tbl-0-unchanged" transform="translate(0.500000, 0.570147)">
            <rect id="pb_tbl-tbl-0-Rectangle" x="0.125132506" y="0" width="23.749735" height="23.7894737"></rect>
            <path d="M5.80375046,8.18194736 C3.77191832,8.18194736 2.11875046,9.83495328 2.11875046,11.8669474 C2.11875046,13.8989414 3.77191832,15.5519474 5.80375046,15.5519474 C7.8355826,15.5519474 9.48875046,13.8989414 9.48875046,11.8669474 C9.48875046,9.83495328 7.83552863,8.18194736 5.80375046,8.18194736 Z M5.80375046,14.814915 C4.17821997,14.814915 2.85578285,13.4924778 2.85578285,11.8669474 C2.85578285,10.2414169 4.17821997,8.91897975 5.80375046,8.91897975 C7.42928095,8.91897975 8.75171807,10.2414169 8.75171807,11.8669474 C8.75171807,13.4924778 7.42928095,14.814915 5.80375046,14.814915 Z" id="pb_tbl-tbl-0-Shape" fill="#000000" fill-rule="nonzero"></path>
            <path d="M13.9638189,8.699335 C13.9364621,8.70430925 13.9091059,8.71176968 13.8842359,8.71923074 C13.7822704,8.73663967 13.6877654,8.77643115 13.6056956,8.83860518 L10.2433156,11.3852598 C10.0766886,11.5046343 9.97720993,11.6986181 9.97720993,11.9025491 C9.97720993,12.1064807 10.0766886,12.3004639 10.2433156,12.4198383 L13.6056956,14.966493 C13.891697,15.1803725 14.2970729,15.1231721 14.5109517,14.8371707 C14.7248313,14.5511692 14.6676309,14.145794 14.3816294,13.9319145 L12.5313257,12.5392127 L21.8812495,12.5392127 L21.8812495,11.2658854 L12.5313257,11.2658854 L14.3816294,9.87318364 C14.6377872,9.71650453 14.7497006,9.40066014 14.6477351,9.11714553 C14.5482564,8.83363156 14.262255,8.65954352 13.9638189,8.699335 Z" id="pb_tbl-tbl-0-arrow" fill="#000000" transform="translate(15.929230, 11.894737) rotate(-180.000000) translate(-15.929230, -11.894737) "></path>
        </g>
    </g>
</svg></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" headers="pb_tbl-eval" class="gt_row gt_center"><span style="color:#4CA64C;">&check;</span></td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" headers="pb_tbl-test_units" class="gt_row gt_right">5</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" headers="pb_tbl-pass" class="gt_row gt_right">5<br />1.00</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" headers="pb_tbl-fail" class="gt_row gt_right">0<br />0.00</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" headers="pb_tbl-w_upd" class="gt_row gt_center"><span style="color: #AAAAAA;">&cir;</span></td>
    <td style="height: 40px; background-color: #FCFCFC;" headers="pb_tbl-e_upd" class="gt_row gt_center"><span style="color: #EBBC14;">&cir;</span></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" headers="pb_tbl-c_upd" class="gt_row gt_center"><span style="color: #FF3300;">&cir;</span></td>
    <td style="height: 40px;" headers="pb_tbl-extract_upd" class="gt_row gt_center">—</td>
  </tr>
  <tr>
    <td style="height: 40px; background-color: #EBBC14; color: transparent;font-size: 0px;" headers="pb_tbl-status_color" class="gt_row gt_left">#EBBC14</td>
    <td style="height: 40px; color: #666666;font-size: 13px;font-weight: bold;" headers="pb_tbl-i" class="gt_row gt_right">2</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" headers="pb_tbl-type_upd" class="gt_row gt_left">
        <div style="margin: 0; padding: 0; display: inline-block; height: 30px; vertical-align: middle; width: 16%;">
            <!--?xml version="1.0" encoding="UTF-8"?--><?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="30px" viewBox="0 0 67 67" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>col_vals_between</title>
    <g id="pb_tbl-type_upd-1-Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="pb_tbl-type_upd-1-col_vals_between" transform="translate(0.000000, 0.206897)">
            <path d="M56.712234,1 C59.1975153,1 61.4475153,2.00735931 63.076195,3.63603897 C64.7048747,5.26471863 65.712234,7.51471863 65.712234,10 L65.712234,10 L65.712234,65 L10.712234,65 C8.22695259,65 5.97695259,63.9926407 4.34827294,62.363961 C2.71959328,60.7352814 1.71223397,58.4852814 1.71223397,56 L1.71223397,56 L1.71223397,10 C1.71223397,7.51471863 2.71959328,5.26471863 4.34827294,3.63603897 C5.97695259,2.00735931 8.22695259,1 10.712234,1 L10.712234,1 Z" id="pb_tbl-type_upd-1-rectangle" stroke="#000000" stroke-width="2" fill="#FFFFFF"></path>
            <path d="M11.993484,21.96875 C10.962234,22.082031 10.188797,22.964844 10.212234,24 L10.212234,42 C10.200515,42.722656 10.579422,43.390625 11.204422,43.753906 C11.825515,44.121094 12.598953,44.121094 13.220047,43.753906 C13.845047,43.390625 14.223953,42.722656 14.212234,42 L14.212234,24 C14.220047,23.457031 14.009109,22.9375 13.626297,22.554688 C13.243484,22.171875 12.723953,21.960938 12.180984,21.96875 C12.118484,21.964844 12.055984,21.964844 11.993484,21.96875 Z M55.993484,21.96875 C54.962234,22.082031 54.188797,22.964844 54.212234,24 L54.212234,42 C54.200515,42.722656 54.579422,43.390625 55.204422,43.753906 C55.825515,44.121094 56.598953,44.121094 57.220047,43.753906 C57.845047,43.390625 58.223953,42.722656 58.212234,42 L58.212234,24 C58.220047,23.457031 58.009109,22.9375 57.626297,22.554688 C57.243484,22.171875 56.723953,21.960938 56.180984,21.96875 C56.118484,21.964844 56.055984,21.964844 55.993484,21.96875 Z M16.212234,22 C15.661453,22 15.212234,22.449219 15.212234,23 C15.212234,23.550781 15.661453,24 16.212234,24 C16.763015,24 17.212234,23.550781 17.212234,23 C17.212234,22.449219 16.763015,22 16.212234,22 Z M20.212234,22 C19.661453,22 19.212234,22.449219 19.212234,23 C19.212234,23.550781 19.661453,24 20.212234,24 C20.763015,24 21.212234,23.550781 21.212234,23 C21.212234,22.449219 20.763015,22 20.212234,22 Z M24.212234,22 C23.661453,22 23.212234,22.449219 23.212234,23 C23.212234,23.550781 23.661453,24 24.212234,24 C24.763015,24 25.212234,23.550781 25.212234,23 C25.212234,22.449219 24.763015,22 24.212234,22 Z M28.212234,22 C27.661453,22 27.212234,22.449219 27.212234,23 C27.212234,23.550781 27.661453,24 28.212234,24 C28.763015,24 29.212234,23.550781 29.212234,23 C29.212234,22.449219 28.763015,22 28.212234,22 Z M32.212234,22 C31.661453,22 31.212234,22.449219 31.212234,23 C31.212234,23.550781 31.661453,24 32.212234,24 C32.763015,24 33.212234,23.550781 33.212234,23 C33.212234,22.449219 32.763015,22 32.212234,22 Z M36.212234,22 C35.661453,22 35.212234,22.449219 35.212234,23 C35.212234,23.550781 35.661453,24 36.212234,24 C36.763015,24 37.212234,23.550781 37.212234,23 C37.212234,22.449219 36.763015,22 36.212234,22 Z M40.212234,22 C39.661453,22 39.212234,22.449219 39.212234,23 C39.212234,23.550781 39.661453,24 40.212234,24 C40.763015,24 41.212234,23.550781 41.212234,23 C41.212234,22.449219 40.763015,22 40.212234,22 Z M44.212234,22 C43.661453,22 43.212234,22.449219 43.212234,23 C43.212234,23.550781 43.661453,24 44.212234,24 C44.763015,24 45.212234,23.550781 45.212234,23 C45.212234,22.449219 44.763015,22 44.212234,22 Z M48.212234,22 C47.661453,22 47.212234,22.449219 47.212234,23 C47.212234,23.550781 47.661453,24 48.212234,24 C48.763015,24 49.212234,23.550781 49.212234,23 C49.212234,22.449219 48.763015,22 48.212234,22 Z M52.212234,22 C51.661453,22 51.212234,22.449219 51.212234,23 C51.212234,23.550781 51.661453,24 52.212234,24 C52.763015,24 53.212234,23.550781 53.212234,23 C53.212234,22.449219 52.763015,22 52.212234,22 Z M21.462234,27.96875 C21.419265,27.976563 21.376297,27.988281 21.337234,28 C21.177078,28.027344 21.02864,28.089844 20.899734,28.1875 L15.618484,32.1875 C15.356765,32.375 15.200515,32.679688 15.200515,33 C15.200515,33.320313 15.356765,33.625 15.618484,33.8125 L20.899734,37.8125 C21.348953,38.148438 21.985672,38.058594 22.321609,37.609375 C22.657547,37.160156 22.567703,36.523438 22.118484,36.1875 L19.212234,34 L49.212234,34 L46.305984,36.1875 C45.856765,36.523438 45.766922,37.160156 46.102859,37.609375 C46.438797,38.058594 47.075515,38.148438 47.524734,37.8125 L52.805984,33.8125 C53.067703,33.625 53.223953,33.320313 53.223953,33 C53.223953,32.679688 53.067703,32.375 52.805984,32.1875 L47.524734,28.1875 C47.30989,28.027344 47.040359,27.960938 46.774734,28 C46.743484,28 46.712234,28 46.680984,28 C46.282547,28.074219 45.96614,28.382813 45.884109,28.78125 C45.802078,29.179688 45.970047,29.585938 46.305984,29.8125 L49.212234,32 L19.212234,32 L22.118484,29.8125 C22.520828,29.566406 22.696609,29.070313 22.536453,28.625 C22.380203,28.179688 21.930984,27.90625 21.462234,27.96875 Z M16.212234,42 C15.661453,42 15.212234,42.449219 15.212234,43 C15.212234,43.550781 15.661453,44 16.212234,44 C16.763015,44 17.212234,43.550781 17.212234,43 C17.212234,42.449219 16.763015,42 16.212234,42 Z M20.212234,42 C19.661453,42 19.212234,42.449219 19.212234,43 C19.212234,43.550781 19.661453,44 20.212234,44 C20.763015,44 21.212234,43.550781 21.212234,43 C21.212234,42.449219 20.763015,42 20.212234,42 Z M24.212234,42 C23.661453,42 23.212234,42.449219 23.212234,43 C23.212234,43.550781 23.661453,44 24.212234,44 C24.763015,44 25.212234,43.550781 25.212234,43 C25.212234,42.449219 24.763015,42 24.212234,42 Z M28.212234,42 C27.661453,42 27.212234,42.449219 27.212234,43 C27.212234,43.550781 27.661453,44 28.212234,44 C28.763015,44 29.212234,43.550781 29.212234,43 C29.212234,42.449219 28.763015,42 28.212234,42 Z M32.212234,42 C31.661453,42 31.212234,42.449219 31.212234,43 C31.212234,43.550781 31.661453,44 32.212234,44 C32.763015,44 33.212234,43.550781 33.212234,43 C33.212234,42.449219 32.763015,42 32.212234,42 Z M36.212234,42 C35.661453,42 35.212234,42.449219 35.212234,43 C35.212234,43.550781 35.661453,44 36.212234,44 C36.763015,44 37.212234,43.550781 37.212234,43 C37.212234,42.449219 36.763015,42 36.212234,42 Z M40.212234,42 C39.661453,42 39.212234,42.449219 39.212234,43 C39.212234,43.550781 39.661453,44 40.212234,44 C40.763015,44 41.212234,43.550781 41.212234,43 C41.212234,42.449219 40.763015,42 40.212234,42 Z M44.212234,42 C43.661453,42 43.212234,42.449219 43.212234,43 C43.212234,43.550781 43.661453,44 44.212234,44 C44.763015,44 45.212234,43.550781 45.212234,43 C45.212234,42.449219 44.763015,42 44.212234,42 Z M48.212234,42 C47.661453,42 47.212234,42.449219 47.212234,43 C47.212234,43.550781 47.661453,44 48.212234,44 C48.763015,44 49.212234,43.550781 49.212234,43 C49.212234,42.449219 48.763015,42 48.212234,42 Z M52.212234,42 C51.661453,42 51.212234,42.449219 51.212234,43 C51.212234,43.550781 51.661453,44 52.212234,44 C52.763015,44 53.212234,43.550781 53.212234,43 C53.212234,42.449219 52.763015,42 52.212234,42 Z" id="pb_tbl-type_upd-1-inside_range" fill="#000000" fill-rule="nonzero"></path>
        </g>
    </g>
</svg>
        </div>
        <div style="font-family: 'IBM Plex Mono', monospace, courier; color: black; font-size: 10px; display: inline-block; vertical-align: middle;">
            <div>col_vals_between()</div>
        </div>
        </td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_tbl-columns_upd" class="gt_row gt_left">age</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_tbl-values_upd" class="gt_row gt_left">[18, 80]</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" headers="pb_tbl-tbl" class="gt_row gt_center"><svg width="25px" height="25px" viewBox="0 0 25 25" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="vertical-align: middle;">
    <g id="pb_tbl-tbl-1-unchanged" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="pb_tbl-tbl-1-unchanged" transform="translate(0.500000, 0.570147)">
            <rect id="pb_tbl-tbl-1-Rectangle" x="0.125132506" y="0" width="23.749735" height="23.7894737"></rect>
            <path d="M5.80375046,8.18194736 C3.77191832,8.18194736 2.11875046,9.83495328 2.11875046,11.8669474 C2.11875046,13.8989414 3.77191832,15.5519474 5.80375046,15.5519474 C7.8355826,15.5519474 9.48875046,13.8989414 9.48875046,11.8669474 C9.48875046,9.83495328 7.83552863,8.18194736 5.80375046,8.18194736 Z M5.80375046,14.814915 C4.17821997,14.814915 2.85578285,13.4924778 2.85578285,11.8669474 C2.85578285,10.2414169 4.17821997,8.91897975 5.80375046,8.91897975 C7.42928095,8.91897975 8.75171807,10.2414169 8.75171807,11.8669474 C8.75171807,13.4924778 7.42928095,14.814915 5.80375046,14.814915 Z" id="pb_tbl-tbl-1-Shape" fill="#000000" fill-rule="nonzero"></path>
            <path d="M13.9638189,8.699335 C13.9364621,8.70430925 13.9091059,8.71176968 13.8842359,8.71923074 C13.7822704,8.73663967 13.6877654,8.77643115 13.6056956,8.83860518 L10.2433156,11.3852598 C10.0766886,11.5046343 9.97720993,11.6986181 9.97720993,11.9025491 C9.97720993,12.1064807 10.0766886,12.3004639 10.2433156,12.4198383 L13.6056956,14.966493 C13.891697,15.1803725 14.2970729,15.1231721 14.5109517,14.8371707 C14.7248313,14.5511692 14.6676309,14.145794 14.3816294,13.9319145 L12.5313257,12.5392127 L21.8812495,12.5392127 L21.8812495,11.2658854 L12.5313257,11.2658854 L14.3816294,9.87318364 C14.6377872,9.71650453 14.7497006,9.40066014 14.6477351,9.11714553 C14.5482564,8.83363156 14.262255,8.65954352 13.9638189,8.699335 Z" id="pb_tbl-tbl-1-arrow" fill="#000000" transform="translate(15.929230, 11.894737) rotate(-180.000000) translate(-15.929230, -11.894737) "></path>
        </g>
    </g>
</svg></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" headers="pb_tbl-eval" class="gt_row gt_center"><span style="color:#4CA64C;">&check;</span></td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" headers="pb_tbl-test_units" class="gt_row gt_right">5</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" headers="pb_tbl-pass" class="gt_row gt_right">4<br />0.80</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" headers="pb_tbl-fail" class="gt_row gt_right">1<br />0.20</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" headers="pb_tbl-w_upd" class="gt_row gt_center"><span style="color: #AAAAAA;">&#9679;</span></td>
    <td style="height: 40px; background-color: #FCFCFC;" headers="pb_tbl-e_upd" class="gt_row gt_center"><span style="color: #EBBC14;">&#9679;</span></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" headers="pb_tbl-c_upd" class="gt_row gt_center"><span style="color: #FF3300;">&cir;</span></td>
    <td style="height: 40px;" headers="pb_tbl-extract_upd" class="gt_row gt_center"><a href="data:text/csv;base64,X3Jvd19udW1fLHVzZXJfaWQsYWdlLGVtYWlsLHNjb3JlCjUsNSw5NSx1c2VyNUBleGFtcGxlLmNvbSw5NS4yCg==" download="extract_0002.csv"><button style="background-color: #67C2DC; color: #FFFFFF; border: none; padding: 5px; font-weight: bold; cursor: pointer; border-radius: 4px;">CSV</button></a></td>
  </tr>
  <tr>
    <td style="height: 40px; background-color: #EBBC14; color: transparent;font-size: 0px;" headers="pb_tbl-status_color" class="gt_row gt_left">#EBBC14</td>
    <td style="height: 40px; color: #666666;font-size: 13px;font-weight: bold;" headers="pb_tbl-i" class="gt_row gt_right">3</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" headers="pb_tbl-type_upd" class="gt_row gt_left">
        <div style="margin: 0; padding: 0; display: inline-block; height: 30px; vertical-align: middle; width: 16%;">
            <!--?xml version="1.0" encoding="UTF-8"?--><?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="30px" viewBox="0 0 67 67" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>col_vals_regex</title>
    <g id="pb_tbl-type_upd-2-Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="pb_tbl-type_upd-2-col_vals_regex" transform="translate(0.000000, 0.034483)">
            <path d="M56.712234,1 C59.1975153,1 61.4475153,2.00735931 63.076195,3.63603897 C64.7048747,5.26471863 65.712234,7.51471863 65.712234,10 L65.712234,10 L65.712234,65 L10.712234,65 C8.22695259,65 5.97695259,63.9926407 4.34827294,62.363961 C2.71959328,60.7352814 1.71223397,58.4852814 1.71223397,56 L1.71223397,56 L1.71223397,10 C1.71223397,7.51471863 2.71959328,5.26471863 4.34827294,3.63603897 C5.97695259,2.00735931 8.22695259,1 10.712234,1 L10.712234,1 Z" id="pb_tbl-type_upd-2-rectangle" stroke="#000000" stroke-width="2" fill="#FFFFFF"></path>
            <g id="pb_tbl-type_upd-2-regex_symbols" transform="translate(18.000000, 12.000000)" fill="#000000" fill-rule="nonzero">
                <path d="M4.17434508,33.013582 C1.94895328,33.013582 0.138006923,34.8245284 0.138006923,37.0499202 C0.138006923,39.275312 1.94895328,41.0862583 4.17434508,41.0862583 C6.39973688,41.0862583 8.21068324,39.275312 8.21068324,37.0499202 C8.21068324,34.8245284 6.39973688,33.013582 4.17434508,33.013582 Z" id="pb_tbl-type_upd-2-full_stop"></path>
                <path d="M23.9479718,23.3175402 L21.5628264,23.3175402 C21.2344032,23.3175402 20.9665401,23.0520067 20.9665401,22.7212538 L20.9665401,15.1022979 L14.3445004,18.8873192 C14.0626621,19.050366 13.7016292,18.952538 13.5362533,18.6706991 L12.3436806,16.6442575 C12.262157,16.506832 12.2388642,16.3437852 12.2807909,16.1900549 C12.3203879,16.0363251 12.4205455,15.9058874 12.557971,15.8266929 L19.1800101,11.9880994 L12.557971,8.15183511 C12.4205455,8.07264112 12.3203879,7.93987439 12.2807909,7.78614401 C12.2388642,7.63241423 12.262157,7.46936689 12.3413509,7.33194137 L13.5339237,5.30549975 C13.6993001,5.02366143 14.0626621,4.92816199 14.3445004,5.09120934 L20.9665401,8.87390091 L20.9665401,1.25494501 C20.9665401,0.926521818 21.2344032,0.658658658 21.5628264,0.658658658 L23.9479718,0.658658658 C24.2787247,0.658658658 24.5442582,0.926521818 24.5442582,1.25494501 L24.5442582,8.87390091 L31.1662979,5.09120934 C31.4481362,4.92816199 31.8091691,5.02366143 31.9745455,5.30549975 L33.1671182,7.33194137 C33.2486413,7.46936689 33.2719341,7.63241423 33.2300074,7.78614401 C33.1904104,7.93987439 33.0902528,8.07264112 32.9528278,8.15183511 L26.3307882,11.9880994 L32.9528278,15.8243638 C33.0879237,15.9058874 33.1880813,16.0363251 33.2300074,16.1900549 C33.269605,16.3437852 33.2486413,16.506832 33.1671182,16.6442575 L31.9745455,18.6706991 C31.8091691,18.952538 31.4481362,19.050366 31.1662979,18.8849895 L24.5442582,15.1022979 L24.5442582,22.7212538 C24.5442582,23.0520067 24.2787247,23.3175402 23.9479718,23.3175402 Z" id="pb_tbl-type_upd-2-asterisk"></path>
            </g>
        </g>
    </g>
</svg>
        </div>
        <div style="font-family: 'IBM Plex Mono', monospace, courier; color: black; font-size: 11px; display: inline-block; vertical-align: middle;">
            <div>col_vals_regex()</div>
        </div>
        </td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_tbl-columns_upd" class="gt_row gt_left">email</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_tbl-values_upd" class="gt_row gt_left">^[^@]+@[^@]+\.[^@]+$</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" headers="pb_tbl-tbl" class="gt_row gt_center"><svg width="25px" height="25px" viewBox="0 0 25 25" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="vertical-align: middle;">
    <g id="pb_tbl-tbl-2-unchanged" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="pb_tbl-tbl-2-unchanged" transform="translate(0.500000, 0.570147)">
            <rect id="pb_tbl-tbl-2-Rectangle" x="0.125132506" y="0" width="23.749735" height="23.7894737"></rect>
            <path d="M5.80375046,8.18194736 C3.77191832,8.18194736 2.11875046,9.83495328 2.11875046,11.8669474 C2.11875046,13.8989414 3.77191832,15.5519474 5.80375046,15.5519474 C7.8355826,15.5519474 9.48875046,13.8989414 9.48875046,11.8669474 C9.48875046,9.83495328 7.83552863,8.18194736 5.80375046,8.18194736 Z M5.80375046,14.814915 C4.17821997,14.814915 2.85578285,13.4924778 2.85578285,11.8669474 C2.85578285,10.2414169 4.17821997,8.91897975 5.80375046,8.91897975 C7.42928095,8.91897975 8.75171807,10.2414169 8.75171807,11.8669474 C8.75171807,13.4924778 7.42928095,14.814915 5.80375046,14.814915 Z" id="pb_tbl-tbl-2-Shape" fill="#000000" fill-rule="nonzero"></path>
            <path d="M13.9638189,8.699335 C13.9364621,8.70430925 13.9091059,8.71176968 13.8842359,8.71923074 C13.7822704,8.73663967 13.6877654,8.77643115 13.6056956,8.83860518 L10.2433156,11.3852598 C10.0766886,11.5046343 9.97720993,11.6986181 9.97720993,11.9025491 C9.97720993,12.1064807 10.0766886,12.3004639 10.2433156,12.4198383 L13.6056956,14.966493 C13.891697,15.1803725 14.2970729,15.1231721 14.5109517,14.8371707 C14.7248313,14.5511692 14.6676309,14.145794 14.3816294,13.9319145 L12.5313257,12.5392127 L21.8812495,12.5392127 L21.8812495,11.2658854 L12.5313257,11.2658854 L14.3816294,9.87318364 C14.6377872,9.71650453 14.7497006,9.40066014 14.6477351,9.11714553 C14.5482564,8.83363156 14.262255,8.65954352 13.9638189,8.699335 Z" id="pb_tbl-tbl-2-arrow" fill="#000000" transform="translate(15.929230, 11.894737) rotate(-180.000000) translate(-15.929230, -11.894737) "></path>
        </g>
    </g>
</svg></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" headers="pb_tbl-eval" class="gt_row gt_center"><span style="color:#4CA64C;">&check;</span></td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" headers="pb_tbl-test_units" class="gt_row gt_right">5</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" headers="pb_tbl-pass" class="gt_row gt_right">4<br />0.80</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" headers="pb_tbl-fail" class="gt_row gt_right">1<br />0.20</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" headers="pb_tbl-w_upd" class="gt_row gt_center"><span style="color: #AAAAAA;">&#9679;</span></td>
    <td style="height: 40px; background-color: #FCFCFC;" headers="pb_tbl-e_upd" class="gt_row gt_center"><span style="color: #EBBC14;">&#9679;</span></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" headers="pb_tbl-c_upd" class="gt_row gt_center"><span style="color: #FF3300;">&cir;</span></td>
    <td style="height: 40px;" headers="pb_tbl-extract_upd" class="gt_row gt_center"><a href="data:text/csv;base64,X3Jvd19udW1fLHVzZXJfaWQsYWdlLGVtYWlsLHNjb3JlCjMsMywyMixpbnZhbGlkLWVtYWlsLDc4LjMK" download="extract_0003.csv"><button style="background-color: #67C2DC; color: #FFFFFF; border: none; padding: 5px; font-weight: bold; cursor: pointer; border-radius: 4px;">CSV</button></a></td>
  </tr>
  <tr>
    <td style="height: 40px; background-color: #4CA64C; color: transparent;font-size: 0px;" headers="pb_tbl-status_color" class="gt_row gt_left">#4CA64C</td>
    <td style="height: 40px; color: #666666;font-size: 13px;font-weight: bold;" headers="pb_tbl-i" class="gt_row gt_right">4</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" headers="pb_tbl-type_upd" class="gt_row gt_left">
        <div style="margin: 0; padding: 0; display: inline-block; height: 30px; vertical-align: middle; width: 16%;">
            <!--?xml version="1.0" encoding="UTF-8"?--><?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="30px" viewBox="0 0 67 67" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>col_vals_between</title>
    <g id="pb_tbl-type_upd-3-Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="pb_tbl-type_upd-3-col_vals_between" transform="translate(0.000000, 0.206897)">
            <path d="M56.712234,1 C59.1975153,1 61.4475153,2.00735931 63.076195,3.63603897 C64.7048747,5.26471863 65.712234,7.51471863 65.712234,10 L65.712234,10 L65.712234,65 L10.712234,65 C8.22695259,65 5.97695259,63.9926407 4.34827294,62.363961 C2.71959328,60.7352814 1.71223397,58.4852814 1.71223397,56 L1.71223397,56 L1.71223397,10 C1.71223397,7.51471863 2.71959328,5.26471863 4.34827294,3.63603897 C5.97695259,2.00735931 8.22695259,1 10.712234,1 L10.712234,1 Z" id="pb_tbl-type_upd-3-rectangle" stroke="#000000" stroke-width="2" fill="#FFFFFF"></path>
            <path d="M11.993484,21.96875 C10.962234,22.082031 10.188797,22.964844 10.212234,24 L10.212234,42 C10.200515,42.722656 10.579422,43.390625 11.204422,43.753906 C11.825515,44.121094 12.598953,44.121094 13.220047,43.753906 C13.845047,43.390625 14.223953,42.722656 14.212234,42 L14.212234,24 C14.220047,23.457031 14.009109,22.9375 13.626297,22.554688 C13.243484,22.171875 12.723953,21.960938 12.180984,21.96875 C12.118484,21.964844 12.055984,21.964844 11.993484,21.96875 Z M55.993484,21.96875 C54.962234,22.082031 54.188797,22.964844 54.212234,24 L54.212234,42 C54.200515,42.722656 54.579422,43.390625 55.204422,43.753906 C55.825515,44.121094 56.598953,44.121094 57.220047,43.753906 C57.845047,43.390625 58.223953,42.722656 58.212234,42 L58.212234,24 C58.220047,23.457031 58.009109,22.9375 57.626297,22.554688 C57.243484,22.171875 56.723953,21.960938 56.180984,21.96875 C56.118484,21.964844 56.055984,21.964844 55.993484,21.96875 Z M16.212234,22 C15.661453,22 15.212234,22.449219 15.212234,23 C15.212234,23.550781 15.661453,24 16.212234,24 C16.763015,24 17.212234,23.550781 17.212234,23 C17.212234,22.449219 16.763015,22 16.212234,22 Z M20.212234,22 C19.661453,22 19.212234,22.449219 19.212234,23 C19.212234,23.550781 19.661453,24 20.212234,24 C20.763015,24 21.212234,23.550781 21.212234,23 C21.212234,22.449219 20.763015,22 20.212234,22 Z M24.212234,22 C23.661453,22 23.212234,22.449219 23.212234,23 C23.212234,23.550781 23.661453,24 24.212234,24 C24.763015,24 25.212234,23.550781 25.212234,23 C25.212234,22.449219 24.763015,22 24.212234,22 Z M28.212234,22 C27.661453,22 27.212234,22.449219 27.212234,23 C27.212234,23.550781 27.661453,24 28.212234,24 C28.763015,24 29.212234,23.550781 29.212234,23 C29.212234,22.449219 28.763015,22 28.212234,22 Z M32.212234,22 C31.661453,22 31.212234,22.449219 31.212234,23 C31.212234,23.550781 31.661453,24 32.212234,24 C32.763015,24 33.212234,23.550781 33.212234,23 C33.212234,22.449219 32.763015,22 32.212234,22 Z M36.212234,22 C35.661453,22 35.212234,22.449219 35.212234,23 C35.212234,23.550781 35.661453,24 36.212234,24 C36.763015,24 37.212234,23.550781 37.212234,23 C37.212234,22.449219 36.763015,22 36.212234,22 Z M40.212234,22 C39.661453,22 39.212234,22.449219 39.212234,23 C39.212234,23.550781 39.661453,24 40.212234,24 C40.763015,24 41.212234,23.550781 41.212234,23 C41.212234,22.449219 40.763015,22 40.212234,22 Z M44.212234,22 C43.661453,22 43.212234,22.449219 43.212234,23 C43.212234,23.550781 43.661453,24 44.212234,24 C44.763015,24 45.212234,23.550781 45.212234,23 C45.212234,22.449219 44.763015,22 44.212234,22 Z M48.212234,22 C47.661453,22 47.212234,22.449219 47.212234,23 C47.212234,23.550781 47.661453,24 48.212234,24 C48.763015,24 49.212234,23.550781 49.212234,23 C49.212234,22.449219 48.763015,22 48.212234,22 Z M52.212234,22 C51.661453,22 51.212234,22.449219 51.212234,23 C51.212234,23.550781 51.661453,24 52.212234,24 C52.763015,24 53.212234,23.550781 53.212234,23 C53.212234,22.449219 52.763015,22 52.212234,22 Z M21.462234,27.96875 C21.419265,27.976563 21.376297,27.988281 21.337234,28 C21.177078,28.027344 21.02864,28.089844 20.899734,28.1875 L15.618484,32.1875 C15.356765,32.375 15.200515,32.679688 15.200515,33 C15.200515,33.320313 15.356765,33.625 15.618484,33.8125 L20.899734,37.8125 C21.348953,38.148438 21.985672,38.058594 22.321609,37.609375 C22.657547,37.160156 22.567703,36.523438 22.118484,36.1875 L19.212234,34 L49.212234,34 L46.305984,36.1875 C45.856765,36.523438 45.766922,37.160156 46.102859,37.609375 C46.438797,38.058594 47.075515,38.148438 47.524734,37.8125 L52.805984,33.8125 C53.067703,33.625 53.223953,33.320313 53.223953,33 C53.223953,32.679688 53.067703,32.375 52.805984,32.1875 L47.524734,28.1875 C47.30989,28.027344 47.040359,27.960938 46.774734,28 C46.743484,28 46.712234,28 46.680984,28 C46.282547,28.074219 45.96614,28.382813 45.884109,28.78125 C45.802078,29.179688 45.970047,29.585938 46.305984,29.8125 L49.212234,32 L19.212234,32 L22.118484,29.8125 C22.520828,29.566406 22.696609,29.070313 22.536453,28.625 C22.380203,28.179688 21.930984,27.90625 21.462234,27.96875 Z M16.212234,42 C15.661453,42 15.212234,42.449219 15.212234,43 C15.212234,43.550781 15.661453,44 16.212234,44 C16.763015,44 17.212234,43.550781 17.212234,43 C17.212234,42.449219 16.763015,42 16.212234,42 Z M20.212234,42 C19.661453,42 19.212234,42.449219 19.212234,43 C19.212234,43.550781 19.661453,44 20.212234,44 C20.763015,44 21.212234,43.550781 21.212234,43 C21.212234,42.449219 20.763015,42 20.212234,42 Z M24.212234,42 C23.661453,42 23.212234,42.449219 23.212234,43 C23.212234,43.550781 23.661453,44 24.212234,44 C24.763015,44 25.212234,43.550781 25.212234,43 C25.212234,42.449219 24.763015,42 24.212234,42 Z M28.212234,42 C27.661453,42 27.212234,42.449219 27.212234,43 C27.212234,43.550781 27.661453,44 28.212234,44 C28.763015,44 29.212234,43.550781 29.212234,43 C29.212234,42.449219 28.763015,42 28.212234,42 Z M32.212234,42 C31.661453,42 31.212234,42.449219 31.212234,43 C31.212234,43.550781 31.661453,44 32.212234,44 C32.763015,44 33.212234,43.550781 33.212234,43 C33.212234,42.449219 32.763015,42 32.212234,42 Z M36.212234,42 C35.661453,42 35.212234,42.449219 35.212234,43 C35.212234,43.550781 35.661453,44 36.212234,44 C36.763015,44 37.212234,43.550781 37.212234,43 C37.212234,42.449219 36.763015,42 36.212234,42 Z M40.212234,42 C39.661453,42 39.212234,42.449219 39.212234,43 C39.212234,43.550781 39.661453,44 40.212234,44 C40.763015,44 41.212234,43.550781 41.212234,43 C41.212234,42.449219 40.763015,42 40.212234,42 Z M44.212234,42 C43.661453,42 43.212234,42.449219 43.212234,43 C43.212234,43.550781 43.661453,44 44.212234,44 C44.763015,44 45.212234,43.550781 45.212234,43 C45.212234,42.449219 44.763015,42 44.212234,42 Z M48.212234,42 C47.661453,42 47.212234,42.449219 47.212234,43 C47.212234,43.550781 47.661453,44 48.212234,44 C48.763015,44 49.212234,43.550781 49.212234,43 C49.212234,42.449219 48.763015,42 48.212234,42 Z M52.212234,42 C51.661453,42 51.212234,42.449219 51.212234,43 C51.212234,43.550781 51.661453,44 52.212234,44 C52.763015,44 53.212234,43.550781 53.212234,43 C53.212234,42.449219 52.763015,42 52.212234,42 Z" id="pb_tbl-type_upd-3-inside_range" fill="#000000" fill-rule="nonzero"></path>
        </g>
    </g>
</svg>
        </div>
        <div style="font-family: 'IBM Plex Mono', monospace, courier; color: black; font-size: 10px; display: inline-block; vertical-align: middle;">
            <div>col_vals_between()</div>
        </div>
        </td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_tbl-columns_upd" class="gt_row gt_left">score</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_tbl-values_upd" class="gt_row gt_left">[0, 100]</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" headers="pb_tbl-tbl" class="gt_row gt_center"><svg width="25px" height="25px" viewBox="0 0 25 25" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="vertical-align: middle;">
    <g id="pb_tbl-tbl-3-unchanged" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="pb_tbl-tbl-3-unchanged" transform="translate(0.500000, 0.570147)">
            <rect id="pb_tbl-tbl-3-Rectangle" x="0.125132506" y="0" width="23.749735" height="23.7894737"></rect>
            <path d="M5.80375046,8.18194736 C3.77191832,8.18194736 2.11875046,9.83495328 2.11875046,11.8669474 C2.11875046,13.8989414 3.77191832,15.5519474 5.80375046,15.5519474 C7.8355826,15.5519474 9.48875046,13.8989414 9.48875046,11.8669474 C9.48875046,9.83495328 7.83552863,8.18194736 5.80375046,8.18194736 Z M5.80375046,14.814915 C4.17821997,14.814915 2.85578285,13.4924778 2.85578285,11.8669474 C2.85578285,10.2414169 4.17821997,8.91897975 5.80375046,8.91897975 C7.42928095,8.91897975 8.75171807,10.2414169 8.75171807,11.8669474 C8.75171807,13.4924778 7.42928095,14.814915 5.80375046,14.814915 Z" id="pb_tbl-tbl-3-Shape" fill="#000000" fill-rule="nonzero"></path>
            <path d="M13.9638189,8.699335 C13.9364621,8.70430925 13.9091059,8.71176968 13.8842359,8.71923074 C13.7822704,8.73663967 13.6877654,8.77643115 13.6056956,8.83860518 L10.2433156,11.3852598 C10.0766886,11.5046343 9.97720993,11.6986181 9.97720993,11.9025491 C9.97720993,12.1064807 10.0766886,12.3004639 10.2433156,12.4198383 L13.6056956,14.966493 C13.891697,15.1803725 14.2970729,15.1231721 14.5109517,14.8371707 C14.7248313,14.5511692 14.6676309,14.145794 14.3816294,13.9319145 L12.5313257,12.5392127 L21.8812495,12.5392127 L21.8812495,11.2658854 L12.5313257,11.2658854 L14.3816294,9.87318364 C14.6377872,9.71650453 14.7497006,9.40066014 14.6477351,9.11714553 C14.5482564,8.83363156 14.262255,8.65954352 13.9638189,8.699335 Z" id="pb_tbl-tbl-3-arrow" fill="#000000" transform="translate(15.929230, 11.894737) rotate(-180.000000) translate(-15.929230, -11.894737) "></path>
        </g>
    </g>
</svg></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" headers="pb_tbl-eval" class="gt_row gt_center"><span style="color:#4CA64C;">&check;</span></td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" headers="pb_tbl-test_units" class="gt_row gt_right">5</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" headers="pb_tbl-pass" class="gt_row gt_right">5<br />1.00</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" headers="pb_tbl-fail" class="gt_row gt_right">0<br />0.00</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" headers="pb_tbl-w_upd" class="gt_row gt_center"><span style="color: #AAAAAA;">&cir;</span></td>
    <td style="height: 40px; background-color: #FCFCFC;" headers="pb_tbl-e_upd" class="gt_row gt_center"><span style="color: #EBBC14;">&cir;</span></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" headers="pb_tbl-c_upd" class="gt_row gt_center"><span style="color: #FF3300;">&cir;</span></td>
    <td style="height: 40px;" headers="pb_tbl-extract_upd" class="gt_row gt_center">—</td>
  </tr>
  <tr>
    <td style="height: 40px; background-color: #4CA64C; color: transparent;font-size: 0px;" headers="pb_tbl-status_color" class="gt_row gt_left">#4CA64C</td>
    <td style="height: 40px; color: #666666;font-size: 13px;font-weight: bold;" headers="pb_tbl-i" class="gt_row gt_right">5</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" headers="pb_tbl-type_upd" class="gt_row gt_left">
        <div style="margin: 0; padding: 0; display: inline-block; height: 30px; vertical-align: middle; width: 16%;">
            <!--?xml version="1.0" encoding="UTF-8"?--><?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="30px" viewBox="0 0 67 67" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>col_schema_match</title>
    <g id="pb_tbl-type_upd-4-Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="pb_tbl-type_upd-4-col_schema_match" transform="translate(0.000000, 0.310345)">
            <path d="M56.712234,1.01466935 C59.1975153,1.01466935 61.4475153,2.02202867 63.076195,3.65070832 C64.7048747,5.27938798 65.712234,7.52938798 65.712234,10.0146694 L65.712234,10.0146694 L65.712234,65.0146694 L10.712234,65.0146694 C8.22695259,65.0146694 5.97695259,64.00731 4.34827294,62.3786304 C2.71959328,60.7499507 1.71223397,58.4999507 1.71223397,56.0146694 L1.71223397,56.0146694 L1.71223397,10.0146694 C1.71223397,7.52938798 2.71959328,5.27938798 4.34827294,3.65070832 C5.97695259,2.02202867 8.22695259,1.01466935 10.712234,1.01466935 L10.712234,1.01466935 Z" id="pb_tbl-type_upd-4-rectangle" stroke="#000000" stroke-width="2" fill="#FFFFFF"></path>
            <path d="M53.712234,39.7885268 L54.212234,56.2885268 L42.212234,56.7885268 L42.212234,39.7885268 L53.712234,39.7885268 Z M39.712234,39.7885268 L39.712234,56.7885268 L27.712234,56.7885268 L27.712234,39.7885268 L39.712234,39.7885268 Z M25.212234,39.7885268 L25.212234,56.7885268 L13.712234,56.7885268 L13.212234,40.2885268 L25.212234,39.7885268 Z" id="pb_tbl-type_upd-4-columns_schema" stroke="#000000" fill-rule="nonzero"></path>
            <g id="pb_tbl-type_upd-4-vertical_equal" transform="translate(30.000000, 29.000000)" stroke="#000000" stroke-linecap="square">
                <line x1="2.21223397" y1="0.514669353" x2="2.21223397" y2="7.58573716" id="pb_tbl-type_upd-4-Line"></line>
                <line x1="5.21223397" y1="0.514669353" x2="5.21223397" y2="7.58573716" id="pb_tbl-type_upd-4-Line-Copy"></line>
            </g>
            <path d="M41.712234,9.01466935 L41.712234,27.0146694 L53.712234,27.0146694 C54.262234,27.0146694 54.712234,26.5646694 54.712234,26.0146694 L54.712234,10.0146694 C54.712234,9.46466935 54.262234,9.01466935 53.712234,9.01466935 L41.712234,9.01466935 Z M27.212234,9.01466935 C27.212234,9.01466935 27.212234,15.0146694 27.212234,27.0146694 L40.212234,27.0146694 L40.212234,9.01466935 C31.5455673,9.01466935 27.212234,9.01466935 27.212234,9.01466935 Z M13.712234,9.01466935 C13.162234,9.01466935 12.712234,9.46466935 12.712234,10.0146694 L12.712234,26.0146694 C12.712234,26.5646694 13.162234,27.0146694 13.712234,27.0146694 L25.712234,27.0146694 L25.712234,9.01466935 L13.712234,9.01466935 Z" id="pb_tbl-type_upd-4-columns_real" fill="#000000" fill-rule="nonzero"></path>
        </g>
    </g>
</svg>
        </div>
        <div style="font-family: 'IBM Plex Mono', monospace, courier; color: black; font-size: 10px; display: inline-block; vertical-align: middle;">
            <div>col_schema_match()</div>
        </div>
        </td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_tbl-columns_upd" class="gt_row gt_left">&mdash;</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_tbl-values_upd" class="gt_row gt_left">SCHEMA</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" headers="pb_tbl-tbl" class="gt_row gt_center"><svg width="25px" height="25px" viewBox="0 0 25 25" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="vertical-align: middle;">
    <g id="pb_tbl-tbl-4-unchanged" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="pb_tbl-tbl-4-unchanged" transform="translate(0.500000, 0.570147)">
            <rect id="pb_tbl-tbl-4-Rectangle" x="0.125132506" y="0" width="23.749735" height="23.7894737"></rect>
            <path d="M5.80375046,8.18194736 C3.77191832,8.18194736 2.11875046,9.83495328 2.11875046,11.8669474 C2.11875046,13.8989414 3.77191832,15.5519474 5.80375046,15.5519474 C7.8355826,15.5519474 9.48875046,13.8989414 9.48875046,11.8669474 C9.48875046,9.83495328 7.83552863,8.18194736 5.80375046,8.18194736 Z M5.80375046,14.814915 C4.17821997,14.814915 2.85578285,13.4924778 2.85578285,11.8669474 C2.85578285,10.2414169 4.17821997,8.91897975 5.80375046,8.91897975 C7.42928095,8.91897975 8.75171807,10.2414169 8.75171807,11.8669474 C8.75171807,13.4924778 7.42928095,14.814915 5.80375046,14.814915 Z" id="pb_tbl-tbl-4-Shape" fill="#000000" fill-rule="nonzero"></path>
            <path d="M13.9638189,8.699335 C13.9364621,8.70430925 13.9091059,8.71176968 13.8842359,8.71923074 C13.7822704,8.73663967 13.6877654,8.77643115 13.6056956,8.83860518 L10.2433156,11.3852598 C10.0766886,11.5046343 9.97720993,11.6986181 9.97720993,11.9025491 C9.97720993,12.1064807 10.0766886,12.3004639 10.2433156,12.4198383 L13.6056956,14.966493 C13.891697,15.1803725 14.2970729,15.1231721 14.5109517,14.8371707 C14.7248313,14.5511692 14.6676309,14.145794 14.3816294,13.9319145 L12.5313257,12.5392127 L21.8812495,12.5392127 L21.8812495,11.2658854 L12.5313257,11.2658854 L14.3816294,9.87318364 C14.6377872,9.71650453 14.7497006,9.40066014 14.6477351,9.11714553 C14.5482564,8.83363156 14.262255,8.65954352 13.9638189,8.699335 Z" id="pb_tbl-tbl-4-arrow" fill="#000000" transform="translate(15.929230, 11.894737) rotate(-180.000000) translate(-15.929230, -11.894737) "></path>
        </g>
    </g>
</svg></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" headers="pb_tbl-eval" class="gt_row gt_center"><span style="color:#4CA64C;">&check;</span></td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" headers="pb_tbl-test_units" class="gt_row gt_right">1</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" headers="pb_tbl-pass" class="gt_row gt_right">1<br />1.00</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" headers="pb_tbl-fail" class="gt_row gt_right">0<br />0.00</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" headers="pb_tbl-w_upd" class="gt_row gt_center"><span style="color: #AAAAAA;">&cir;</span></td>
    <td style="height: 40px; background-color: #FCFCFC;" headers="pb_tbl-e_upd" class="gt_row gt_center"><span style="color: #EBBC14;">&cir;</span></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" headers="pb_tbl-c_upd" class="gt_row gt_center"><span style="color: #FF3300;">&cir;</span></td>
    <td style="height: 40px;" headers="pb_tbl-extract_upd" class="gt_row gt_center">—</td>
  </tr>
</tbody>
<tfoot><tr class="gt_sourcenotes"><td class="gt_sourcenote" colspan="14" style="text-align: left;"><span class="gt_from_md"><div style='margin-top: 5px; margin-bottom: 5px;'><span style='background-color: #FFF; color: #444; padding: 0.5em 0.5em; position: inherit; text-transform: uppercase; margin-left: 10px; margin-right: 5px; border: solid 1px #999999; font-variant-numeric: tabular-nums; border-radius: 0; padding: 2px 10px 2px 10px;'>2026-11-30 17:41:07 UTC</span><span style='background-color: #FFF; color: #444; padding: 0.5em 0.5em; position: inherit; margin-right: 5px; border: solid 1px #999999; font-variant-numeric: tabular-nums; border-radius: 0; padding: 2px 10px 2px 10px;'>< 1 s</span><span style='background-color: #FFF; color: #444; padding: 0.5em 0.5em; position: inherit; text-transform: uppercase; margin: 5px 1px 5px -1px; border: solid 1px #999999; font-variant-numeric: tabular-nums; border-radius: 0; padding: 2px 10px 2px 10px;'>2026-11-30 17:41:07 UTC</span></div></span></td></tr><tr class="gt_sourcenotes"><td class="gt_sourcenote" colspan="14" style="text-align: left;"><span class="gt_from_md"><hr style='border: none; border-top-width: 1px; border-top-style: dotted; border-top-color: #B5B5B5; margin-top: -3px; margin-bottom: 3px;'>
<strong>Notes</strong>
<p><span style='font-variant: small-caps; font-weight: bold; font-size: smaller; text-transform: uppercase; color: #333333;'>Step 5</span> <span style='font-family: "IBM Plex Mono", monospace; font-size: smaller;'>(schema_check)</span> <span style="color:#4CA64C;">✓</span> Schema validation <strong>passed</strong>.</p>
<details style="margin-top: 2px; margin-bottom: 8px; font-size: 12px; text-indent: 12px;">
<summary style="cursor: pointer; font-weight: bold; color: #555; margin-bottom: -5px;">Schema Comparison</summary>
<div style="margin-top: 6px; padding-left: 15px; padding-right: 15px;">
<div id="pb_step_tbl" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
<style>
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans&display=swap');
#pb_step_tbl table {
          font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }
<p>#pb_step_tbl thead, tbody, tfoot, tr, td, th { border-style: none; }
tr { background-color: transparent; }
#pb_step_tbl p { margin: 0; padding: 0; }
#pb_step_tbl .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }
#pb_step_tbl .gt_caption { padding-top: 4px; padding-bottom: 4px; }
#pb_step_tbl .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
#pb_step_tbl .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
#pb_step_tbl .gt_heading { background-color: #FFFFFF; text-align: left; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
#pb_step_tbl .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
#pb_step_tbl .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
#pb_step_tbl .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; overflow-x: hidden; }
#pb_step_tbl .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
#pb_step_tbl .gt_column_spanner_outer:first-child { padding-left: 0; }
#pb_step_tbl .gt_column_spanner_outer:last-child { padding-right: 0; }
#pb_step_tbl .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
#pb_step_tbl .gt_spanner_row { border-bottom-style: hidden; }
#pb_step_tbl .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }
#pb_step_tbl .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }
#pb_step_tbl .gt_from_md&gt; :first-child { margin-top: 0; }
#pb_step_tbl .gt_from_md&gt; :last-child { margin-bottom: 0; }
#pb_step_tbl .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }
#pb_step_tbl .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; }
#pb_step_tbl .gt_indent_1 { text-indent: 5px; }
#pb_step_tbl .gt_indent_2 { text-indent: calc(5px * 2); }
#pb_step_tbl .gt_indent_3 { text-indent: calc(5px * 3); }
#pb_step_tbl .gt_indent_4 { text-indent: calc(5px * 4); }
#pb_step_tbl .gt_indent_5 { text-indent: calc(5px * 5); }
#pb_step_tbl .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; vertical-align: top; }
#pb_step_tbl .gt_row_group_first td { border-top-width: 2px; }
#pb_step_tbl .gt_row_group_first th { border-top-width: 2px; }
#pb_step_tbl .gt_striped { color: #333333; background-color: #F4F4F4; }
#pb_step_tbl .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
#pb_step_tbl .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
#pb_step_tbl .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
#pb_step_tbl .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
#pb_step_tbl .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
#pb_step_tbl .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
#pb_step_tbl .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
#pb_step_tbl .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
#pb_step_tbl .gt_sourcenote { font-size: 12px; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
#pb_step_tbl .gt_left { text-align: left; }
#pb_step_tbl .gt_center { text-align: center; }
#pb_step_tbl .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
#pb_step_tbl .gt_font_normal { font-weight: normal; }
#pb_step_tbl .gt_font_bold { font-weight: bold; }
#pb_step_tbl .gt_font_italic { font-style: italic; }
#pb_step_tbl .gt_super { font-size: 65%; }
#pb_step_tbl .gt_footnotes { color: font-color(#FFFFFF); background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
#pb_step_tbl .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
#pb_step_tbl .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
#pb_step_tbl .gt_sourcenote { font-size: 12px; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
#pb_step_tbl .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
#pb_step_tbl .gt_asterisk { font-size: 100%; vertical-align: 0; }</p>
</style>
<table style="table-layout: fixed;; width: 0px" class="gt_table" data-quarto-disable-processing="true" data-quarto-bootstrap="false">
<colgroup>
  <col style="width:40px;"/>
  <col style="width:190px;"/>
  <col style="width:190px;"/>
  <col style="width:40px;"/>
  <col style="width:190px;"/>
  <col style="width:30px;"/>
  <col style="width:190px;"/>
  <col style="width:30px;"/>
</colgroup>
<thead>
<tr class="gt_col_headings gt_spanner_row">
  <th class="gt_center gt_columns_top_border gt_column_spanner_outer" rowspan="1" colspan="3" scope="colgroup" id="pb_step_tbl-TABLE">
    <span class="gt_column_spanner">TABLE</span>
  </th>
  <th class="gt_center gt_columns_top_border gt_column_spanner_outer" rowspan="1" colspan="5" scope="colgroup" id="pb_step_tbl-SCHEMA">
    <span class="gt_column_spanner">SCHEMA</span>
  </th>
</tr>
<tr class="gt_col_headings">
  <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" scope="col" id="pb_step_tbl-index_target"></th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="pb_step_tbl-col_name_target">COLUMN</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="pb_step_tbl-dtype_target">DATA TYPE</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" scope="col" id="pb_step_tbl-index_exp"></th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="pb_step_tbl-col_name_exp">COLUMN</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="pb_step_tbl-col_name_exp_correct"></th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="pb_step_tbl-dtype_exp">DATA TYPE</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="pb_step_tbl-dtype_exp_correct"></th>
</tr>
</thead>
<tbody class="gt_table_body">
  <tr>
    <td style="font-size: 13px;" headers="pb_step_tbl-TABLE pb_step_tbl-index_target" class="gt_row gt_right">1</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_step_tbl-TABLE pb_step_tbl-col_name_target" class="gt_row gt_left">user_id</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_step_tbl-TABLE pb_step_tbl-dtype_target" class="gt_row gt_left">Int64</td>
    <td style="font-size: 13px; border-left: 3px double #E5E5E5;" headers="pb_step_tbl-SCHEMA pb_step_tbl-index_exp" class="gt_row gt_right">1</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_step_tbl-SCHEMA pb_step_tbl-col_name_exp" class="gt_row gt_left">user_id</td>
    <td headers="pb_step_tbl-SCHEMA pb_step_tbl-col_name_exp_correct" class="gt_row gt_left"><span style='color: #4CA64C;'>✓</span></td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_step_tbl-SCHEMA pb_step_tbl-dtype_exp" class="gt_row gt_left">Int64</td>
    <td headers="pb_step_tbl-SCHEMA pb_step_tbl-dtype_exp_correct" class="gt_row gt_left"><span style='color: #4CA64C;'>✓</span></td>
  </tr>
  <tr>
    <td style="font-size: 13px;" headers="pb_step_tbl-TABLE pb_step_tbl-index_target" class="gt_row gt_right">2</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_step_tbl-TABLE pb_step_tbl-col_name_target" class="gt_row gt_left">age</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_step_tbl-TABLE pb_step_tbl-dtype_target" class="gt_row gt_left">Int64</td>
    <td style="font-size: 13px; border-left: 3px double #E5E5E5;" headers="pb_step_tbl-SCHEMA pb_step_tbl-index_exp" class="gt_row gt_right">2</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_step_tbl-SCHEMA pb_step_tbl-col_name_exp" class="gt_row gt_left">age</td>
    <td headers="pb_step_tbl-SCHEMA pb_step_tbl-col_name_exp_correct" class="gt_row gt_left"><span style='color: #4CA64C;'>✓</span></td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_step_tbl-SCHEMA pb_step_tbl-dtype_exp" class="gt_row gt_left">Int64</td>
    <td headers="pb_step_tbl-SCHEMA pb_step_tbl-dtype_exp_correct" class="gt_row gt_left"><span style='color: #4CA64C;'>✓</span></td>
  </tr>
  <tr>
    <td style="font-size: 13px;" headers="pb_step_tbl-TABLE pb_step_tbl-index_target" class="gt_row gt_right">3</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_step_tbl-TABLE pb_step_tbl-col_name_target" class="gt_row gt_left">email</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_step_tbl-TABLE pb_step_tbl-dtype_target" class="gt_row gt_left">String</td>
    <td style="font-size: 13px; border-left: 3px double #E5E5E5;" headers="pb_step_tbl-SCHEMA pb_step_tbl-index_exp" class="gt_row gt_right">3</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_step_tbl-SCHEMA pb_step_tbl-col_name_exp" class="gt_row gt_left">email</td>
    <td headers="pb_step_tbl-SCHEMA pb_step_tbl-col_name_exp_correct" class="gt_row gt_left"><span style='color: #4CA64C;'>✓</span></td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_step_tbl-SCHEMA pb_step_tbl-dtype_exp" class="gt_row gt_left">String</td>
    <td headers="pb_step_tbl-SCHEMA pb_step_tbl-dtype_exp_correct" class="gt_row gt_left"><span style='color: #4CA64C;'>✓</span></td>
  </tr>
  <tr>
    <td style="font-size: 13px;" headers="pb_step_tbl-TABLE pb_step_tbl-index_target" class="gt_row gt_right">4</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_step_tbl-TABLE pb_step_tbl-col_name_target" class="gt_row gt_left">score</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_step_tbl-TABLE pb_step_tbl-dtype_target" class="gt_row gt_left">Float64</td>
    <td style="font-size: 13px; border-left: 3px double #E5E5E5;" headers="pb_step_tbl-SCHEMA pb_step_tbl-index_exp" class="gt_row gt_right">4</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_step_tbl-SCHEMA pb_step_tbl-col_name_exp" class="gt_row gt_left">score</td>
    <td headers="pb_step_tbl-SCHEMA pb_step_tbl-col_name_exp_correct" class="gt_row gt_left"><span style='color: #4CA64C;'>✓</span></td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" headers="pb_step_tbl-SCHEMA pb_step_tbl-dtype_exp" class="gt_row gt_left">Float64</td>
    <td headers="pb_step_tbl-SCHEMA pb_step_tbl-dtype_exp_correct" class="gt_row gt_left"><span style='color: #4CA64C;'>✓</span></td>
  </tr>
</tbody>
<tfoot><tr class="gt_sourcenotes"><td class="gt_sourcenote" colspan="8"><span class="gt_from_md"><div style='padding-bottom: 2px;'>Supplied Column Schema:</div><div style='border-style: solid; border-width: thin; border-color: lightblue; padding-left: 2px; padding-right: 2px; padding-bottom: 3px;'><code style='color: #303030; font-family: monospace; font-size: 8px;'>[('user_id', 'Int64'), ('age', 'Int64'), ('email', 'String'), ('score', 'Float64')]</code></div></span></td></tr><tr class="gt_sourcenotes"><td class="gt_sourcenote" colspan="8"><span class="gt_from_md">
<div style='padding-bottom: 2px;'>Schema Match Settings</div>
<div style='padding-bottom: 4px;'><div style="display: flex; font-size: 13.7px; padding-top: 2px;"><div style="border-style: solid; border-width: 1px; border-color: #87CEFA; border-radius: 5px; background-color: #F0F8FF; font-size: x-small; padding-left: 4px; padding-right: 4px; margin-left: 5px; margin-right: 5px;  margin-top: 2px; ">COMPLETE</div><div style="border-style: solid; border-width: 1px; border-color: #87CEFA; border-radius: 5px; background-color: #F0F8FF; font-size: x-small; padding-left: 4px; padding-right: 4px; margin-left: 5px; margin-right: 5px;  margin-top: 2px; ">IN ORDER</div><div style="border-style: solid; border-width: 1px; border-color: #A9A9A9; border-radius: 5px; background-color: #F5F5F5; font-size: x-small; padding-left: 4px; padding-right: 4px; margin-left: 5px; margin-right: 5px;  margin-top: 2px; ">COLUMN &ne; column</div><div style="border-style: solid; border-width: 1px; border-color: #A9A9A9; border-radius: 5px; background-color: #F5F5F5; font-size: x-small; padding-left: 4px; padding-right: 4px; margin-left: 5px; margin-right: 5px;  margin-top: 2px; ">DTYPE &ne; dtype</div><div style="border-style: solid; border-width: 1px; border-color: #A9A9A9; border-radius: 5px; background-color: #F5F5F5; font-size: x-small; padding-left: 4px; padding-right: 4px; margin-left: 5px; margin-right: 5px;  margin-top: 2px; ">float &ne; float64</div></div></div>
</span></td></tr></tfoot>
</table>
</div>
</div>
</details>
</span></td></tr></tfoot>
</table>
</div>
<p>The report shows each step with its pass and fail counts and the
threshold levels it reached, and you can share it with people who will
never read the validation code. A lot has happened since the last
survey, and the library reached <code>v1.0.0</code> in October 2026. New features
include composable validation steps (a <code>Steps</code> object that lets you
write checks once and reuse them across plans), referential integrity
checks with <code>col_vals_in_table()</code>, table comparison with <code>pb.compare()</code>,
schema inference, and synthetic data generation from a schema.
<strong>Pointblank</strong> uses Narwhals and Ibis, so the same plan can run against
Polars, Pandas, PySpark, or a database table.</p>
<p><strong>Pointblank</strong> is a good fit when you need to communicate validation
results as well as enforce them, and when you&rsquo;re willing to accept some
failures. With thresholds, you can tolerate a small share of bad rows
and tighten the standard over time.</p>
<h2 id="validoopsie">Validoopsie
</h2>
<p><strong>Validoopsie</strong> sorts its checks into namespaces (values, strings,
nulls, dates, types, and so on) and chains them together much like Great
Expectations does, but it&rsquo;s a far smaller library. It has used Narwhals
from the start, so it works with any DataFrame library Narwhals
supports. Its most interesting idea is the <em>impact level</em>. Each check is
marked <code>&quot;low&quot;</code>, <code>&quot;medium&quot;</code>, or <code>&quot;high&quot;</code>, and a failing <code>&quot;high&quot;</code> check
raises an exception, while the others are logged at different
severities. Combined with a <code>threshold=</code> for the share of rows allowed
to fail, this lets you decide exactly how a pipeline should react when
the data isn&rsquo;t perfect.</p>
<p><strong>Validoopsie</strong> logs its results through
<a href="https://github.com/Delgan/loguru" target="_blank" rel="noopener">loguru</a>. The first two lines below
shorten that output so it fits on the page:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">sys</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">loguru</span> <span class="kn">import</span> <span class="n">logger</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">validoopsie</span> <span class="kn">import</span> <span class="n">Validate</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">narwhals.dtypes</span> <span class="kn">import</span> <span class="n">Int64</span><span class="p">,</span> <span class="n">Float64</span><span class="p">,</span> <span class="n">String</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">logger</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
</span></span><span class="line"><span class="cl"><span class="n">logger</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="p">,</span> <span class="n">level</span><span class="o">=</span><span class="s2">&#34;WARNING&#34;</span><span class="p">,</span> <span class="nb">format</span><span class="o">=</span><span class="s2">&#34;</span><span class="si">{level}</span><span class="s2">: </span><span class="si">{message}</span><span class="s2">&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">validation</span> <span class="o">=</span> <span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">Validate</span><span class="p">(</span><span class="n">user_data</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">ValuesValidation</span><span class="o">.</span><span class="n">ColumnValuesToBeBetween</span><span class="p">(</span><span class="n">column</span><span class="o">=</span><span class="s2">&#34;user_id&#34;</span><span class="p">,</span> <span class="n">min_value</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">impact</span><span class="o">=</span><span class="s2">&#34;high&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">ValuesValidation</span><span class="o">.</span><span class="n">ColumnValuesToBeBetween</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">column</span><span class="o">=</span><span class="s2">&#34;age&#34;</span><span class="p">,</span> <span class="n">min_value</span><span class="o">=</span><span class="mi">18</span><span class="p">,</span> <span class="n">max_value</span><span class="o">=</span><span class="mi">80</span><span class="p">,</span> <span class="n">threshold</span><span class="o">=</span><span class="mf">0.1</span><span class="p">,</span> <span class="n">impact</span><span class="o">=</span><span class="s2">&#34;medium&#34;</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">StringValidation</span><span class="o">.</span><span class="n">PatternMatch</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">column</span><span class="o">=</span><span class="s2">&#34;email&#34;</span><span class="p">,</span> <span class="n">pattern</span><span class="o">=</span><span class="sa">r</span><span class="s2">&#34;^[^@]+@[^@]+\.[^@]+$&#34;</span><span class="p">,</span> <span class="n">threshold</span><span class="o">=</span><span class="mf">0.05</span><span class="p">,</span> <span class="n">impact</span><span class="o">=</span><span class="s2">&#34;low&#34;</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">ValuesValidation</span><span class="o">.</span><span class="n">ColumnValuesToBeBetween</span><span class="p">(</span><span class="n">column</span><span class="o">=</span><span class="s2">&#34;score&#34;</span><span class="p">,</span> <span class="n">min_value</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">max_value</span><span class="o">=</span><span class="mi">100</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">TypeValidation</span><span class="o">.</span><span class="n">TypeCheck</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">frame_schema_definition</span><span class="o">=</span><span class="p">{</span><span class="s2">&#34;user_id&#34;</span><span class="p">:</span> <span class="n">Int64</span><span class="p">,</span> <span class="s2">&#34;age&#34;</span><span class="p">:</span> <span class="n">Int64</span><span class="p">,</span> <span class="s2">&#34;email&#34;</span><span class="p">:</span> <span class="n">String</span><span class="p">,</span> <span class="s2">&#34;score&#34;</span><span class="p">:</span> <span class="n">Float64</span><span class="p">},</span>
</span></span><span class="line"><span class="cl">        <span class="n">impact</span><span class="o">=</span><span class="s2">&#34;high&#34;</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">validation</span><span class="o">.</span><span class="n">validate</span><span class="p">()</span>
</span></span><span class="line"><span class="cl"><span class="n">validation</span><span class="o">.</span><span class="n">results</span><span class="p">[</span><span class="s2">&#34;Summary&#34;</span><span class="p">]</span></span></span></code></pre></div></div>
<pre><code>ERROR: Failed validation: ColumnValuesToBeBetween_age - The column 'age' has values that are not between 18 and 80.
WARNING: Failed validation: PatternMatch_email - The column 'email' has entries that do not match the pattern '^[^@]+@[^@]+\.[^@]+$'.

{'passed': False,
 'validations': ['ColumnValuesToBeBetween_user_id',
  'ColumnValuesToBeBetween_age',
  'PatternMatch_email',
  'ColumnValuesToBeBetween_score',
  'TypeCheck_DataTypeColumnValidation'],
 'failed_validation': ['ColumnValuesToBeBetween_age', 'PatternMatch_email']}
</code></pre>
<p>The failing <code>age</code> check was marked <code>&quot;medium&quot;</code> and is logged as an error,
while the failing <code>email</code> check was marked <code>&quot;low&quot;</code> and is logged as a
warning. Neither stops the pipeline, because the only <code>&quot;high&quot;</code> checks
(the ID range and the column types) passed. The full <code>results</code>
dictionary records each check&rsquo;s status, threshold, failing values, and
failure percentage, so it&rsquo;s easy to send along to a monitoring system.
<strong>Validoopsie</strong> works well in production pipelines where you want to
keep a close eye on data quality without letting one bad batch stop
everything.</p>
<h2 id="dataframely">Dataframely
</h2>
<p><strong>Dataframely</strong>, from QuantCo, is a Polars-native library that has been
through two major versions since the last survey. Version 2 (October
2025) made columns non-nullable by default and introduced lazy
validation, where <em>lazy</em> is meant in the Polars sense: the checks become
part of a <code>LazyFrame</code> query and only run when it&rsquo;s collected. Version 3
(July 2026) went further with a &ldquo;lazy in, lazy out&rdquo; design in which a
<code>LazyFrame</code> passed to <code>validate()</code> returns a <code>LazyFrame</code>. It also
replaced group rules (rules evaluated separately for each group of rows)
with Polars window expressions using <code>over()</code>, and trimmed its I/O layer
to focus on validation itself. Here&rsquo;s the schema for our test table:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">dataframely</span> <span class="k">as</span> <span class="nn">dy</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">class</span> <span class="nc">UserSchema</span><span class="p">(</span><span class="n">dy</span><span class="o">.</span><span class="n">Schema</span><span class="p">):</span>
</span></span><span class="line"><span class="cl">    <span class="n">user_id</span> <span class="o">=</span> <span class="n">dy</span><span class="o">.</span><span class="n">Int64</span><span class="p">(</span><span class="n">primary_key</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="n">age</span> <span class="o">=</span> <span class="n">dy</span><span class="o">.</span><span class="n">Int64</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">    <span class="n">email</span> <span class="o">=</span> <span class="n">dy</span><span class="o">.</span><span class="n">String</span><span class="p">(</span><span class="n">regex</span><span class="o">=</span><span class="sa">r</span><span class="s2">&#34;^[^@]+@[^@]+\.[^@]+$&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="n">score</span> <span class="o">=</span> <span class="n">dy</span><span class="o">.</span><span class="n">Float64</span><span class="p">(</span><span class="nb">min</span><span class="o">=</span><span class="mf">0.0</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mf">100.0</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="nd">@dy.rule</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">    <span class="k">def</span> <span class="nf">age_in_range</span><span class="p">(</span><span class="bp">cls</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">pl</span><span class="o">.</span><span class="n">Expr</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">        <span class="k">return</span> <span class="n">pl</span><span class="o">.</span><span class="n">col</span><span class="p">(</span><span class="s2">&#34;age&#34;</span><span class="p">)</span><span class="o">.</span><span class="n">is_between</span><span class="p">(</span><span class="mi">18</span><span class="p">,</span> <span class="mi">80</span><span class="p">,</span> <span class="n">closed</span><span class="o">=</span><span class="s2">&#34;both&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">try</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">    <span class="n">UserSchema</span><span class="o">.</span><span class="n">validate</span><span class="p">(</span><span class="n">user_data</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="k">except</span> <span class="n">dy</span><span class="o">.</span><span class="n">exc</span><span class="o">.</span><span class="n">ValidationError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">    <span class="nb">print</span><span class="p">(</span><span class="n">e</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code>2 rules failed validation:
 - 'age_in_range' failed for 1 rows
 * Column 'email' failed validation for 1 rules:
   - 'regex' failed for 1 rows
</code></pre>
<p>The <code>age</code> range could have been set with <code>min</code> and <code>max</code>, as <code>score</code> is,
but we wrote it as a custom rule to show how rules work. Rules written
with <code>@dy.rule()</code> are ordinary Polars expressions, so anything Polars
can compute can become a constraint. <strong>Dataframely</strong>&rsquo;s most useful
feature for production work is soft validation. Instead of raising,
<code>filter()</code> splits the data into the rows that passed and a record of the
rows that didn&rsquo;t:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">good_data</span><span class="p">,</span> <span class="n">failures</span> <span class="o">=</span> <span class="n">UserSchema</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">user_data</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&#34;Valid rows: </span><span class="si">{</span><span class="nb">len</span><span class="p">(</span><span class="n">good_data</span><span class="p">)</span><span class="si">}</span><span class="s2">&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">failures</span><span class="o">.</span><span class="n">counts</span><span class="p">())</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">failures</span><span class="o">.</span><span class="n">invalid</span><span class="p">())</span></span></span></code></pre></div></div>
<pre><code>Valid rows: 3
{'age_in_range': 1, 'email|regex': 1}
shape: (2, 4)
┌─────────┬─────┬───────────────────┬───────┐
│ user_id ┆ age ┆ email             ┆ score │
│ ---     ┆ --- ┆ ---               ┆ ---   │
│ i64     ┆ i64 ┆ str               ┆ f64   │
╞═════════╪═════╪═══════════════════╪═══════╡
│ 3       ┆ 22  ┆ invalid-email     ┆ 78.3  │
│ 5       ┆ 95  ┆ user5@example.com ┆ 95.2  │
└─────────┴─────┴───────────────────┴───────┘
</code></pre>
<p>The failure object can count failures by rule, show which rules tend to
fail together, and return the invalid rows themselves. <strong>Dataframely</strong>
can also validate <em>collections</em> of related DataFrames (checking, for
example, that every order refers to an existing customer), and its
schemas work with static type checkers. It&rsquo;s a good choice for data
engineering work on Polars, where the relationships between tables
matter as much as what&rsquo;s in each one.</p>
<h2 id="daffy">Daffy
</h2>
<p><strong>Daffy</strong> is the oldest of the newcomers (its repository dates from
2021), but it reached <code>v1.0.0</code> in November 2025 and has moved quickly
since, going through two more major versions in under a year. It works
differently from every other library here. Rather than validating a
DataFrame wherever you call a method, <strong>Daffy</strong> validates the DataFrames
that go into and come out of a function, using the decorators <code>@df_in</code>
and <code>@df_out</code>. That puts the checks right where data passes from one
step of a pipeline to the next, which is often where a mismatch first
causes trouble.</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">daffy</span> <span class="kn">import</span> <span class="n">df_in</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nd">@df_in</span><span class="p">({</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;user_id&#34;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&#34;dtype&#34;</span><span class="p">:</span> <span class="s2">&#34;Int64&#34;</span><span class="p">,</span> <span class="s2">&#34;checks&#34;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&#34;gt&#34;</span><span class="p">:</span> <span class="mi">0</span><span class="p">}},</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;age&#34;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&#34;dtype&#34;</span><span class="p">:</span> <span class="s2">&#34;Int64&#34;</span><span class="p">,</span> <span class="s2">&#34;checks&#34;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&#34;between&#34;</span><span class="p">:</span> <span class="p">(</span><span class="mi">18</span><span class="p">,</span> <span class="mi">80</span><span class="p">)}},</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;email&#34;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&#34;dtype&#34;</span><span class="p">:</span> <span class="s2">&#34;String&#34;</span><span class="p">,</span> <span class="s2">&#34;checks&#34;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&#34;str_regex&#34;</span><span class="p">:</span> <span class="sa">r</span><span class="s2">&#34;^[^@]+@[^@]+\.[^@]+$&#34;</span><span class="p">}},</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;score&#34;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&#34;dtype&#34;</span><span class="p">:</span> <span class="s2">&#34;Float64&#34;</span><span class="p">,</span> <span class="s2">&#34;checks&#34;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&#34;between&#34;</span><span class="p">:</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">100</span><span class="p">)}},</span>
</span></span><span class="line"><span class="cl"><span class="p">})</span>
</span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">mean_score</span><span class="p">(</span><span class="n">df</span><span class="p">):</span>
</span></span><span class="line"><span class="cl">    <span class="k">return</span> <span class="n">df</span><span class="p">[</span><span class="s2">&#34;score&#34;</span><span class="p">]</span><span class="o">.</span><span class="n">mean</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">try</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">    <span class="n">mean_score</span><span class="p">(</span><span class="n">user_data</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="k">except</span> <span class="ne">AssertionError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">    <span class="nb">print</span><span class="p">(</span><span class="n">e</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code>Check violations in function 'mean_score' parameter 'df':
  Column 'age' failed between: 1 values. Examples: [95]
  Column 'email' failed str_regex: 1 values. Examples: ['invalid-email']
</code></pre>
<p>The function never runs, because its input fails two checks, and the
message names the function, the parameter, and some of the failing
values. In its simplest form, <code>@df_in([&quot;user_id&quot;, &quot;email&quot;])</code> only
confirms that the columns exist, which is cheap and catches more real
bugs than you might expect. <strong>Daffy</strong> also supports regex patterns for
matching column names, uniqueness and nullability constraints, and
row-level validation through a Pydantic model for checks that span
several fields. It uses Narwhals and works with Polars, Pandas, Modin,
and PyArrow. <strong>Daffy</strong> is also the easiest library here to adopt a
little at a time, since you can add a decorator to one function without
touching anything else.</p>
<h2 id="checkedframe">checkedframe
</h2>
<p><strong>checkedframe</strong> is a lightweight library that has used Narwhals from
the start. Its author wanted it to work with any DataFrame library and
to stay independent of Pydantic. A schema is a class whose attributes
are column types, and you can add checks with built-in helpers or write
your own as decorated methods that take a Series, an expression, or a
whole DataFrame, depending on what the check needs:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">checkedframe</span> <span class="k">as</span> <span class="nn">cf</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">class</span> <span class="nc">UserSchema</span><span class="p">(</span><span class="n">cf</span><span class="o">.</span><span class="n">Schema</span><span class="p">):</span>
</span></span><span class="line"><span class="cl">    <span class="n">user_id</span> <span class="o">=</span> <span class="n">cf</span><span class="o">.</span><span class="n">Int64</span><span class="p">(</span><span class="n">checks</span><span class="o">=</span><span class="p">[</span><span class="n">cf</span><span class="o">.</span><span class="n">Check</span><span class="o">.</span><span class="n">gt</span><span class="p">(</span><span class="mi">0</span><span class="p">)])</span>
</span></span><span class="line"><span class="cl">    <span class="n">age</span> <span class="o">=</span> <span class="n">cf</span><span class="o">.</span><span class="n">Int64</span><span class="p">(</span><span class="n">checks</span><span class="o">=</span><span class="p">[</span><span class="n">cf</span><span class="o">.</span><span class="n">Check</span><span class="o">.</span><span class="n">is_between</span><span class="p">(</span><span class="mi">18</span><span class="p">,</span> <span class="mi">80</span><span class="p">)])</span>
</span></span><span class="line"><span class="cl">    <span class="n">email</span> <span class="o">=</span> <span class="n">cf</span><span class="o">.</span><span class="n">String</span><span class="p">(</span><span class="n">checks</span><span class="o">=</span><span class="p">[</span><span class="n">cf</span><span class="o">.</span><span class="n">Check</span><span class="o">.</span><span class="n">str_contains</span><span class="p">(</span><span class="sa">r</span><span class="s2">&#34;^[^@]+@[^@]+\.[^@]+$&#34;</span><span class="p">)])</span>
</span></span><span class="line"><span class="cl">    <span class="n">score</span> <span class="o">=</span> <span class="n">cf</span><span class="o">.</span><span class="n">Float64</span><span class="p">(</span><span class="n">checks</span><span class="o">=</span><span class="p">[</span><span class="n">cf</span><span class="o">.</span><span class="n">Check</span><span class="o">.</span><span class="n">is_between</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">100</span><span class="p">)])</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">try</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">    <span class="n">UserSchema</span><span class="o">.</span><span class="n">validate</span><span class="p">(</span><span class="n">user_data</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="k">except</span> <span class="n">cf</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">SchemaError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">    <span class="nb">print</span><span class="p">(</span><span class="n">e</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code>Found 2 error(s)
  age: 1 error(s)
    - is_between failed for 1 / 5 (20.00%) rows: Must be in range [18, 80]
  email: 1 error(s)
    - contains failed for 1 / 5 (20.00%) rows: Must contain ^[^@]+@[^@]+\.[^@]+$
</code></pre>
<p>Despite its name, <code>cf.Check.str_contains()</code> takes a regular expression,
and the <code>^</code> and <code>$</code> anchors make it a full match (hence the &ldquo;Must
contain&rdquo; wording in the message). The error message reports every
failure along with the share of rows affected. Since <strong>checkedframe</strong>
isn&rsquo;t tied to one DataFrame library, the same schema works on a Pandas
version of the table without any changes:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="k">try</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">    <span class="n">UserSchema</span><span class="o">.</span><span class="n">validate</span><span class="p">(</span><span class="n">user_data</span><span class="o">.</span><span class="n">to_pandas</span><span class="p">())</span>
</span></span><span class="line"><span class="cl"><span class="k">except</span> <span class="n">cf</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">SchemaError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">    <span class="nb">print</span><span class="p">(</span><span class="n">e</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code>Found 2 error(s)
  age: 1 error(s)
    - is_between failed for 1 / 5 (20.00%) rows: Must be in range [18, 80]
  email: 1 error(s)
    - contains failed for 1 / 5 (20.00%) rows: Must contain ^[^@]+@[^@]+\.[^@]+$
</code></pre>
<p><strong>checkedframe</strong> also has a <code>filter()</code> method that keeps only the
passing rows, safe casting that won&rsquo;t make a conversion if it would lose
information, and schema generation from existing data. The project has
had a single release so far (<code>v0.1.0</code>, September 2025), so it&rsquo;s still
young, but its design is clear and it makes good use of Narwhals.</p>
<h2 id="pavise">Pavise
</h2>
<p><strong>Pavise</strong> starts from Python&rsquo;s type system. A schema is a plain
<code>typing.Protocol</code> class, written without any base class or special
syntax beyond <code>typing.Annotated</code>. Wrapping a DataFrame as
<code>DataFrame[UserSchema]</code> validates it at runtime, and the same annotation
lets mypy or pyright check that each function receives the right kind of
DataFrame:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Annotated</span><span class="p">,</span> <span class="n">Protocol</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">pavise.polars</span> <span class="kn">import</span> <span class="n">DataFrame</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">pavise.exceptions</span> <span class="kn">import</span> <span class="n">ValidationError</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">pavise.validators</span> <span class="kn">import</span> <span class="n">Gt</span><span class="p">,</span> <span class="n">Range</span><span class="p">,</span> <span class="n">Regex</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">class</span> <span class="nc">UserSchema</span><span class="p">(</span><span class="n">Protocol</span><span class="p">):</span>
</span></span><span class="line"><span class="cl">    <span class="n">user_id</span><span class="p">:</span> <span class="n">Annotated</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="n">Gt</span><span class="p">(</span><span class="mi">0</span><span class="p">)]</span>
</span></span><span class="line"><span class="cl">    <span class="n">age</span><span class="p">:</span> <span class="n">Annotated</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="n">Range</span><span class="p">(</span><span class="mi">18</span><span class="p">,</span> <span class="mi">80</span><span class="p">)]</span>
</span></span><span class="line"><span class="cl">    <span class="n">email</span><span class="p">:</span> <span class="n">Annotated</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Regex</span><span class="p">(</span><span class="sa">r</span><span class="s2">&#34;^[^@]+@[^@]+\.[^@]+$&#34;</span><span class="p">)]</span>
</span></span><span class="line"><span class="cl">    <span class="n">score</span><span class="p">:</span> <span class="n">Annotated</span><span class="p">[</span><span class="nb">float</span><span class="p">,</span> <span class="n">Range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">100</span><span class="p">)]</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">try</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">    <span class="n">DataFrame</span><span class="p">[</span><span class="n">UserSchema</span><span class="p">](</span><span class="n">user_data</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="k">except</span> <span class="n">ValidationError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">    <span class="nb">print</span><span class="p">(</span><span class="n">e</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code>Column 'age': values must be in range [18, 80]

Sample invalid values (showing first 1 of 1):
  Row 4: 95
</code></pre>
<p><strong>Pavise</strong> reports only the <code>age</code> problem here, because it stops at the
first failing column (that&rsquo;s on purpose). <strong>Pavise</strong> is meant to guard
the edges of a system (where a file is read or a database is queried),
and there it&rsquo;s better to fail quickly with a clear message. Because it
uses Protocols, it gets structural subtyping for free: a DataFrame with
extra columns still satisfies a schema that doesn&rsquo;t mention them, and a
DataFrame validated against a more specific schema (<code>DataFrame[Child]</code>,
where the <code>Child</code> Protocol extends <code>Parent</code>) is accepted wherever a
<code>DataFrame[Parent]</code> is expected. The same schema works with Pandas if
you import <code>DataFrame</code> from <code>pavise.pandas</code> instead of <code>pavise.polars</code>,
and it also handles Polars <code>LazyFrame</code> objects. <strong>Pavise</strong> is a recent
project (created at the start of 2026), and it&rsquo;s most likely to appeal
to people who rely a lot on static type checking.</p>
<h2 id="polspec">polspec
</h2>
<p><strong>polspec</strong> is the newest library here, created in September 2026, and
it requires Polars 2. It tries to solve a common problem: the schema
that validates production data and the fixtures used in tests are
usually written separately, and over time they drift apart. A
<strong>polspec</strong> schema does both jobs. Each column gets a type and its
constraints, and the resulting class can both validate a DataFrame and
generate one:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">polspec</span> <span class="kn">import</span> <span class="n">ColSpec</span><span class="p">,</span> <span class="n">FrameSpec</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">class</span> <span class="nc">Users</span><span class="p">(</span><span class="n">FrameSpec</span><span class="p">):</span>
</span></span><span class="line"><span class="cl">    <span class="n">user_id</span> <span class="o">=</span> <span class="n">ColSpec</span><span class="p">(</span><span class="n">pl</span><span class="o">.</span><span class="n">Int64</span><span class="p">,</span> <span class="n">bounds</span><span class="o">=</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">10</span><span class="o">**</span><span class="mi">9</span><span class="p">),</span> <span class="n">unique</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="n">age</span> <span class="o">=</span> <span class="n">ColSpec</span><span class="p">(</span><span class="n">pl</span><span class="o">.</span><span class="n">Int64</span><span class="p">,</span> <span class="n">bounds</span><span class="o">=</span><span class="p">(</span><span class="mi">18</span><span class="p">,</span> <span class="mi">80</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">    <span class="n">email</span> <span class="o">=</span> <span class="n">ColSpec</span><span class="p">(</span><span class="n">pl</span><span class="o">.</span><span class="n">String</span><span class="p">,</span> <span class="nb">format</span><span class="o">=</span><span class="s2">&#34;email&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="n">score</span> <span class="o">=</span> <span class="n">ColSpec</span><span class="p">(</span><span class="n">pl</span><span class="o">.</span><span class="n">Float64</span><span class="p">,</span> <span class="n">bounds</span><span class="o">=</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">100</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">Users</span><span class="o">.</span><span class="n">inspect</span><span class="p">(</span><span class="n">user_data</span><span class="p">))</span></span></span></code></pre></div></div>
<pre><code>Validation failed for DataFrame against 'Users' (2 error(s) found):
  - Column 'age': found 1 value(s) out of bounds [18, 80] (min found: 22, max found: 95). Out of bounds samples: [95] (20.0% of rows)
  - Column 'email': found 1 value(s) that are not email (an address with one '@' and a dotted domain). Invalid samples: ['invalid-email'] (20.0% of rows)
</code></pre>
<p>The <code>inspect()</code> method returns every finding at once as a report,
including the observed range of the out-of-bounds column and the share
of rows affected (<code>validate()</code> raises an error with the same
information). To generate data, you use the same class:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">Users</span><span class="o">.</span><span class="n">generate</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="n">seed</span><span class="o">=</span><span class="mi">23</span><span class="p">))</span></span></span></code></pre></div></div>
<pre><code>shape: (5, 4)
┌───────────┬─────┬──────────────────────────┬───────────┐
│ user_id   ┆ age ┆ email                    ┆ score     │
│ ---       ┆ --- ┆ ---                      ┆ ---       │
│ i64       ┆ i64 ┆ str                      ┆ f64       │
╞═══════════╪═════╪══════════════════════════╪═══════════╡
│ 666943414 ┆ 50  ┆ io5m@fqknrcbg.net        ┆ 79.733203 │
│ 771953561 ┆ 72  ┆ 84lw7@dwztxk.org         ┆ 60.065361 │
│ 350612632 ┆ 73  ┆ qh6n@nlxr.edu            ┆ 31.814339 │
│ 404870690 ┆ 55  ┆ mdy@hwkvui.edu           ┆ 45.145386 │
│ 255323833 ┆ 51  ┆ mphvn32cu@aozwwjejdq.org ┆ 31.607739 │
└───────────┴─────┴──────────────────────────┴───────────┘
</code></pre>
<p>Every generated row satisfies the declared constraints, and a fixed seed
gives you the same data on every platform. <strong>polspec</strong> can do more than
this example shows. It can profile an existing table to produce a
starting schema, generate related tables with consistent foreign keys,
report statistically significant drift between two datasets, and run
from the command line in CI. <strong>Pointblank</strong> and <strong>Dataframely</strong> can also
generate data from schemas, but <strong>polspec</strong> is the one that puts
generation and validation together at its center.</p>
<h2 id="the-growing-role-of-narwhals">The Growing Role of Narwhals
</h2>
<p>The biggest change since 2025 is how many of these libraries now use
Narwhals. Narwhals offers a subset of the Polars API that works with
many DataFrame libraries, translating each operation into whatever the
underlying library understands. In the first survey, <strong>Pointblank</strong> and
<strong>Validoopsie</strong> were the only libraries that used it. Since then,
<strong>Pandera</strong> has added a Narwhals backend, <strong>Daffy</strong> has adopted it, and
<strong>checkedframe</strong> was built on it from the beginning. For a validation
library this is an appealing setup. You write the checks once, in a
familiar expression-based style, and they work on Polars, Pandas,
PyArrow, and in some cases database tables.</p>
<p>The libraries that are still Polars-only (<strong>Patito</strong>, <strong>Dataframely</strong>,
and <strong>polspec</strong>) have made a different choice, and it&rsquo;s just as
reasonable. By committing to one library, they can expose Polars
expressions directly in their rules, follow Polars&rsquo; lazy execution model
closely, and pick up new Polars features as soon as they appear.
<strong>polspec</strong>&rsquo;s decision to require Polars 2 is the clearest example.
Rather than asking which approach is better, it may help to ask which
one fits your situation. If all of your data is in Polars, tight
integration may matter most. If you move between Pandas, Polars, and a
warehouse, a single API that works across all of them may be more
useful.</p>
<h2 id="choosing-a-library">Choosing a Library
</h2>
<p>With nine libraries to choose from, a few questions can help narrow
things down. The first is what tools you already use. If you already use
Pydantic, <strong>Patito</strong> will feel natural, and if you rely on static type
checking, <strong>Pandera</strong>, <strong>Dataframely</strong>, and <strong>Pavise</strong> are worth a look.
If your DataFrames move between several libraries, <strong>checkedframe</strong>,
<strong>Daffy</strong>, <strong>Validoopsie</strong>, <strong>Pointblank</strong>, and <strong>Pandera</strong>&rsquo;s Narwhals
backend all save you from writing the same checks twice.</p>
<p>The second question is where validation should happen. <strong>Daffy</strong> puts it
at the boundary of every function, <strong>Pavise</strong> at the boundary of the
system, and the other libraries wherever you call them. The third is
what should happen when something fails. Most of these libraries report
every failure at once (<strong>Pandera</strong> does so when you ask with
<code>lazy=True</code>), while <strong>Pavise</strong> deliberately stops at the first.
<strong>Pandera</strong> (with <code>drop_invalid_rows=True</code>), <strong>Pointblank</strong> (with
<code>get_sundered_data()</code>), <strong>Dataframely</strong>, <strong>checkedframe</strong>, and
<strong>polspec</strong> can also separate good rows from bad ones, so a pipeline can
carry on with the clean data and set the rest aside. <strong>Pointblank</strong> and
<strong>Validoopsie</strong> let you accept a certain share of failures through
thresholds, so validation becomes a measure of quality you can track and
improve over time, not just a pass or fail.</p>
<div id="qnrtxsobuu" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
<style>
#qnrtxsobuu table {
          font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }
#qnrtxsobuu thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#qnrtxsobuu p { margin: 0; padding: 0; }
 #qnrtxsobuu .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }
 #qnrtxsobuu .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #qnrtxsobuu .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
 #qnrtxsobuu .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-top-color: #FFFFFF; border-top-width: 0; }
 #qnrtxsobuu .gt_heading { background-color: #FFFFFF; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #qnrtxsobuu .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #qnrtxsobuu .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #qnrtxsobuu .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; overflow-x: hidden; }
 #qnrtxsobuu .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
 #qnrtxsobuu .gt_column_spanner_outer:first-child { padding-left: 0; }
 #qnrtxsobuu .gt_column_spanner_outer:last-child { padding-right: 0; }
 #qnrtxsobuu .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
 #qnrtxsobuu .gt_spanner_row { border-bottom-style: hidden; }
 #qnrtxsobuu .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }
 #qnrtxsobuu .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }
 #qnrtxsobuu .gt_from_md> :first-child { margin-top: 0; }
 #qnrtxsobuu .gt_from_md> :last-child { margin-bottom: 0; }
 #qnrtxsobuu .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }
 #qnrtxsobuu .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; }
 #qnrtxsobuu .gt_indent_1 { text-indent: 5px; }
 #qnrtxsobuu .gt_indent_2 { text-indent: calc(5px * 2); }
 #qnrtxsobuu .gt_indent_3 { text-indent: calc(5px * 3); }
 #qnrtxsobuu .gt_indent_4 { text-indent: calc(5px * 4); }
 #qnrtxsobuu .gt_indent_5 { text-indent: calc(5px * 5); }
 #qnrtxsobuu .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; vertical-align: top; }
 #qnrtxsobuu .gt_row_group_first td { border-top-width: 2px; }
 #qnrtxsobuu .gt_row_group_first th { border-top-width: 2px; }
 #qnrtxsobuu .gt_striped { color: #333333; background-color: #F4F4F4; }
 #qnrtxsobuu .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #qnrtxsobuu .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #qnrtxsobuu .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #qnrtxsobuu .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #qnrtxsobuu .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #qnrtxsobuu .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #qnrtxsobuu .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #qnrtxsobuu .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #qnrtxsobuu .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; text-align: left; }
 #qnrtxsobuu .gt_left { text-align: left; }
 #qnrtxsobuu .gt_center { text-align: center; }
 #qnrtxsobuu .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #qnrtxsobuu .gt_font_normal { font-weight: normal; }
 #qnrtxsobuu .gt_font_bold { font-weight: bold; }
 #qnrtxsobuu .gt_font_italic { font-style: italic; }
 #qnrtxsobuu .gt_super { font-size: 65%; }
 #qnrtxsobuu .gt_footnotes { color: font-color(#FFFFFF); background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #qnrtxsobuu .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #qnrtxsobuu .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #qnrtxsobuu .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; text-align: left; }
 #qnrtxsobuu .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #qnrtxsobuu .gt_asterisk { font-size: 100%; vertical-align: 0; }
</style>
<table class="gt_table" data-quarto-disable-processing="true" data-quarto-bootstrap="false">
<thead>
<tr class="gt_col_headings">
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="use_case">Use Case</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="libs">Libraries to Consider</th>
</tr>
</thead>
<tbody class="gt_table_body">
  <tr>
    <td headers="use_case" class="gt_row gt_left">Type-safe pipelines</td>
    <td headers="libs" class="gt_row gt_left">Pandera, Dataframely, Pavise</td>
  </tr>
  <tr>
    <td headers="use_case" class="gt_row gt_left">Stakeholder reporting</td>
    <td headers="libs" class="gt_row gt_left">Pointblank</td>
  </tr>
  <tr>
    <td headers="use_case" class="gt_row gt_left">Pydantic-based applications</td>
    <td headers="libs" class="gt_row gt_left">Patito</td>
  </tr>
  <tr>
    <td headers="use_case" class="gt_row gt_left">Statistical validation</td>
    <td headers="libs" class="gt_row gt_left">Pandera</td>
  </tr>
  <tr>
    <td headers="use_case" class="gt_row gt_left">Gradual quality improvement</td>
    <td headers="libs" class="gt_row gt_left">Pointblank, Validoopsie</td>
  </tr>
  <tr>
    <td headers="use_case" class="gt_row gt_left">Validation at function boundaries</td>
    <td headers="libs" class="gt_row gt_left">Daffy</td>
  </tr>
  <tr>
    <td headers="use_case" class="gt_row gt_left">Working across DataFrame libraries</td>
    <td headers="libs" class="gt_row gt_left">checkedframe, Daffy, Pointblank, Validoopsie, Pandera</td>
  </tr>
  <tr>
    <td headers="use_case" class="gt_row gt_left">Test fixtures that match the schema</td>
    <td headers="libs" class="gt_row gt_left">polspec, Dataframely, Pointblank, Patito</td>
  </tr>
</tbody>
</table>
</div>
<p>One newer consideration is how well a library supports coding agents.
Writing a full set of checks by hand can be tedious, and an agent that
knows a library&rsquo;s API can draft a first version from a description of
the data, leaving you to review and adjust it. A few of these projects
now publish material for exactly this purpose. <strong>Dataframely</strong> provides
an <a href="https://github.com/Quantco/dataframely/blob/main/skills/dataframely/SKILL.md" target="_blank" rel="noopener">agent
skill</a>
along with a <a href="https://dataframely.readthedocs.io/latest/guides/coding-agents.html" target="_blank" rel="noopener">guide to working with coding
agents</a>.
<strong>Pointblank</strong> ships <a href="https://github.com/posit-dev/pointblank/tree/main/skills" target="_blank" rel="noopener">several
skills</a> (for
writing validations, defining data contracts, and generating test data,
among other tasks) and an <a href="https://posit-dev.github.io/pointblank/user-guide/integrations/mcp-quick-start.html" target="_blank" rel="noopener">MCP
server</a>.
<strong>polspec</strong> publishes an
<a href="https://maxwellb13.github.io/polspec/llms.txt" target="_blank" rel="noopener"><code>llms.txt</code></a> file that
gives a language model its complete documentation in one place.
Schema-based libraries have something of an advantage here regardless,
since a schema is a compact description of the data that is easy for an
agent to read, write, and check against the real thing.</p>
<p>Finally, these libraries work well together. A pipeline might use
<strong>Daffy</strong> decorators on its transformation functions, <strong>Dataframely</strong> or
<strong>Pandera</strong> schemas at its main stages, and a <strong>Pointblank</strong> report for
the people downstream who need to know whether they can trust the data.
A good way to start is with whichever library fits your most pressing
need, adding others as your requirements grow.</p>
<h2 id="wrapping-up">Wrapping Up
</h2>
<p>The Python ecosystem for validating Polars DataFrames is in better shape
than it was eighteen months ago. The established libraries have matured
and broadened their reach, and the newer ones bring some genuinely new
ideas: decorators that check data at function boundaries, schemas that
double as type annotations, and schemas that generate the data they
describe. Every library in this survey found trouble in our small table
(<strong>Pavise</strong>, by design, stopped at the first problem). Where they differ
is in how the checks are written (in a schema, a chain of steps, or a
function decorator), what happens when something fails (an exception, a
log entry, a filtered table, or a report), and how many DataFrame
libraries they work with.</p>
<p>This survey reflects what we know about these libraries at the end of
2026, and things move fast enough that some details will soon be out of
date. The links in the table at the top of this post lead to each
project&rsquo;s repository, which is the best place to find current
documentation, ask questions, or report problems. If one of these
libraries caught your interest, try it on a table of your own. The small
example above only takes a few minutes to adapt, and it&rsquo;s a good way to
get a feel for how a library works before you commit to it.</p>
]]></description>
      <enclosure url="https://opensource.posit.co/blog/2026-11-30_validation-libs-2026/assets/validation-libs-2026.png" length="114431" type="image/png" />
    </item>
    <item>
      <title>Positron October Release Highlights</title>
      <link>https://opensource.posit.co/blog/2026-10-13_positron-2026-10-release/</link>
      <pubDate>Tue, 13 Oct 2026 00:00:00 +0000</pubDate>
      <guid>https://opensource.posit.co/blog/2026-10-13_positron-2026-10-release/</guid>
      <dc:creator>Julia Silge</dc:creator><description><![CDATA[<div class="callout callout-note" role="note" aria-label="Note">
<div class="callout-header">
<span class="callout-title">Note</span>
</div>
<div class="callout-body">
<p><a href="https://positron.posit.co/?utm_source=opensource-posit-co&amp;utm_medium=referral&amp;utm_campaign=positron-2026-10-release-blog&amp;utm_content=intro-note" target="_blank" rel="noopener">Positron</a> is Posit&rsquo;s new, next-generation IDE for data science. Positron is designed to be an extensible, polyglot tool for exploring data and reproducible authoring in Python, R, and more.</p>
</div>
</div>
<p>Welcome back to another edition of our monthly Positron updates! Each month we share highlights from our <a href="https://positron.posit.co/release-notes?utm_source=opensource-posit-co&amp;utm_medium=referral&amp;utm_campaign=positron-2026-10-release-blog&amp;utm_content=release-notes-link" target="_blank" rel="noopener">latest release</a> and useful resources. <a href="https://opensource.posit.co/blog/2026-09-09_positron-2026-09-release">Last release</a> we told you about a redesigned welcome page, a first version of Import Data, new Posit Assistant features, expanded Data Connections, package vulnerability scanning, and a more responsive Console. This milestone brings a new ability for Posit Assistant to drive Positron itself, a built-in MCP server so you can bring your own coding agent, Data Connections on by default, faster language features for Quarto, and smoother interpreter and project setup.</p>
<h2 id="posit-assistant-can-drive-positron">Posit Assistant can drive Positron
</h2>
<p><a href="https://assistant.posit.co/?utm_source=opensource-posit-co&amp;utm_medium=referral&amp;utm_campaign=positron-2026-10-release-blog&amp;utm_content=assistant-section" target="_blank" rel="noopener">Posit Assistant</a> can now operate Positron itself, not just the R or Python session inside it. You can ask it to run a Shiny app, open a Parquet file in the Data Explorer, set up a Python environment, browse your data connections, or deploy to Posit Connect. Posit Assistant uses the same source of truth as the Positron UI, so it works with your real interpreters, packages, and connections rather than guessing at them.</p>
<img src="https://opensource.posit.co/blog/2026-10-13_positron-2026-10-release/assistant-data-explorer.png" data-fig-align="center" data-fig-alt="Positron with the Posit Assistant chat beside the Data Explorer, which shows pokemon.xlsx that Posit Assistant opened." />
<p>In practice, this means Posit Assistant can run and preview Dash, FastAPI, Flask, Gradio, marimo, Streamlit, and Shiny apps with the same app commands you use, see which apps are running along with their status and URL, and stop them. It can show HTML files and URLs in the Viewer pane, and it can read, take screenshots of, and interact with data apps and other content there, which makes it much more useful for checking its own work on an app. It can read your configured and detected Data Connections, browse a connection&rsquo;s schema, and give you the code to open it. It can also tell which interpreter a project uses, explain why an installed interpreter isn&rsquo;t showing up, and make that interpreter available, and it knows the commands for deploying to Connect through Posit Publisher.</p>
<p>To try this preview feature, enable the <a href="positron://settings/assistant.previewFeatures"><code>assistant.previewFeatures</code></a> setting, and tell us what you think in the <a href="https://github.com/posit-dev/positron/discussions/16280" target="_blank" rel="noopener">GitHub discussion</a>.</p>
<h2 id="bring-your-own-coding-agent">Bring your own coding agent
</h2>
<p>If you already have a favorite coding agent other than Posit Assistant, this release lets it work alongside you in Positron. A new built-in Model Context Protocol (MCP) server lets coding agents such as Claude Code, Codex, and Gemini CLI work in your live Python and R sessions. Our goal is to give these agents a set of tools comparable to what Posit Assistant has: agents can list your sessions, run code in the Console, inspect objects without cluttering your history, read recent session history, interrupt a long-running computation, look at the current plot, and search for and run Positron commands. These other agents may not have the data science expertise that Posit Assistant has, but they can still help you write code and explore data.</p>
<p>You stay in the loop on what an agent does. Code that an agent runs shows up in the Console with the agent&rsquo;s name next to it, so you can always tell agent code from your own. Console tabs also now show a dot when code runs in a console you aren&rsquo;t looking at, whether that code came from Posit Assistant or an external agent.</p>
<img src="https://opensource.posit.co/blog/2026-10-13_positron-2026-10-release/claude-code-in-positron.png" data-fig-align="center" data-fig-alt="Claude Code in Positron&#39;s editor area, asked whether to visualize country-to-country twinning relationships as a heatmap or a network graph. It calls the Positron execute_code and get_plot tools, then recommends the heatmap and explains it. In the Console, the R code it ran is labeled Claude Code, and the Plots pane shows the resulting heatmap of twinning links between the top countries." />
<p>To try this experimental feature, enable the <a href="positron://settings/ai.mcp.enabled"><code>ai.mcp.enabled</code></a> setting. Positron configures Claude Code for you automatically, and the <em>Positron MCP: Add to Coding Agent</em> command sets up the Codex and Gemini CLIs. For any other MCP client, <em>Copy Connection Details</em> gives you a URL and token to connect with.</p>
<h2 id="data-connections-on-by-default">Data Connections on by default
</h2>
<p><a href="https://positron.posit.co/data-connections?utm_source=opensource-posit-co&amp;utm_medium=referral&amp;utm_campaign=positron-2026-10-release-blog&amp;utm_content=data-connections-section" target="_blank" rel="noopener">Data Connections</a> is now the default way to work with databases and data warehouses in Positron. Data Connections connects to databases directly, without needing a Python or R session, and it replaces both the older Connections pane and the Catalog Explorer. If you need the older Connections pane, set <a href="positron://settings/dataConnections.enabled"><code>dataConnections.enabled</code></a> to <code>false</code> and reload the window.</p>
<p>This release also extends what you can connect to and how you sign in. Amazon Redshift connections can sign in with AWS Identity and Access Management (IAM), for both Redshift Serverless and provisioned clusters, using credentials from the standard AWS credential provider chain. On Posit Workbench, Snowflake and Databricks connections can use the session&rsquo;s managed credentials with no credential input at all. Snowflake users get the most new features this month; the Data Connections pane shows Snowflake semantic views with their dimensions, facts, metrics, and relationships, you can browse Snowflake stages as folders and files, and connections in <code>connections.toml</code> show up automatically as detected connections.</p>
<p>Smaller improvements round out the experience. When you open a DuckDB or SQLite file from the Explorer, Positron offers to create a data connection for it. <strong>Connect With</strong> can now generate ggsql code for SQLite, DuckDB, ODBC, PostgreSQL, and Redshift connections.</p>
<img src="https://opensource.posit.co/blog/2026-10-13_positron-2026-10-release/connections-ggsql-bikeshare.gif" data-fig-align="center" data-fig-alt="The Data Connections pane in Positron showing a Bikeshare demo SQLite connection. Choosing ggsql under Connect With opens a dialog with the generated connection code. After clicking Connect, the code runs in a ggsql console, followed by a SQL query that counts bikes by bike type and returns a results table." />
<p>The <strong>Add Data Connection</strong> dialog lists each driver with a short description, and Positron now tells you when a connection fails to open or expand. For slow tables and views, the Data Explorer now shows a progress indicator and placeholders while data arrives, and it loads column summaries in two passes so that missing-value counts appear quickly and sparklines follow later.</p>
<h2 id="faster-language-features-for-quarto">Faster language features for Quarto
</h2>
<p>Positron now provides completions, hover, diagnostics, outline, formatting, and other language features natively for R and Python cells in Quarto and R Markdown documents. Before, the Quarto extension wrote temporary virtual documents to disk to power these features. Positron now uses a virtual notebook in memory instead, which is faster (especially in remote sessions) and solves a whole category of bugs, such as Python imports that did not resolve correctly. It also means Go to Definition, Find References, and Rename work across R cells, finding names that earlier cells define.</p>
<p>The document outline for Quarto and R Markdown documents with many code chunks now updates quickly, and it no longer shows duplicate groups or symbols. Inline output, including HTML tables and the inline Data Explorer, now scales with your editor font size. If you run into problems with the new language features and need to go back to the old behavior, set <a href="positron://settings/quarto.embeddedLanguageFeatures.native"><code>quarto.embeddedLanguageFeatures.native</code></a> to <code>false</code>.</p>
<h2 id="interpreter-project-setup">Interpreter project setup
</h2>
<p>Positron is better at setting up the right Python environment for your project. When a workspace has a <code>uv.lock</code> or <code>pixi.lock</code> file but no environment yet, Positron offers to create it with <code>uv sync</code> or <code>pixi install</code>, which is especially handy right after you clone a project. If uv is missing, the New Folder flow can install it for you, and package installs and the Packages pane work with uv right away. When Positron finds a new Python environment in a workspace, it now offers to start a console session in it, and system Python installations now show last in the interpreter picker, below uv, venv, conda, and pyenv environments.</p>
<img src="https://opensource.posit.co/blog/2026-10-13_positron-2026-10-release/uv-lock-create-env.gif" data-fig-align="center" data-fig-alt="A Shiny dashboard Quarto document open in Positron. A notification says the project has a uv.lock file but no virtual environment and offers to run uv sync. After clicking Yes, Positron creates the environment and then offers to start a console session with it." />
<p>For more control over interpreters in <em>both</em> Python and R, interpreter path settings now support <code>${workspaceFolder}</code>, so a project can point to an interpreter that lives inside it. The new <a href="positron://settings/interpreters.definitions"><code>interpreters.definitions</code></a> setting lets you define additional R and Python interpreters, each with its own label, environment variables, and startup script. This is useful for workflows like loading environment modules or configuring rJava before a session starts. Set <a href="positron://settings/interpreters.discovery"><code>interpreters.discovery</code></a> to <code>definitionsOnly</code> to show only the interpreters you have defined for a language.</p>
<h2 id="whats-coming-next">What&rsquo;s coming next
</h2>
<ul>
<li>Meet Posit at <a href="https://posit.co/events/snowflake-world-tour-2026-nyc?utm_source=opensource-posit-co&amp;utm_medium=referral&amp;utm_campaign=positron-2026-10-release-blog&amp;utm_term=snowflake&amp;utm_content=events-section" target="_blank" rel="noopener">Snowflake World Tour NYC</a> on October 15. Stop by our booth, schedule time with a Posit expert, or catch our theater session on AI-powered data science where your data lives, inside Snowflake.</li>
<li>Join us at <a href="https://opensource.posit.co/events/data-outpost-2026/" target="_blank" rel="noopener">Data Outpost</a> on November 4-5 in San Francisco. I&rsquo;ll be speaking on &ldquo;The SQL Agent Harness We Didn&rsquo;t Mean to Build,&rdquo; about how the SQL tools we built in Positron for people turned out to already be a harness for AI assistants.</li>
</ul>
<div class="callout callout-tip" role="note" aria-label="Tip">
<div class="callout-header">
<span class="callout-title">Tip</span>
</div>
<div class="callout-body">
<p><a href="https://positron.posit.co/download?utm_source=opensource-posit-co&amp;utm_medium=referral&amp;utm_campaign=positron-2026-10-release-blog&amp;utm_content=download-cta" target="_blank" rel="noopener">Download Positron</a> to try out the new features and improvements in this release!</p>
</div>
</div>
]]></description>
      <enclosure url="https://opensource.posit.co/blog/2026-10-13_positron-2026-10-release/featured.svg" length="91754" type="image/svg&#43;xml" />
    </item>
    <item>
      <title>Multiple tables, saved conversations, and take-home dashboards: querychat R 0.4.0 and Python 0.9.0</title>
      <link>https://opensource.posit.co/blog/2026-09-29_querychat-tables-handoff/</link>
      <pubDate>Tue, 29 Sep 2026 00:00:00 +0000</pubDate>
      <guid>https://opensource.posit.co/blog/2026-09-29_querychat-tables-handoff/</guid>
      <dc:creator>Carson Sievert</dc:creator>
      <dc:creator>Garrick Aden-Buie</dc:creator><description><![CDATA[<p>I&rsquo;m thrilled to share the latest <a href="https://posit-dev.github.io/querychat" target="_blank" rel="noopener">querychat</a> release for both R (v0.4.0) and Python (v0.9.0).
Grab the latest from CRAN or PyPI:</p>
<div class="panel-tabset" data-tabset-group="language">
<ul id="tabset-1" class="panel-tabset-tabby">
<li><a data-tabby-default href="#tabset-1-1">R</a></li>
<li><a href="#tabset-1-2">Python</a></li>
</ul>
<div id="tabset-1-1">
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">install.packages</span><span class="p">(</span><span class="s">&#34;querychat&#34;</span><span class="p">)</span></span></span></code></pre></div></div>
</div>
<div id="tabset-1-2">
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">pip install -U querychat</span></span></code></pre></div></div>
</div>
</div>
<p>This release adds several headline features, including support for multiple tables, <code>data-dict.yml</code>, a full-page chat layout, support for pins, and a new <code>/handoff</code> command.
It also builds on <a href="https://opensource.posit.co/blog/2026-09-15_shinychat-r-0.5.0-python-0.7.1">shinychat&rsquo;s recent momentum</a>.
As a result, querychat gets chat features like history and file attachments basically for free.
<code>querychat_app()</code> provides a quick and useful way to start chatting with data and getting bespoke <a href="https://opensource.posit.co/blog/2026-06-17_querychat-ggsql">ggsql visualizations</a>, and it now uses shinychat&rsquo;s <code>page_chat()</code> for a full chat app experience.</p>
<p>See the <a href="https://github.com/posit-dev/querychat/blob/main/pkg-r/NEWS.md" target="_blank" rel="noopener">R release notes</a> and the <a href="https://github.com/posit-dev/querychat/blob/main/pkg-py/CHANGELOG.md" target="_blank" rel="noopener">Python changelog</a> for the complete list, including <a href="#a-few-changes-for-existing-apps">a few changes for existing apps</a> if you&rsquo;re upgrading.</p>
<h2 id="full-page-chat-layout">Full-page chat layout
</h2>
<p><code>querychat_app()</code> / <code>QueryChat.app()</code> now put the chat front and center (built on shinychat&rsquo;s <code>page_chat()</code>), leaving more breathing room for things you create within the chat.</p>
<div class="panel-tabset" data-tabset-group="language">
<ul id="tabset-2" class="panel-tabset-tabby">
<li><a data-tabby-default href="#tabset-2-1">R</a></li>
<li><a href="#tabset-2-2">Python</a></li>
</ul>
<div id="tabset-2-1">
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">library</span><span class="p">(</span><span class="n">palmerpenguins</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nf">querychat_app</span><span class="p">(</span><span class="n">penguins</span><span class="p">)</span></span></span></code></pre></div></div>
</div>
<div id="tabset-2-2">
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">querychat</span> <span class="kn">import</span> <span class="n">QueryChat</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">palmerpenguins</span> <span class="kn">import</span> <span class="n">load_penguins</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">qc</span> <span class="o">=</span> <span class="n">QueryChat</span><span class="p">(</span><span class="n">load_penguins</span><span class="p">(),</span> <span class="s2">&#34;penguins&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">qc</span><span class="o">.</span><span class="n">app</span><span class="p">()</span></span></span></code></pre></div></div>
</div>
</div>
<script src="https://fast.wistia.com/player.js" async></script>
<script src="https://fast.wistia.com/embed/xe4aalo9yw.js" async type="module"></script>
<style>wistia-player[media-id='xe4aalo9yw']:not(:defined) { background: center / contain no-repeat url('https://fast.wistia.com/embed/medias/xe4aalo9yw/swatch'); display: block; filter: blur(5px); padding-top:75.21%; }</style>
<p><wistia-player media-id="xe4aalo9yw" aspect="1.3296296296296297"></wistia-player></p>
<p>A view of the actual data is always accessible via the data source drawer on the right-hand side.
In the case of <a href="#multiple-tables">multiple tables</a>, you&rsquo;ll see the active table<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>, as well as other available tables below it.</p>
<img src="https://opensource.posit.co/blog/2026-09-29_querychat-tables-handoff/multi-table.png" alt="A view of QueryChat.app() with the data source drawer opened." class="shadow rounded" />
<p>The new <code>page()</code> method brings this same full-page chat layout to your own apps.
Your users get the chat front and center, and you can still add custom views on other <code>pages</code>, in the <code>drawer</code>, or in the <code>sidebar</code>.</p>
<p>Learn more about <a href="https://posit-dev.github.io/querychat/r/articles/build.html" target="_blank" rel="noopener">building custom apps in R</a> and <a href="https://posit-dev.github.io/querychat/py/build.html" target="_blank" rel="noopener">Python</a>.</p>
<div class="panel-tabset" data-tabset-group="language">
<ul id="tabset-3" class="panel-tabset-tabby">
<li><a data-tabby-default href="#tabset-3-1">R</a></li>
<li><a href="#tabset-3-2">Python</a></li>
</ul>
<div id="tabset-3-1">
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="n">qc</span> <span class="o">&lt;-</span> <span class="n">QueryChat</span><span class="o">$</span><span class="nf">new</span><span class="p">(</span><span class="n">penguins</span><span class="p">,</span> <span class="s">&#34;penguins&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">ui</span> <span class="o">&lt;-</span> <span class="n">qc</span><span class="o">$</span><span class="nf">page</span><span class="p">(</span><span class="s">&#34;Penguins Explorer&#34;</span><span class="p">)</span></span></span></code></pre></div></div>
</div>
<div id="tabset-3-2">
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">querychat.express</span> <span class="kn">import</span> <span class="n">QueryChat</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">palmerpenguins</span> <span class="kn">import</span> <span class="n">load_penguins</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">qc</span> <span class="o">=</span> <span class="n">QueryChat</span><span class="p">(</span><span class="n">load_penguins</span><span class="p">(),</span> <span class="s2">&#34;penguins&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">qc</span><span class="o">.</span><span class="n">page</span><span class="p">(</span><span class="s2">&#34;Penguins Explorer&#34;</span><span class="p">)</span></span></span></code></pre></div></div>
</div>
</div>
<h2 id="conversation-history">Conversation history
</h2>
<p>Another major improvement is persistent conversation history (<a href="https://opensource.posit.co/blog/2026-09-15_shinychat-r-0.5.0-python-0.7.1#return-to-earlier-conversations">mostly thanks to shinychat</a>).
In addition to starting new chats and returning to previous ones, conversations now persist across page reloads and timeouts.
As a result, it is now much more difficult to lose your progress.</p>
<img src="https://opensource.posit.co/blog/2026-09-29_querychat-tables-handoff/history.png" alt="A view of QueryChat.app() with the history sidebar opened." class="shadow rounded" />
<p>Also, now that shinychat supports <a href="https://opensource.posit.co/blog/2026-09-15_shinychat-r-0.5.0-python-0.7.1#edit-a-message-and-compare-answers">editable messages</a>, <a href="https://opensource.posit.co/blog/2026-09-15_shinychat-r-0.5.0-python-0.7.1#stream-responses-and-show-thinking">canceling responses</a>, <a href="https://opensource.posit.co/blog/2026-09-15_shinychat-r-0.5.0-python-0.7.1#attach-files">file attachments</a>, and more, querychat does too.</p>
<h2 id="multiple-tables">Multiple tables
</h2>
<p>querychat now supports multiple tables in a single chat instance.
If those tables reside in a singular source, like a database, you can add them all in one fell swoop with the <code>add_tables()</code> method.</p>
<div class="panel-tabset" data-tabset-group="language">
<ul id="tabset-4" class="panel-tabset-tabby">
<li><a data-tabby-default href="#tabset-4-1">R</a></li>
<li><a href="#tabset-4-2">Python</a></li>
</ul>
<div id="tabset-4-1">
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">library</span><span class="p">(</span><span class="n">querychat</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">qc</span> <span class="o">&lt;-</span> <span class="n">QueryChat</span><span class="o">$</span><span class="nf">new</span><span class="p">()</span>
</span></span><span class="line"><span class="cl"><span class="n">qc</span><span class="o">$</span><span class="nf">add_tables</span><span class="p">(</span><span class="n">db</span><span class="p">,</span> <span class="nf">c</span><span class="p">(</span><span class="s">&#34;customers&#34;</span><span class="p">,</span> <span class="s">&#34;orders&#34;</span><span class="p">,</span> <span class="s">&#34;order_items&#34;</span><span class="p">))</span></span></span></code></pre></div></div>
</div>
<div id="tabset-4-2">
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">querychat</span> <span class="kn">import</span> <span class="n">QueryChat</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">qc</span> <span class="o">=</span> <span class="n">QueryChat</span><span class="p">()</span>
</span></span><span class="line"><span class="cl"><span class="n">qc</span><span class="o">.</span><span class="n">add_tables</span><span class="p">(</span><span class="n">db</span><span class="p">,</span> <span class="p">[</span><span class="s2">&#34;customers&#34;</span><span class="p">,</span> <span class="s2">&#34;orders&#34;</span><span class="p">,</span> <span class="s2">&#34;order_items&#34;</span><span class="p">])</span></span></span></code></pre></div></div>
</div>
</div>
<p>querychat&rsquo;s query and visualization tools handle joins across these tables, so a single question can span all of them.
To write a query like the one below, the LLM first needs to know what&rsquo;s in each table: column names, types, and value ranges.
So it starts by fetching the schema of each table it needs (&ldquo;Fetch schemas&rdquo;), then generates the query with that metadata in mind.</p>
<img src="https://opensource.posit.co/blog/2026-09-29_querychat-tables-handoff/cross-join.png" alt="A chat asking for average order value by acquisition channel. The LLM fetches schemas for the customers, orders, and order_items tables, then runs a SQL query that joins all three." class="shadow rounded" />
<p>In a custom app, the new <code>table()</code> method gives your server code reactive access to any table, including whatever filters the LLM has applied to it.
That means you can keep building your own plots and views in Shiny, and your users can drive them just by chatting.</p>
<div class="panel-tabset" data-tabset-group="language">
<ul id="tabset-5" class="panel-tabset-tabby">
<li><a data-tabby-default href="#tabset-5-1">R</a></li>
<li><a href="#tabset-5-2">Python</a></li>
</ul>
<div id="tabset-5-1">
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="n">output</span><span class="o">$</span><span class="n">order_price</span> <span class="o">&lt;-</span> <span class="nf">renderPlot</span><span class="p">({</span>
</span></span><span class="line"><span class="cl">  <span class="n">orders_tbl</span> <span class="o">&lt;-</span> <span class="n">qc</span><span class="o">$</span><span class="nf">table</span><span class="p">(</span><span class="s">&#34;orders&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">  <span class="c1"># LLM can perform filter queries on $df()</span>
</span></span><span class="line"><span class="cl">  <span class="n">orders_df</span> <span class="o">&lt;-</span> <span class="n">orders_tbl</span><span class="o">$</span><span class="nf">df</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">  <span class="nf">hist</span><span class="p">(</span><span class="n">orders_df</span><span class="o">$</span><span class="n">price</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">})</span></span></span></code></pre></div></div>
</div>
<div id="tabset-5-2">
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="nd">@render.plot</span>
</span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">_</span><span class="p">():</span>
</span></span><span class="line"><span class="cl">  <span class="n">orders_tbl</span> <span class="o">=</span> <span class="n">qc</span><span class="o">.</span><span class="n">table</span><span class="p">(</span><span class="s2">&#34;orders&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">  <span class="c1"># LLM can perform filter queries on .df()</span>
</span></span><span class="line"><span class="cl">  <span class="n">orders_df</span> <span class="o">=</span> <span class="n">orders_tbl</span><span class="o">.</span><span class="n">df</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">  <span class="n">plt</span><span class="o">.</span><span class="n">hist</span><span class="p">(</span><span class="n">orders_df</span><span class="p">[</span><span class="s2">&#34;price&#34;</span><span class="p">])</span></span></span></code></pre></div></div>
</div>
</div>
<h2 id="provide-context-data-dict">Provide context: <code>data-dict</code>
</h2>
<p>querychat does its best to gather context from the data itself.
When the LLM fetches a table&rsquo;s schema, it gets whatever metadata querychat can compute from the data.
That&rsquo;s a good start, but in practice it often isn&rsquo;t enough.
Column names can be cryptic, coded values need decoding, and nothing in the data says what &ldquo;active customer&rdquo; means to your business or how tables relate.
In the <a href="#multiple-tables">example above</a>, the LLM had to infer from column names alone that <code>orders.customer_id</code> points to <code>customers.id</code>.</p>
<p>A <strong>data dictionary</strong> is how you fill in what the data can&rsquo;t say about itself.
It&rsquo;s a YAML file that follows the <a href="https://data-dict.tidyverse.org/" target="_blank" rel="noopener">data-dict</a> spec.
Alongside plain-English descriptions, it has its own fields for column types, allowed values, keys, and the relationships between tables.
This is now the preferred way to describe your data:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">tables</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">customers</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">description</span><span class="p">:</span><span class="w"> </span><span class="l">One row per customer.</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">columns</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l">acquisition_channel</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l">enum</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="nt">values</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="l">organic, paid_search, social, referral]</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="nt">description</span><span class="p">:</span><span class="w"> </span><span class="l">How the customer first found us.</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">orders</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">description</span><span class="p">:</span><span class="w"> </span><span class="l">One row per order.</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">columns</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l">customer_id</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l">number(id)</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="nt">constraints</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="l">foreign_key]</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">order_items</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">description</span><span class="p">:</span><span class="w"> </span><span class="l">One row per item in an order.</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">columns</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l">price</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l">number(quantity)</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="nt">description</span><span class="p">:</span><span class="w"> </span><span class="l">Item price in USD.</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nt">relationships</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span>- <span class="nt">description</span><span class="p">:</span><span class="w"> </span><span class="l">Each order belongs to one customer.</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">cardinality</span><span class="p">:</span><span class="w"> </span><span class="l">many-to-one</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">join</span><span class="p">:</span><span class="w"> </span><span class="l">orders.customer_id = customers.id</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span>- <span class="nt">description</span><span class="p">:</span><span class="w"> </span><span class="l">Each order has one or more items.</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">cardinality</span><span class="p">:</span><span class="w"> </span><span class="l">many-to-one</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">join</span><span class="p">:</span><span class="w"> </span><span class="l">order_items.order_id = orders.id</span></span></span></code></pre></div></div>
<p>Pass it in as <code>data_dict = &quot;dictionary.yml&quot;</code> (R) / <code>data_dict=&quot;dictionary.yml&quot;</code> (Python).
When the LLM fetches a table&rsquo;s schema, any column you&rsquo;ve documented comes straight from your dictionary, with nothing left to infer.
querychat only computes metadata from the data for the columns your dictionary doesn&rsquo;t cover.</p>
<h2 id="extract-insights-handoff">Extract insights: <code>/handoff</code>
</h2>
<p>Over the course of a conversation, querychat tends to produce a pile of results, some more useful than others.
The useful ones deserve to live on in a reproducible artifact that doesn&rsquo;t depend on the chat app.</p>
<p>That&rsquo;s the idea behind the new <strong><code>/handoff</code></strong> slash command.
It&rsquo;s available in every querychat app, with no setup required.
When a user types <code>/handoff</code> into the chat input, a wizard opens where they select the results that matter, choose an output format (e.g., Quarto, marimo, Shiny, Jupyter), and add any presentation instructions for the LLM to follow when it generates the handoff document.</p>
<img src="https://opensource.posit.co/blog/2026-09-29_querychat-tables-handoff/handoff-wizard.png" alt="The handoff wizard" class="shadow rounded" />
<p>When the user finishes the wizard, the handoff document&rsquo;s source code streams into a code editor, where they can revise it by hand or with AI assistance.
A download button then gives them a zip bundle with the handoff document, a README file, and the data sources (if they&rsquo;re small enough).</p>
<img src="https://opensource.posit.co/blog/2026-09-29_querychat-tables-handoff/handoff-download.png" alt="The handoff editor" class="shadow rounded" />
<h2 id="chat-with-pinned-data">Chat with pinned data
</h2>
<p>querychat can now chat with data pinned to a <a href="https://pins.rstudio.com/" target="_blank" rel="noopener">pins</a> board.
Pass the board and the pin name, and querychat reads the pin (parquet, CSV, JSON, RDS, and more) and uses its title, description, and tags as the starting data description:</p>
<div class="panel-tabset" data-tabset-group="language">
<ul id="tabset-6" class="panel-tabset-tabby">
<li><a data-tabby-default href="#tabset-6-1">R</a></li>
<li><a href="#tabset-6-2">Python</a></li>
</ul>
<div id="tabset-6-1">
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">library</span><span class="p">(</span><span class="n">pins</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nf">library</span><span class="p">(</span><span class="n">querychat</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">board</span> <span class="o">&lt;-</span> <span class="nf">board_connect</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nf">querychat_app</span><span class="p">(</span><span class="n">board</span><span class="p">,</span> <span class="s">&#34;my_pin&#34;</span><span class="p">)</span></span></span></code></pre></div></div>
</div>
<div id="tabset-6-2">
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">pip install <span class="s2">&#34;querychat[pins]&#34;</span></span></span></code></pre></div></div>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pins</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">querychat</span> <span class="kn">import</span> <span class="n">QueryChat</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">board</span> <span class="o">=</span> <span class="n">pins</span><span class="o">.</span><span class="n">board_connect</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">qc</span> <span class="o">=</span> <span class="n">QueryChat</span><span class="p">(</span><span class="n">board</span><span class="p">,</span> <span class="s2">&#34;my_pin&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">qc</span><span class="o">.</span><span class="n">app</span><span class="p">()</span></span></span></code></pre></div></div>
</div>
</div>
<p>For more control, such as setting the table name used in SQL, use the new <code>PinSource</code> class directly.
Multiple pins, or pins mixed with ordinary data frames, also work together in one chat.
Everything is materialized into a shared DuckDB connection behind the scenes, so the LLM can join and filter across all of it.
See the <a href="https://posit-dev.github.io/querychat/r/articles/data-sources.html" target="_blank" rel="noopener">data sources guide for R</a> and <a href="https://posit-dev.github.io/querychat/py/data-sources.html" target="_blank" rel="noopener">Python</a> for details.</p>
<h2 id="a-few-changes-for-existing-apps">A few changes for existing apps
</h2>
<p>This release also includes a handful of breaking changes, mostly around how querychat manages connections and bookmarking now that history is built in.
If you&rsquo;re upgrading, skim the <a href="https://github.com/posit-dev/querychat/blob/main/pkg-r/NEWS.md" target="_blank" rel="noopener">R NEWS</a> or <a href="https://github.com/posit-dev/querychat/blob/main/pkg-py/CHANGELOG.md" target="_blank" rel="noopener">Python CHANGELOG</a> breaking-changes sections before you do.</p>
<h2 id="learn-more">Learn more
</h2>
<ul>
<li><a href="https://posit-dev.github.io/querychat/py/" target="_blank" rel="noopener">querychat documentation</a> (<a href="https://posit-dev.github.io/querychat/r/" target="_blank" rel="noopener">R</a>) &mdash; full guides on data sources, context, tools, and deployment</li>
<li><a href="https://data-dict.tidyverse.org/" target="_blank" rel="noopener">data-dict</a> &mdash; the data dictionary spec querychat now reads</li>
<li><a href="https://ggsql.org" target="_blank" rel="noopener">ggsql</a> &mdash; the grammar of graphics for SQL that powers querychat&rsquo;s visualizations</li>
<li><a href="https://posit-dev.github.io/shinychat/py/" target="_blank" rel="noopener">shinychat</a> (<a href="https://posit-dev.github.io/shinychat/r/" target="_blank" rel="noopener">R</a>) &mdash; the chat UI toolkit querychat builds on</li>
<li><a href="https://posit-dev.github.io/chatlas/" target="_blank" rel="noopener">chatlas</a> (<a href="https://ellmer.tidyverse.org" target="_blank" rel="noopener">ellmer</a>) &mdash; the underlying LLM tool-calling libraries</li>
<li><a href="https://github.com/posit-dev/querychat" target="_blank" rel="noopener">Source on GitHub</a> &mdash; issues, discussions, and contributions welcome</li>
</ul>
<h2 id="acknowledgements">Acknowledgements
</h2>
<p>We thank everyone who contributed to these releases, for opening issues, submitting pull requests, and providing feedback:
<a href="https://github.com/gadenbuie" target="_blank" rel="noopener">@gadenbuie</a>,
<a href="https://github.com/hadley" target="_blank" rel="noopener">@hadley</a>,
<a href="https://github.com/iainwallacebms" target="_blank" rel="noopener">@iainwallacebms</a>,
<a href="https://github.com/iamYannC" target="_blank" rel="noopener">@iamYannC</a>,
<a href="https://github.com/jnhyeon" target="_blank" rel="noopener">@jnhyeon</a>,
<a href="https://github.com/kolabearafk" target="_blank" rel="noopener">@kolabearafk</a>, and
<a href="https://github.com/thisisnic" target="_blank" rel="noopener">@thisisnic</a>.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>By default, the active table is the first one supplied.
However, if the LLM is prompted to show a filtered/sorted view of a table, then that table becomes active (and the drawer will automatically open).&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></description>
      <enclosure url="https://opensource.posit.co/blog/2026-09-29_querychat-tables-handoff/featured.png" length="227292" type="image/png" />
    </item>
    <item>
      <title>Positron September Release Highlights</title>
      <link>https://opensource.posit.co/blog/2026-09-09_positron-2026-09-release/</link>
      <pubDate>Wed, 09 Sep 2026 00:00:00 +0000</pubDate>
      <guid>https://opensource.posit.co/blog/2026-09-09_positron-2026-09-release/</guid>
      <dc:creator>Julia Silge</dc:creator><description><![CDATA[<div class="callout callout-note" role="note" aria-label="Note">
<div class="callout-header">
<span class="callout-title">Note</span>
</div>
<div class="callout-body">
<p><a href="https://positron.posit.co" target="_blank" rel="noopener">Positron</a> is Posit&rsquo;s new, next-generation IDE for data science. Positron is designed to be an extensible, polyglot tool for exploring data and reproducible authoring in Python, R, and more.</p>
</div>
</div>
<p>Welcome back to another edition of our monthly Positron updates! Each month we share highlights from our <a href="https://positron.posit.co/release-notes" target="_blank" rel="noopener">latest release</a> and useful resources. <a href="https://opensource.posit.co/blog/2026-08-13_positron-2026-08-release">Last release</a> we told you about new Data Connections sources, a round of polish for inline output in Quarto documents, and help installing missing packages. This milestone brings a redesigned welcome page, a first version of Import Data, new Posit Assistant features, expanded Data Connections, package vulnerability scanning, and a more responsive Console.</p>
<h2 id="welcome-page-refresh-and-interpreter-setup">Welcome page refresh and interpreter setup
</h2>
<p>We redesigned the Positron welcome page. It now leads with an environment setup card that checks whether Python and R are ready to use, with actions to help resolve any problem it finds. The Positron badge and name now come with a <strong>Help</strong> button that opens the Help pane, and a banner links to the walkthroughs, including a new &ldquo;Get Started with Positron&rdquo; walkthrough that covers the Positron panes, keyboard shortcuts, built-in extensions, and Git.</p>
<img src="https://opensource.posit.co/blog/2026-09-09_positron-2026-09-release/welcome-page.gif" data-fig-align="center" data-fig-alt="The redesigned Positron Welcome page, showing an Environment setup card with Python checks (3 of 4 passed) including a Create Python Environment button, and R already set up successfully." />
<p>The environment setup theme continues into interpreter selection itself. When you select a Python managed by your operating system or a package manager, Positron now offers to create a virtual environment for your workspace instead of installing packages into that shared interpreter. With no folder open, the environment Positron creates now lives at <code>~/.virtualenvs/positron</code> rather than <code>~/.venv</code>, so it stays in the interpreter picker after a restart, and Positron asks before creating an environment in your home directory. We also removed the confusing startup notification that reported no interpreters were found while linking to documentation saying no setup was needed, and interpreters installed under <code>/opt/python</code> are now labeled <code>Global</code> instead of <code>Unknown</code> in the interpreter picker.</p>
<h2 id="import-data">Import Data
</h2>
<p>Before we started work this month, importing data via the Positron UI was our most upvoted feature request and this release now delivers a first version. When you view a CSV or TSV file in the Data Explorer, a new <strong>Import Data</strong> button in the action bar opens a dialog. The dialog shows the code to load that file into a data frame. You can copy the code, or click <strong>Import</strong> to run it in the console, starting a session if one is not already running.</p>
<img src="https://opensource.posit.co/blog/2026-09-09_positron-2026-09-release/import-data-excel.gif" data-fig-align="center" data-fig-alt="An Excel spreadsheet open in the Data Explorer with an Import Data button in the action bar, next to a Python console session ready to run the generated import code." />
<p>Import Data supports CSV and TSV files in Python with pandas and in R with the readr package, as well as Excel workbooks and Parquet files (with readxl and nanoparquet in R). The generated code can reproduce the filters and sorts you have applied in the Data Explorer, and it names the file by a workspace-relative path when the file is inside your workspace, so the code is easier to share and rerun. You can open the dialog from the Data Explorer, the File menu, the Variables pane, or the File Explorer context menu.</p>
<h2 id="posit-assistant">Posit Assistant
</h2>
<p>This release brings a new <strong>Agent Layout</strong> that opens <a href="https://pos.it/assistant" target="_blank" rel="noopener">Posit Assistant</a> in the editor area with a compact Session pane, giving you more visibility into the agent&rsquo;s actions as it works alongside your code. Configuring language model providers also gets a redesign. Our new Configure LLM Providers modal groups providers by connection state, so you can see at a glance which providers are ready to use. If you have trouble with the new dialog and need to switch back, set <a href="positron://settings/assistant.newProviderModal"><code>assistant.newProviderModal</code></a> to <code>false</code>.</p>
<img src="https://opensource.posit.co/blog/2026-09-09_positron-2026-09-release/provider-modal-dialog.png" data-fig-align="center" data-fig-alt="The Configure LLM Providers modal in Positron, listing connected providers (Posit AI Pass, Anthropic, GitHub Copilot) and additional model providers available to connect (Amazon Bedrock, Microsoft Foundry, OpenAI)." />
<p>You can now configure multiple custom providers, each with its own name, type, endpoint, credential, and model list; the previous single &ldquo;Custom Provider&rdquo; option is now called &ldquo;OpenAI Compatible&rdquo; to better match what it actually does. Amazon Bedrock users get a smoother experience as well. An expired AWS SSO session can be renewed right from the provider modal instead of requiring <code>aws sso login</code> in a terminal, and the AWS profile and region can now be set in the configuration dialog rather than only through environment variables or a hand-edited <code>providers.json</code>. Speaking of which, <code>providers.json</code> now accepts comments, and your comments survive edits that Positron makes to the file.</p>
<h2 id="data-connections">Data Connections
</h2>
<p>The Data Connections preview keeps growing. A new ODBC data connection driver lets you browse any database with an installed ODBC driver in the Connections pane and open it in the Data Explorer. Data sources already configured on your machine appear automatically. Databricks gains OAuth sign-in on desktop and reads <code>DATABRICKS_TOKEN</code>, <code>DATABRICKS_HOST</code>, and <code>DATABRICKS_CONFIG_FILE</code> credentials managed by Posit Workbench automatically. A <strong>Disconnect</strong> option in the context menu closes a connection and any Data Explorers opened from it, and each data connection driver now gets its own log output channel.</p>
<p>Smaller improvements round out the preview. You can now set <a href="positron://settings/dataConnections.enabled"><code>dataConnections.enabled</code></a> per workspace, so a repository can turn on the Connections pane for anyone who opens it. The tree is shallower so table and column names get more of the panel&rsquo;s width, and a new <a href="positron://settings/dataConnections.tree.indent"><code>dataConnections.tree.indent</code></a> setting controls the indentation. DuckDB connections now default to read-only, so the Connections pane and a Python or R session can have the same database open at once; when a lock conflict does happen, the error now explains that another session has locked the database.</p>
<h2 id="package-security-vulnerabilities">Package security vulnerabilities
</h2>
<p>The Packages pane now shows known security vulnerabilities (Common Vulnerabilities and Exposures scoring) for installed Python and R packages, so you can see at a glance whether something in your environment has a known CVE. The data comes from your environment&rsquo;s own Posit Package Manager repository when it has one, and from the public Posit instance otherwise, so what you see reflects the same package source your organization already governs.</p>
<img src="https://opensource.posit.co/blog/2026-09-09_positron-2026-09-release/packages-pane-cve.png" data-fig-align="center" data-fig-alt="The Packages pane showing the tornado package&#39;s Security tab with three known vulnerabilities listed by severity, each with a CVSS score, description, and the version where it was fixed." />
<h2 id="a-more-responsive-console">A more responsive Console
</h2>
<p>Console code submission is now faster, always shows visual feedback, and can be canceled while a completeness check is in flight; the Console no longer waits indefinitely with no feedback when a kernel is slow or unreachable. The Console breaks multi-statement input into complete expressions and executes them statement by statement for languages that support it. A new <a href="positron://settings/console.promptWhenIncomplete"><code>console.promptWhenIncomplete</code></a> setting runs submitted code immediately without a completeness check.</p>
<p>A few more Console fixes are worth knowing about. The Console no longer takes focus at runtime startup when you are working in another view or editor, <strong>Interrupt</strong> stays visible after switching between busy consoles, and session names now ellipsize to fit as the console tab list narrows.</p>
<h2 id="whats-coming-next">What&rsquo;s coming next
</h2>
<ul>
<li>posit::conf(2026) is next week! Our team will have several sessions on Positron, and there is still time to <a href="https://conf.posit.co/2026/" target="_blank" rel="noopener">register</a> to join us virtually from anywhere in the world.</li>
<li>Meet Posit at <a href="https://posit.co/events/cdao-government-2026" target="_blank" rel="noopener">CDAO Government</a> on September 22-23 in Washington, D.C. Stop by our booth to talk data modernization and where agentic AI fits in government.</li>
</ul>
<div class="callout callout-tip" role="note" aria-label="Tip">
<div class="callout-header">
<span class="callout-title">Tip</span>
</div>
<div class="callout-body">
<p><a href="https://positron.posit.co/download" target="_blank" rel="noopener">Download Positron</a> to try out the new features and improvements in this release!</p>
</div>
</div>
]]></description>
      <enclosure url="https://opensource.posit.co/blog/2026-09-09_positron-2026-09-release/featured.svg" length="93678" type="image/svg&#43;xml" />
    </item>
    <item>
      <title>Python Polars: The Definitive Cheatsheet</title>
      <link>https://opensource.posit.co/blog/2026-08-18_polars-cheatsheet-announcement/</link>
      <pubDate>Tue, 18 Aug 2026 00:00:00 +0000</pubDate>
      <guid>https://opensource.posit.co/blog/2026-08-18_polars-cheatsheet-announcement/</guid>
      <dc:creator>Jeroen Janssens</dc:creator>
      <dc:creator>Thijs Nieuwdorp</dc:creator><description><![CDATA[<p>Our book, <em><a href="https://polarsguide.com" target="_blank" rel="noopener">Python Polars: The Definitive Guide</a></em>, is nearly 500 pages. Over the past few weeks we spent many hours compressing it down to two.</p>
<p><em>Python Polars: The Definitive Cheatsheet</em> is out now, and it&rsquo;s free. Download it, print it, laminate it, put it on your desk.</p>
<p><div class="not-prose"><figure>
    <img class="h-auto max-w-full rounded-lg"
      src="https://opensource.posit.co/blog/2026-08-18_polars-cheatsheet-announcement/polars-cheatsheet-side-by-side.png"
      alt="" 
      loading="lazy"
    >
  </figure></div>
</p>
<p><a href="https://opensource.posit.co/resources/cheatsheets/polars">Get the cheatsheet</a></p>
<h2 id="whats-on-it">What&rsquo;s on it
</h2>
<p>Page one covers the fundamentals: how to get started, data types, data structures, the eager and lazy APIs, reading and writing data, and transforming data with select, filter, sort, reshape, aggregate, and join.</p>
<p>Page two is mostly expressions, which is where Polars really shines. It also includes the most common methods for working with strings, datetimes, lists, structs, and categoricals, plus styling data with Great Tables and visualizing data with Altair and Plotnine.</p>
<p>Keep in mind that this is a lossy compression. Two pages can cover many functions and methods, but there&rsquo;s no room for nuance or to explain the fundamental concepts. The cheatsheet is for remembering and referencing, not for learning Polars from scratch, and it doesn&rsquo;t replace the <a href="https://docs.pola.rs/" target="_blank" rel="noopener">official documentation</a> or our book.</p>
<h2 id="theres-an-html-version-too">There&rsquo;s an HTML version too
</h2>
<p>A laminated PDF is a good desk reference, but it isn&rsquo;t much use to a screen reader, and you can&rsquo;t copy anything out of it. So the cheatsheet also comes as HTML, with headings, tables, and selectable code. It works with a screen reader, the text reflows on a phone, and you can copy a snippet straight into your editor instead of retyping it.</p>
<h2 id="made-together-with-polars-inc">Made together with Polars, Inc.
</h2>
<p>A cheatsheet is really a long series of arguments about what matters most. Every line that makes it displaces something else. Having <a href="https://pola.rs" target="_blank" rel="noopener">Polars, Inc.</a> involved meant the people who build the library had a say in what a two-page reference should cover, and the cheatsheet is considerably better for it.</p>
<p>Posit and Polars, Inc. are different companies, but our tools overlap. Great Tables and Plotnine are Posit projects, and both work directly with Polars DataFrames. That&rsquo;s why they&rsquo;re on the sheet, and it&rsquo;s part of why this collaboration made sense.</p>
<p>We hope you find it useful. If there&rsquo;s a method you think we wasted space on, or one we should have included, we&rsquo;d like to hear about it.</p>
<p><a href="https://opensource.posit.co/resources/cheatsheets/polars">Get the cheatsheet</a></p>
]]></description>
      <enclosure url="https://opensource.posit.co/blog/2026-08-18_polars-cheatsheet-announcement/polars-cheatsheet-announcement.png" length="2922554" type="image/png" />
    </item>
    <item>
      <title>httr2 1.3.0</title>
      <link>https://opensource.posit.co/blog/2026-07-14_httr2-1-3-0/</link>
      <pubDate>Tue, 14 Jul 2026 00:00:00 +0000</pubDate>
      <guid>https://opensource.posit.co/blog/2026-07-14_httr2-1-3-0/</guid>
      <dc:creator>Hadley Wickham</dc:creator><description><![CDATA[<p>We&rsquo;re chuffed to announce the release of <a href="https://httr2.r-lib.org" target="_blank" rel="noopener">httr2</a> 1.3.0. httr2 makes it easy to work with web APIs from R, providing a pipeable interface for building requests and a suite of tools for processing the responses.</p>
<p>Get it now:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="c1"># install.packages(&#34;pak&#34;)</span>
</span></span><span class="line"><span class="cl"><span class="n">pak</span><span class="o">::</span><span class="nf">pak</span><span class="p">(</span><span class="s">&#34;httr2&#34;</span><span class="p">)</span></span></span></code></pre></div></div>
<p>The headline changes in this release all relate to OAuth token caching. They happen behind the scenes, so you shouldn&rsquo;t need to change any code, but you&rsquo;ll likely need to re-authenticate once after upgrading. The rest of this post explains why, and rounds up a handful of smaller features that landed in recent patch releases. See a full list of changes in the <a href="https://github.com/r-lib/httr2/releases/tag/v1.3.0" target="_blank" rel="noopener">release notes</a>.</p>
<h2 id="oauth-token-caching">OAuth token caching
</h2>
<p>First, a bit of background. When you authenticate with an API using OAuth, the API typically returns a refresh token that you can reuse for a set period. That means you don&rsquo;t have to log in every single time you use the API, which makes for a much nicer experience. To reuse a token across R sessions, however, httr2 has to write it to disk, and that creates a risk: anyone who can read the token could use it to access the API as you.</p>
<p>httr2 takes every precaution it can to keep these tokens safe. They&rsquo;re stored in a user-local cache directory, which is usually excluded from backups and, because it lives outside your working directory, carries no risk of being accidentally committed to git. On top of that, the tokens are encrypted so that only httr2 can read them.</p>
<p>Each token&rsquo;s path on disk is derived from a hash computed with <code>rlang::hash()</code>. We recently discovered a bug in that hashing code, and fixing it changes every hash. As a result, httr2 can no longer find your existing cached tokens, so you&rsquo;ll need to re-authenticate once after upgrading.</p>
<p>Since that change already invalidates your cached tokens, we took the opportunity to move where they&rsquo;re stored. Previously we used the rappdirs package to locate the cache directory, but since R 4.0.0 there&rsquo;s been a better built-in alternative: <code>tools::R_user_dir(&quot;httr2&quot;, which = &quot;cache&quot;)</code>. We&rsquo;ve switched to that, which makes httr2&rsquo;s cache location consistent with other packages and removes the rappdirs dependency.</p>
<p>Making these changes surfaced a long-standing bug. Every time httr2 loads, it&rsquo;s supposed to automatically delete any cached tokens older than 30 days, so that stale tokens don&rsquo;t linger indefinitely. Unfortunately, that pruning never actually worked. Now it does, so old tokens will be cleaned up once they pass 30 days, regardless of which cache directory or hashing algorithm produced them. This is good security practice: the longer a credential sits on disk, the more opportunities there are for it to leak, so removing tokens you&rsquo;re no longer using shrinks that window of exposure. If you&rsquo;d like to prune every cached token yourself, you can call <code>oauth_cache_prune(max_age_days = 0)</code>.</p>
<h2 id="other-features">Other features
</h2>
<p>Alongside the token caching work, this release also rolls up a few smaller features that first appeared in recent patch releases:</p>
<ul>
<li>
<p><strong>Faster streaming</strong> (1.2.3): <code>resp_stream_lines()</code>, <code>resp_stream_sse()</code>, and <code>resp_stream_aws()</code> now decode whole chunks at a time and hold the results in a queue, instead of rescanning and recopying the buffer for every line or event. This makes memory use and run time scale linearly rather than quadratically, so large streams are dramatically faster (e.g. reading a 1 MB response of short lines is now around 200x faster and uses around 180x less memory). <code>resp_stream_sse()</code> is used heavily by <a href="https://ellmer.tidyverse.org" target="_blank" rel="noopener">ellmer</a>, so this should make your LLM streaming feel a little zippier.</p>
</li>
<li>
<p><strong>OAuth server metadata discovery</strong> (1.2.3): the new <code>oauth_server_metadata()</code> discovers an OAuth/OIDC issuer&rsquo;s endpoints from its <code>.well-known</code> document, and <code>oauth_client()</code> gains a <code>metadata</code> argument so you can supply all of those endpoints at once.</p>
</li>
<li>
<p><strong>OpenTelemetry tracing</strong> (1.2.2): httr2 now emits OpenTelemetry traces for all requests when tracing is enabled. This requires the otelsdk package and is part of our cross-package work to improve the <a href="https://opensource.posit.co/blog/2026-05-07_opentelemetry/" target="_blank" rel="noopener">observability of R packages</a>.</p>
</li>
<li>
<p><strong><code>httr2_translate()</code></strong> (1.2.3): this new function translates an httr2 request into the equivalent curl command. It&rsquo;s handy for debugging, or for creating reprexes to share with people who don&rsquo;t use R.</p>
</li>
</ul>
]]></description>
      <enclosure url="https://opensource.posit.co/blog/2026-07-14_httr2-1-3-0/featured.jpg" length="312741" type="image/jpeg" />
    </item>
    <item>
      <title>dbplyr 2.6.0</title>
      <link>https://opensource.posit.co/blog/2026-06-17_dbplyr-2-6-0/</link>
      <pubDate>Wed, 17 Jun 2026 00:00:00 +0000</pubDate>
      <guid>https://opensource.posit.co/blog/2026-06-17_dbplyr-2-6-0/</guid>
      <dc:creator>Hadley Wickham</dc:creator><description><![CDATA[<p>I&rsquo;m pleased to announce that <a href="https://dbplyr.tidyverse.org" target="_blank" rel="noopener">dbplyr 2.6.0</a> is now on CRAN.
dbplyr is the database backend for <a href="https://dplyr.tidyverse.org" target="_blank" rel="noopener">dplyr</a>: it automatically translates the dplyr code you&rsquo;d write for a data frame into SQL so you can run the same pipeline against tables in a remote database.
You can install it with:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">install.packages</span><span class="p">(</span><span class="s">&#34;dbplyr&#34;</span><span class="p">)</span></span></span></code></pre></div></div>
<p>This is another release that has benefited from Claude Code&rsquo;s help, allowing me to rip through a large number of smaller issues (~50!) where the correct solution is easily verified.
And those time savings allowed me to tackle some more challenging and more impactful features, such as new ADBC and JDBC backends and a new <code>sql_dialect()</code> generic that finally separates <em>how you connect to a database</em> from <em>which SQL dialect to use</em>.
The release also includes new translations, a couple of useful helpers, and a substantial cleanup of long-standing deprecations.
This post covers the highlights for everyday users in the first half, then dives into the changes that matter for backend developers at the end.
Read the full list of changes in the <a href="https://github.com/tidyverse/dbplyr/releases/tag/v2.6.0" target="_blank" rel="noopener">release notes</a>.</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">library</span><span class="p">(</span><span class="n">dbplyr</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nf">library</span><span class="p">(</span><span class="n">dplyr</span><span class="p">,</span> <span class="n">warn.conflicts</span> <span class="o">=</span> <span class="kc">FALSE</span><span class="p">)</span></span></span></code></pre></div></div>
<h2 id="lifecycle-changes">Lifecycle changes
</h2>
<p>A handful of things you may have been using have been deprecated or removed.
The biggest ones to know about:</p>
<ul>
<li>
<p><strong><code>do()</code> is deprecated.</strong> It was the only piece of dplyr 0.x syntax that dbplyr still supported, and it never fit cleanly into SQL.
If you have code that uses it, the simplest path is to <code>collect()</code> first and then use your favourite tidyverse tools on the resulting data frame.</p>
</li>
<li>
<p><strong><code>str_like(ignore_case = TRUE)</code> is deprecated</strong> in favour of the new <code>str_ilike()</code> (thanks to <a href="https://github.com/edward-burn" target="_blank" rel="noopener">@edward-burn</a>).
This brings the dbplyr translation in line with the recent updates to <a href="https://stringr.tidyverse.org" target="_blank" rel="noopener">stringr</a>.</p>
</li>
<li>
<p><strong>The <code>cte</code> argument</strong> of <code>collect()</code>, <code>compute()</code>, <code>show_query()</code>, <code>remote_query()</code>, and <code>db_sql_render()</code> is deprecated.
Pass <code>sql_options = sql_options(cte = TRUE)</code> instead.
This consolidates a growing pile of one-off flags into a single options object that we can extend without tweaking every render function.</p>
</li>
</ul>
<p>A few deprecations that have been warning for multiple years are now defunct: passing <code>...</code> to <code>across()</code>/<code>if_all()</code>/<code>if_any()</code>, using <code>by = character()</code> to perform a cross join (use <code>cross_join()</code> instead), and calling <code>compute(temporary = FALSE)</code> without a <code>name</code>.
A few defunct functions/arguments have been removed entirely, including <code>group_by(add = )</code>, <code>partial_eval(var)</code>, and <code>src_sql()</code>.</p>
<p>If you&rsquo;re a backend developer, there&rsquo;s a longer list of changes that affect you &mdash; see the <a href="#notes-for-backend-developers">Notes for backend developers</a> at the end of this post.</p>
<h2 id="new-backends-adbc-and-jdbc">New backends: ADBC and JDBC
</h2>
<p>dbplyr already worked with ODBC (thanks to {<a href="https://odbc.r-dbi.org" target="_blank" rel="noopener">odbc</a>}).
With 2.6.0, you can now connect through two more transport layers:</p>
<ul>
<li>
<p><strong><a href="https://arrow.apache.org/adbc/" target="_blank" rel="noopener">ADBC</a></strong> (Arrow Database Connectivity) is a relatively new project from the Apache Arrow community.
It moves data between R and the database as Arrow buffers, which avoids the per-row serialization overhead of older protocols and can be much (much!) faster.
dbplyr supports ADBC connections through {<a href="https://github.com/r-dbi/adbi" target="_blank" rel="noopener">adbi</a>}.</p>
</li>
<li>
<p><strong><a href="https://en.wikipedia.org/wiki/Java_Database_Connectivity" target="_blank" rel="noopener">JDBC</a></strong> (Java Database Connectivity) is the standard database protocol on the JVM, with high-quality drivers for nearly every database under the sun.
dbplyr supports JDBC connections through {<a href="https://github.com/s-u/RJDBC" target="_blank" rel="noopener">RJDBC</a>}.</p>
</li>
</ul>
<p>The reason these new backends slot in so cleanly is a new generic, <code>sql_dialect()</code>.
Until now, dbplyr picked SQL translations based on the connection class itself, which meant every new transport had to either masquerade as an existing connection or carry its own copy of every translation.
(Or as with {odbc}, hack the database name into the object class.)
That&rsquo;s why ADBC and JDBC support was hard to add in the past.</p>
<p><code>sql_dialect()</code> separates the two concerns: a connection&rsquo;s job is to know how to talk to the server and fetch data, and the dialect&rsquo;s job is to know how to generate the right SQL.
For example, when you connect over JDBC or ADBC to Postgres, dbplyr now uses the same translations it would use over ODBC or via <a href="https://rpostgres.r-dbi.org" target="_blank" rel="noopener">RPostgres</a>.
This simplified a bunch of dbplyr code and made it very easy to add the new ADBC and JDBC backends.
Finally, if the default dialect isn&rsquo;t quite right, you can override it with <code>with_dialect()</code>.</p>
<h2 id="new-translations">New translations
</h2>
<p>A few translations are now available.</p>
<p><code>bind_queries()</code> is the dbplyr equivalent of <code>dplyr::bind_rows()</code>: it combines several lazy queries into one using <code>UNION ALL</code>, aligning columns as needed.</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="n">con</span> <span class="o">&lt;-</span> <span class="n">DBI</span><span class="o">::</span><span class="nf">dbConnect</span><span class="p">(</span><span class="n">RSQLite</span><span class="o">::</span><span class="nf">SQLite</span><span class="p">(),</span> <span class="s">&#34;:memory:&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">db1</span> <span class="o">&lt;-</span> <span class="nf">copy_to</span><span class="p">(</span><span class="n">con</span><span class="p">,</span> <span class="n">tibble</span><span class="o">::</span><span class="nf">tibble</span><span class="p">(</span><span class="n">x</span> <span class="o">=</span> <span class="m">1</span><span class="o">:</span><span class="m">3</span><span class="p">),</span> <span class="s">&#34;db1&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">db2</span> <span class="o">&lt;-</span> <span class="nf">copy_to</span><span class="p">(</span><span class="n">con</span><span class="p">,</span> <span class="n">tibble</span><span class="o">::</span><span class="nf">tibble</span><span class="p">(</span><span class="n">y</span> <span class="o">=</span> <span class="m">1</span><span class="o">:</span><span class="m">3</span><span class="p">,</span> <span class="n">x</span> <span class="o">=</span> <span class="m">4</span><span class="o">:</span><span class="m">6</span><span class="p">),</span> <span class="s">&#34;db2&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nf">bind_queries</span><span class="p">(</span><span class="n">db1</span><span class="p">,</span> <span class="n">db2</span><span class="p">)</span> <span class="o">|&gt;</span> <span class="nf">show_query</span><span class="p">()</span></span></span></code></pre></div></div>
<pre><code>&lt;SQL&gt;
SELECT *, NULL AS `y`
FROM `db1`

UNION ALL

SELECT `x`, `y`
FROM `db2`
</code></pre>
<p><code>filter_out()</code> (from <a href="https://opensource.posit.co/blog/2026-02-04_dplyr-1-2-0">dplyr 1.2.0</a>) is now translated.
It&rsquo;s the opposite of <code>filter()</code>, dropping rows where the conditions are true, rather than keeping those rows.</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="n">db3</span> <span class="o">&lt;-</span> <span class="nf">copy_to</span><span class="p">(</span><span class="n">con</span><span class="p">,</span> <span class="n">tibble</span><span class="o">::</span><span class="nf">tibble</span><span class="p">(</span><span class="n">x</span> <span class="o">=</span> <span class="nf">c</span><span class="p">(</span><span class="m">1</span><span class="p">,</span> <span class="m">2</span><span class="p">,</span> <span class="kc">NA</span><span class="p">),</span> <span class="n">g</span> <span class="o">=</span> <span class="nf">c</span><span class="p">(</span><span class="m">1</span><span class="p">,</span> <span class="m">1</span><span class="p">,</span> <span class="m">2</span><span class="p">)),</span> <span class="s">&#34;db3&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">db3</span> <span class="o">|&gt;</span> <span class="nf">filter_out</span><span class="p">(</span><span class="n">x</span> <span class="o">==</span> <span class="m">2</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code># A query:  ?? x 2
# Database: sqlite 3.52.0 [:memory:]
      x     g
  &lt;dbl&gt; &lt;dbl&gt;
1     1     1
2    NA     2
</code></pre>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="n">db3</span> <span class="o">|&gt;</span> <span class="nf">filter</span><span class="p">(</span><span class="n">x</span> <span class="o">==</span> <span class="m">2</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code># A query:  ?? x 2
# Database: sqlite 3.52.0 [:memory:]
      x     g
  &lt;dbl&gt; &lt;dbl&gt;
1     2     1
</code></pre>
<p><code>anyNA()</code> is now translated, in the same way as <code>any(is.na(x))</code>:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="n">db3</span> <span class="o">|&gt;</span> <span class="nf">summarise</span><span class="p">(</span><span class="n">missing</span> <span class="o">=</span> <span class="nf">anyNA</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">.by</span> <span class="o">=</span> <span class="n">g</span><span class="p">)</span> <span class="o">|&gt;</span> <span class="nf">show_query</span><span class="p">()</span></span></span></code></pre></div></div>
<pre><code>&lt;SQL&gt;
SELECT `g`, MAX((`x` IS NULL)) AS `missing`
FROM `db3`
GROUP BY `g`
</code></pre>
<p>And <code>%notin%</code> (new in R 4.6.0) is now translated to <code>NOT IN</code>:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="n">db3</span> <span class="o">|&gt;</span> <span class="nf">filter</span><span class="p">(</span><span class="n">x</span> <span class="o">%notin%</span> <span class="nf">c</span><span class="p">(</span><span class="m">1</span><span class="p">,</span> <span class="m">2</span><span class="p">))</span> <span class="o">|&gt;</span> <span class="nf">show_query</span><span class="p">()</span></span></span></code></pre></div></div>
<pre><code>&lt;SQL&gt;
SELECT *
FROM `db3`
WHERE (`x` NOT IN (1.0, 2.0))
</code></pre>
<p>Three other changes are worth knowing about:</p>
<ul>
<li>
<p><strong><code>last_sql()</code></strong> returns the SQL of the most recent query dbplyr generated.
This is mostly useful when debugging a problem that surfaces inside <code>collect()</code> or <code>compute()</code>, when you don&rsquo;t have a convenient handle on the query to call <code>show_query()</code> on.</p>
</li>
<li>
<p><strong><code>copy = &quot;inline&quot;</code></strong> is now an option for joins, set operations, and row operations.
When you join a local data frame to a remote table, dbplyr normally copies it to a temporary table on the server.
With <code>copy = &quot;inline&quot;</code>, it inlines the data into the SQL directly using <code>copy_inline()</code>, which is handy when you can&rsquo;t (or don&rsquo;t want to) create a temporary table.</p>
</li>
<li>
<p>Thanks to <a href="https://github.com/shearerpmm" target="_blank" rel="noopener">@shearerpmm</a>, this release also gains a translation layer for IBM DB2.
The translation includes <code>paste()</code>/<code>paste0()</code> (using <code>||</code>), DB2-specific casts, <code>runif()</code>, a comprehensive set of string and date functions, the <a href="https://clock.r-lib.org" target="_blank" rel="noopener">clock</a> helpers, and statistical aggregates.</p>
</li>
</ul>
<h2 id="notes-for-backend-developers">Notes for backend developers
</h2>
<p>If you maintain a dbplyr backend, several things have changed and you may need to make some adjustments.
Hopefully none of this is a surprise, since I&rsquo;ve already filed PRs to all CRAN packages that needed changes 😀.</p>
<p>Most importantly, the new <code>sql_dialect()</code> generic separates out the connection details from SQL generation.
You should create a <code>sql_dialect()</code> method for your connection that returns a <code>new_sql_dialect()</code> object.
<code>new_sql_dialect()</code> lets you customize the full surface of SQL generation, including how identifiers are quoted (which allows tests to look much closer to real SQL).
Once you have that object, all the <code>sql_</code> generics can dispatch on it, rather than on the connection object.</p>
<p>There are two new extension points for customization:</p>
<ul>
<li>
<p><code>db_table_drop_if_exists()</code> is a new generic that lets backends customize how tables are dropped when <code>overwrite = TRUE</code>.
It was added to support Oracle, which needs a slightly different <code>DROP TABLE</code> incantation.</p>
</li>
<li>
<p><code>sql_set_op_method()</code> is a new generic that lets set operations (<code>union()</code>, <code>intersect()</code>, <code>setdiff()</code>) customize the SQL keyword they generate.
Useful when a backend needs <code>UNION DISTINCT</code> instead of <code>UNION</code>, or <code>MINUS</code> instead of <code>EXCEPT</code>.</p>
</li>
</ul>
<p>And two deprecations:</p>
<ul>
<li>
<p><code>sql_expr_matches()</code> is deprecated. Provide <code>is_distinct_from()</code> and <code>is_not_distinct_from()</code> translations instead. These power joins with <code>na_matches = &quot;na&quot;</code> and the new <code>filter_out()</code> translation.</p>
</li>
<li>
<p><code>as.sql()</code> is deprecated as part of a major internal refactor of how <code>sql()</code> and <code>ident()</code> are used. You can generally replace it with <code>as_table_path()</code> if used to refer to a table, or <code>sql()</code> if you want to indicate it&rsquo;s raw SQL.</p>
</li>
</ul>
<p>I&rsquo;ve also overhauled the exported tools for generating SQL strings. The newly exported <code>sql_glue()</code> (implicit dialect, for use inside <code>sql_translation()</code>) and <code>sql_glue2()</code> (explicit dialect, for everywhere else) provide a glue-style syntax for building SQL strings. They replace the now superseded <code>build_sql()</code>, <code>sql_expr()</code>, and <code>sql_call2()</code>.</p>
]]></description>
      <enclosure url="https://opensource.posit.co/blog/2026-06-17_dbplyr-2-6-0/featured.jpg" length="281420" type="image/jpeg" />
    </item>
    <item>
      <title>Libraries for your Python Polars workflows</title>
      <link>https://opensource.posit.co/blog/2026-06-04_libraries-for-python-polars/</link>
      <pubDate>Thu, 04 Jun 2026 00:00:00 +0000</pubDate>
      <guid>https://opensource.posit.co/blog/2026-06-04_libraries-for-python-polars/</guid>
      <dc:creator>Isabella Velásquez</dc:creator><description><![CDATA[<script src="https://cdn.jsdelivr.net/npm/requirejs@2.3.6/require.min.js" integrity="sha384-c9c+LnTbwQ3aujuU7ULEPVvgLs+Fn6fJUvIGTsuu1ZcCf11fiEubah0ttpca4ntM sha384-6V1/AdqZRWk1KAlWbKBlGhN7VG4iE/yAZcO6NZPMF8od0vukrvr0tg4qY6NSrItx" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js" integrity="sha384-ZvpUoO/+PpLXR1lu4jmpXWu80pZlYUAfxl5NsBMWOEPSjUn/6Z/hRTt8+pR6L4N2" crossorigin="anonymous" data-relocate-top="true"></script>
<script type="application/javascript">define('jquery', [],function() {return window.jQuery;})</script>
<p>We (Emil Hvitfeldt, Jeroen Janssens, Michael Chow, and I) just got back from PyCon US 2026, and there was <strong>so much buzz</strong> around <a href="https://pola.rs/" target="_blank" rel="noopener">Polars</a>. What is Polars? Why should I switch to Polars? <em>How</em> do I switch to Polars?</p>
<p>I mean, just check out the line for the book signing of Jeroen&rsquo;s book, <a href="https://polarsguide.com/" target="_blank" rel="noopener">Python Polars: The Definitive Guide</a>.</p>
<img src="https://opensource.posit.co/blog/2026-06-04_libraries-for-python-polars/images/book-signing.jpeg" data-fig-alt="A long line of conference attendees waiting at Jeroen&#39;s book signing booth in PyCon US&#39; large convention hall" />
<p>If Polars is new to you, it is a library for efficient data manipulation in Python. It&rsquo;s built on Rust, so it&rsquo;s super fast. And a lot of people (including <a href="https://polarsguide.com/praise/" target="_blank" rel="noopener">the creator of Pandas</a>!) like the intuitive way you write Polars code. However, if you work in Python, you might know that different DataFrames have different requirements, so you want to make sure to use libraries that support Polars (I admit, I come from the R world, and this was mind blowing to me).</p>
<p>And, we&rsquo;re happy to say that we (Posit) have excellent Polars support across our Python libraries for every stage of the data science workflow! In this post, we&rsquo;ll walk through four:</p>
<ul>
<li><a href="https://posit-dev.github.io/pointblank/" target="_blank" rel="noopener"><strong>pointblank</strong></a> for data validation and quality checks</li>
<li><a href="https://posit-dev.github.io/great-tables/articles/intro.html" target="_blank" rel="noopener"><strong>Great Tables</strong></a> for creating publication-quality tables</li>
<li><a href="https://plotnine.org/" target="_blank" rel="noopener"><strong>plotnine</strong></a> for ggplot2-style visualizations</li>
<li><a href="https://mlverse.github.io/mall/" target="_blank" rel="noopener"><strong>mall</strong></a> for LLM-powered data analysis</li>
</ul>
<p>Let&rsquo;s check them out!</p>
<h2 id="setup">Setup
</h2>
<p>First, let&rsquo;s install the libraries:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">pip</span> <span class="n">install</span> <span class="n">polars</span> <span class="n">great_tables</span> <span class="n">pointblank</span> <span class="n">plotnine</span> <span class="n">mlverse</span><span class="o">-</span><span class="n">mall</span></span></span></code></pre></div></div>
<p>Now, import what we need:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">polars</span> <span class="k">as</span> <span class="nn">pl</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">great_tables</span> <span class="kn">import</span> <span class="n">GT</span>
</span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pointblank</span> <span class="k">as</span> <span class="nn">pb</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">plotnine</span> <span class="kn">import</span> <span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">ggplot</span><span class="p">,</span> <span class="n">aes</span><span class="p">,</span> <span class="n">geom_point</span><span class="p">,</span> <span class="n">geom_line</span><span class="p">,</span> <span class="n">geom_bar</span><span class="p">,</span> <span class="n">geom_text</span><span class="p">,</span> <span class="n">geom_col</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="n">labs</span><span class="p">,</span> <span class="n">theme_minimal</span><span class="p">,</span> <span class="n">theme</span><span class="p">,</span> <span class="n">element_text</span><span class="p">,</span> <span class="n">scale_fill_manual</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="n">scale_y_continuous</span><span class="p">,</span> <span class="n">element_rect</span><span class="p">,</span> <span class="n">element_blank</span><span class="p">,</span> <span class="n">element_line</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="n">scale_color_manual</span><span class="p">,</span> <span class="n">position_dodge</span><span class="p">,</span> <span class="n">annotate</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">mall</span></span></span></code></pre></div></div>
<h2 id="the-dataset">The dataset
</h2>
<p>We&rsquo;ll demonstrate these tools using <code>sales_data</code>, a sample sales dataset:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">sales_data</span> <span class="o">=</span> <span class="n">pl</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="p">{</span>
</span></span><span class="line"><span class="cl">        <span class="s2">&#34;date&#34;</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl">            <span class="s2">&#34;2026-01-15&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">            <span class="s2">&#34;2026-01-16&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">            <span class="s2">&#34;2026-01-17&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">            <span class="s2">&#34;2026-01-18&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">            <span class="s2">&#34;2026-01-19&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">            <span class="s2">&#34;2026-01-20&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">            <span class="s2">&#34;2026-01-21&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="p">],</span>
</span></span><span class="line"><span class="cl">        <span class="s2">&#34;region&#34;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&#34;North&#34;</span><span class="p">,</span> <span class="s2">&#34;South&#34;</span><span class="p">,</span> <span class="s2">&#34;North&#34;</span><span class="p">,</span> <span class="s2">&#34;West&#34;</span><span class="p">,</span> <span class="s2">&#34;South&#34;</span><span class="p">,</span> <span class="s2">&#34;North&#34;</span><span class="p">,</span> <span class="s2">&#34;West&#34;</span><span class="p">],</span>
</span></span><span class="line"><span class="cl">        <span class="s2">&#34;product&#34;</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl">            <span class="s2">&#34;Widget A&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">            <span class="s2">&#34;Widget B&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">            <span class="s2">&#34;Widget A&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">            <span class="s2">&#34;Widget C&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">            <span class="s2">&#34;Widget B&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">            <span class="s2">&#34;Widget A&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">            <span class="s2">&#34;Widget C&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="p">],</span>
</span></span><span class="line"><span class="cl">        <span class="s2">&#34;sales&#34;</span><span class="p">:</span> <span class="p">[</span><span class="mi">1200</span><span class="p">,</span> <span class="mi">1800</span><span class="p">,</span> <span class="mi">1500</span><span class="p">,</span> <span class="mi">2100</span><span class="p">,</span> <span class="mi">1650</span><span class="p">,</span> <span class="mi">1900</span><span class="p">,</span> <span class="mi">2300</span><span class="p">],</span>
</span></span><span class="line"><span class="cl">        <span class="s2">&#34;units_sold&#34;</span><span class="p">:</span> <span class="p">[</span><span class="mi">24</span><span class="p">,</span> <span class="mi">36</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="mi">42</span><span class="p">,</span> <span class="mi">33</span><span class="p">,</span> <span class="mi">38</span><span class="p">,</span> <span class="mi">46</span><span class="p">],</span>
</span></span><span class="line"><span class="cl">        <span class="s2">&#34;customer_rating&#34;</span><span class="p">:</span> <span class="p">[</span><span class="mf">4.5</span><span class="p">,</span> <span class="mf">4.8</span><span class="p">,</span> <span class="mf">4.6</span><span class="p">,</span> <span class="mf">4.9</span><span class="p">,</span> <span class="mf">4.7</span><span class="p">,</span> <span class="mf">4.8</span><span class="p">,</span> <span class="mf">4.9</span><span class="p">],</span>
</span></span><span class="line"><span class="cl">    <span class="p">}</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span><span class="o">.</span><span class="n">with_columns</span><span class="p">(</span><span class="n">pl</span><span class="o">.</span><span class="n">col</span><span class="p">(</span><span class="s2">&#34;date&#34;</span><span class="p">)</span><span class="o">.</span><span class="n">str</span><span class="o">.</span><span class="n">strptime</span><span class="p">(</span><span class="n">pl</span><span class="o">.</span><span class="n">Date</span><span class="p">,</span> <span class="s2">&#34;%Y-%m-</span><span class="si">%d</span><span class="s2">&#34;</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">sales_data</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code>shape: (7, 6)
┌────────────┬────────┬──────────┬───────┬────────────┬─────────────────┐
│ date       ┆ region ┆ product  ┆ sales ┆ units_sold ┆ customer_rating │
│ ---        ┆ ---    ┆ ---      ┆ ---   ┆ ---        ┆ ---             │
│ date       ┆ str    ┆ str      ┆ i64   ┆ i64        ┆ f64             │
╞════════════╪════════╪══════════╪═══════╪════════════╪═════════════════╡
│ 2026-01-15 ┆ North  ┆ Widget A ┆ 1200  ┆ 24         ┆ 4.5             │
│ 2026-01-16 ┆ South  ┆ Widget B ┆ 1800  ┆ 36         ┆ 4.8             │
│ 2026-01-17 ┆ North  ┆ Widget A ┆ 1500  ┆ 30         ┆ 4.6             │
│ 2026-01-18 ┆ West   ┆ Widget C ┆ 2100  ┆ 42         ┆ 4.9             │
│ 2026-01-19 ┆ South  ┆ Widget B ┆ 1650  ┆ 33         ┆ 4.7             │
│ 2026-01-20 ┆ North  ┆ Widget A ┆ 1900  ┆ 38         ┆ 4.8             │
│ 2026-01-21 ┆ West   ┆ Widget C ┆ 2300  ┆ 46         ┆ 4.9             │
└────────────┴────────┴──────────┴───────┴────────────┴─────────────────┘
</code></pre>
<p>We can confirm that it is, indeed, a Polars DataFrame!</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="nb">isinstance</span><span class="p">(</span><span class="n">sales_data</span><span class="p">,</span> <span class="n">pl</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code>True
</code></pre>
<h2 id="data-validation-with-pointblank">Data validation with pointblank
</h2>
<p>Let&rsquo;s now validate our data quality using <a href="https://posit-dev.github.io/pointblank/" target="_blank" rel="noopener"><strong>pointblank</strong></a>:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">agent</span> <span class="o">=</span> <span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">pb</span><span class="o">.</span><span class="n">Validate</span><span class="p">(</span><span class="n">sales_data</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">col_vals_not_null</span><span class="p">(</span><span class="n">columns</span><span class="o">=</span><span class="s2">&#34;date&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">col_vals_between</span><span class="p">(</span><span class="n">columns</span><span class="o">=</span><span class="s2">&#34;sales&#34;</span><span class="p">,</span> <span class="n">left</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="mi">10000</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">col_vals_between</span><span class="p">(</span><span class="n">columns</span><span class="o">=</span><span class="s2">&#34;customer_rating&#34;</span><span class="p">,</span> <span class="n">left</span><span class="o">=</span><span class="mf">1.0</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="mf">5.0</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">col_vals_in_set</span><span class="p">(</span><span class="n">columns</span><span class="o">=</span><span class="s2">&#34;region&#34;</span><span class="p">,</span> <span class="nb">set</span><span class="o">=</span><span class="p">[</span><span class="s2">&#34;North&#34;</span><span class="p">,</span> <span class="s2">&#34;South&#34;</span><span class="p">,</span> <span class="s2">&#34;East&#34;</span><span class="p">,</span> <span class="s2">&#34;West&#34;</span><span class="p">])</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">interrogate</span><span class="p">()</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">agent</span></span></span></code></pre></div></div>
<div id="pb_tbl" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
<style>
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans&display=swap');
#pb_tbl table {
          font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }
#pb_tbl thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#pb_tbl p { margin: 0; padding: 0; }
 #pb_tbl .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 90%; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }
 #pb_tbl .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #pb_tbl .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
 #pb_tbl .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
 #pb_tbl .gt_heading { background-color: #FFFFFF; text-align: left; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #pb_tbl .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #pb_tbl .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #pb_tbl .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; overflow-x: hidden; }
 #pb_tbl .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
 #pb_tbl .gt_column_spanner_outer:first-child { padding-left: 0; }
 #pb_tbl .gt_column_spanner_outer:last-child { padding-right: 0; }
 #pb_tbl .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
 #pb_tbl .gt_spanner_row { border-bottom-style: hidden; }
 #pb_tbl .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }
 #pb_tbl .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }
 #pb_tbl .gt_from_md> :first-child { margin-top: 0; }
 #pb_tbl .gt_from_md> :last-child { margin-bottom: 0; }
 #pb_tbl .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }
 #pb_tbl .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; }
 #pb_tbl .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; vertical-align: top; }
 #pb_tbl .gt_row_group_first td { border-top-width: 2px; }
 #pb_tbl .gt_row_group_first th { border-top-width: 2px; }
 #pb_tbl .gt_striped { color: #333333; background-color: #F4F4F4; }
 #pb_tbl .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #pb_tbl .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #pb_tbl .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #pb_tbl .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #pb_tbl .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #pb_tbl .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #pb_tbl .gt_left { text-align: left; }
 #pb_tbl .gt_center { text-align: center; }
 #pb_tbl .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #pb_tbl .gt_font_normal { font-weight: normal; }
 #pb_tbl .gt_font_bold { font-weight: bold; }
 #pb_tbl .gt_font_italic { font-style: italic; }
 #pb_tbl .gt_super { font-size: 65%; }
 #pb_tbl .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #pb_tbl .gt_asterisk { font-size: 100%; vertical-align: 0; }
</style>
<table style="table-layout: fixed;; width: 0px" class="gt_table" data-quarto-disable-processing="true" data-quarto-bootstrap="false">
<colgroup>
  <col style="width:4px;"/>
  <col style="width:35px;"/>
  <col style="width:190px;"/>
  <col style="width:120px;"/>
  <col style="width:120px;"/>
  <col style="width:50px;"/>
  <col style="width:50px;"/>
  <col style="width:60px;"/>
  <col style="width:60px;"/>
  <col style="width:60px;"/>
  <col style="width:30px;"/>
  <col style="width:30px;"/>
  <col style="width:30px;"/>
  <col style="width:65px;"/>
</colgroup>
<thead>
  <tr class="gt_heading">
    <td colspan="14" class="gt_heading gt_title gt_font_normal" style="color: #444444;font-size: 28px;text-align: left;font-weight: bold; text-align: left;">Pointblank Validation</td>
  </tr>
  <tr class="gt_heading">
    <td colspan="14" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border" style="text-align: left;"><div><span style='text-decoration-style: solid; text-decoration-color: #ADD8E6; text-decoration-line: underline; text-underline-position: under; color: #333333; font-variant-numeric: tabular-nums; padding-left: 4px; margin-right: 5px; padding-right: 2px;'>2026-06-04|17:00:11</span><div style="padding-top: 10px; padding-bottom: 5px;"><span style='background-color: #0075FF; color: #FFFFFF; padding: 0.5em 0.5em; position: inherit; text-transform: uppercase; margin: 5px 10px 5px 0px; border: solid 1px #0075FF; font-weight: bold; padding: 2px 10px 2px 10px; font-size: 10px;'>Polars</span></div></div></td>
  </tr>
<tr class="gt_col_headings">
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-status_color"></th>
  <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-i"></th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-type_upd">STEP</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-columns_upd">COLUMNS</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-values_upd">VALUES</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-tbl">TBL</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-eval">EVAL</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-test_units">UNITS</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-pass">PASS</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-fail">FAIL</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-w_upd">W</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-e_upd">E</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-c_upd">C</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-extract_upd">EXT</th>
</tr>
</thead>
<tbody class="gt_table_body">
  <tr>
    <td style="height: 40px; background-color: #4CA64C; color: transparent;font-size: 0px;" class="gt_row gt_left">#4CA64C</td>
    <td style="height: 40px; color: #666666;font-size: 13px;font-weight: bold;" class="gt_row gt_right">1</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" class="gt_row gt_left">
        <div style="margin: 0; padding: 0; display: inline-block; height: 30px; vertical-align: middle; width: 16%;">
            <!--?xml version="1.0" encoding="UTF-8"?--><?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="30px" viewBox="0 0 67 67" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>col_vals_not_null</title>
    <g id="Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="col_vals_not_null" transform="translate(0.000000, 0.551724)">
            <path d="M56.712234,1 C59.1975153,1 61.4475153,2.00735931 63.076195,3.63603897 C64.7048747,5.26471863 65.712234,7.51471863 65.712234,10 L65.712234,10 L65.712234,65 L10.712234,65 C8.22695259,65 5.97695259,63.9926407 4.34827294,62.363961 C2.71959328,60.7352814 1.71223397,58.4852814 1.71223397,56 L1.71223397,56 L1.71223397,10 C1.71223397,7.51471863 2.71959328,5.26471863 4.34827294,3.63603897 C5.97695259,2.00735931 8.22695259,1 10.712234,1 L10.712234,1 Z" id="rectangle" stroke="#000000" stroke-width="2" fill="#FFFFFF"></path>
            <path d="M40.6120805,47.037834 C37.4692348,47.037834 35.0126139,45.9348613 33.712234,44.0140597 C32.4118541,45.9348613 29.9552331,47.037834 26.8123883,47.037834 C22.6574397,47.037834 16.0646712,43.4437723 16.0646712,33.8021619 C16.0646712,29.3401361 17.4715879,18.962166 30.5035862,18.962166 C30.9454018,18.962166 31.3057481,19.3225124 31.3057481,19.7643279 L31.3057481,21.3686518 C31.3057481,21.8104674 30.9454018,22.1708138 30.5035862,22.1708138 C26.6400486,22.1708138 22.4819668,25.8118774 22.4819668,33.8021619 C22.4819668,37.5090277 23.7635456,43.0270243 27.2949384,43.0270243 C29.795428,43.0270243 31.224279,40.4231312 32.0985095,38.2861221 C30.5067194,35.6101596 29.7014243,33.1034035 29.7014243,30.8347892 C29.7014243,25.6238707 31.8603677,23.7751377 33.712234,23.7751377 C35.5641002,23.7751377 37.7230437,25.6238707 37.7230437,30.8347892 C37.7230437,33.1347383 36.9396828,35.5788255 35.3290916,38.2861221 C36.6294715,41.4321009 38.243196,43.0270243 40.1295295,43.0270243 C43.6609223,43.0270243 44.9425012,37.5090277 44.9425012,33.8021619 C44.9425012,25.8118774 40.7844193,22.1708138 36.9208817,22.1708138 C36.4759329,22.1708138 36.1187198,21.8104674 36.1187198,21.3686518 L36.1187198,19.7643279 C36.1187198,19.3225124 36.4759329,18.962166 36.9208817,18.962166 C49.9528801,18.962166 51.3597967,29.3401361 51.3597967,33.8021619 C51.3597967,43.4437723 44.7670282,47.037834 40.6120805,47.037834 Z" id="omega" fill="#000000" fill-rule="nonzero"></path>
            <path d="M33,7.93597705 C33.2761424,7.93597705 33.5,8.15983467 33.5,8.43597705 L33.5,57.564023 C33.5,57.8401653 33.2761424,58.064023 33,58.064023 C32.7238576,58.064023 32.5,57.8401653 32.5,57.564023 L32.5,8.43597705 C32.5,8.15983467 32.7238576,7.93597705 33,7.93597705 Z" id="line_black" fill="#000000" transform="translate(33.000000, 33.000000) rotate(-320.000000) translate(-33.000000, -33.000000) "></path>
            <polygon id="line_white" fill="#FFFFFF" transform="translate(34.899496, 32.153303) rotate(-320.000000) translate(-34.899496, -32.153303) " points="34.3994962 8.54160469 35.3994962 8.54160469 35.3994962 55.7650019 34.3994962 55.7650019"></polygon>
        </g>
    </g>
</svg>
        </div>
        <div style="font-family: 'IBM Plex Mono', monospace, courier; color: black; font-size: 10px; display: inline-block; vertical-align: middle;">
            <div>col_vals_not_null()</div>
        </div>
        </td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">date</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">&mdash;</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" class="gt_row gt_center"><svg width="25px" height="25px" viewBox="0 0 25 25" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="vertical-align: middle;">
    <g id="unchanged" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="unchanged" transform="translate(0.500000, 0.570147)">
            <rect id="Rectangle" x="0.125132506" y="0" width="23.749735" height="23.7894737"></rect>
            <path d="M5.80375046,8.18194736 C3.77191832,8.18194736 2.11875046,9.83495328 2.11875046,11.8669474 C2.11875046,13.8989414 3.77191832,15.5519474 5.80375046,15.5519474 C7.8355826,15.5519474 9.48875046,13.8989414 9.48875046,11.8669474 C9.48875046,9.83495328 7.83552863,8.18194736 5.80375046,8.18194736 Z M5.80375046,14.814915 C4.17821997,14.814915 2.85578285,13.4924778 2.85578285,11.8669474 C2.85578285,10.2414169 4.17821997,8.91897975 5.80375046,8.91897975 C7.42928095,8.91897975 8.75171807,10.2414169 8.75171807,11.8669474 C8.75171807,13.4924778 7.42928095,14.814915 5.80375046,14.814915 Z" id="Shape" fill="#000000" fill-rule="nonzero"></path>
            <path d="M13.9638189,8.699335 C13.9364621,8.70430925 13.9091059,8.71176968 13.8842359,8.71923074 C13.7822704,8.73663967 13.6877654,8.77643115 13.6056956,8.83860518 L10.2433156,11.3852598 C10.0766886,11.5046343 9.97720993,11.6986181 9.97720993,11.9025491 C9.97720993,12.1064807 10.0766886,12.3004639 10.2433156,12.4198383 L13.6056956,14.966493 C13.891697,15.1803725 14.2970729,15.1231721 14.5109517,14.8371707 C14.7248313,14.5511692 14.6676309,14.145794 14.3816294,13.9319145 L12.5313257,12.5392127 L21.8812495,12.5392127 L21.8812495,11.2658854 L12.5313257,11.2658854 L14.3816294,9.87318364 C14.6377872,9.71650453 14.7497006,9.40066014 14.6477351,9.11714553 C14.5482564,8.83363156 14.262255,8.65954352 13.9638189,8.699335 Z" id="arrow" fill="#000000" transform="translate(15.929230, 11.894737) rotate(-180.000000) translate(-15.929230, -11.894737) "></path>
        </g>
    </g>
</svg></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" class="gt_row gt_center"><span style="color:#4CA64C;">&check;</span></td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" class="gt_row gt_right">7</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" class="gt_row gt_right">7<br />1.00</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" class="gt_row gt_right">0<br />0.00</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" class="gt_row gt_center">&mdash;</td>
    <td style="height: 40px; background-color: #FCFCFC;" class="gt_row gt_center">&mdash;</td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" class="gt_row gt_center">&mdash;</td>
    <td style="height: 40px;" class="gt_row gt_center">—</td>
  </tr>
  <tr>
    <td style="height: 40px; background-color: #4CA64C; color: transparent;font-size: 0px;" class="gt_row gt_left">#4CA64C</td>
    <td style="height: 40px; color: #666666;font-size: 13px;font-weight: bold;" class="gt_row gt_right">2</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" class="gt_row gt_left">
        <div style="margin: 0; padding: 0; display: inline-block; height: 30px; vertical-align: middle; width: 16%;">
            <!--?xml version="1.0" encoding="UTF-8"?--><?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="30px" viewBox="0 0 67 67" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>col_vals_between</title>
    <g id="Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="col_vals_between" transform="translate(0.000000, 0.206897)">
            <path d="M56.712234,1 C59.1975153,1 61.4475153,2.00735931 63.076195,3.63603897 C64.7048747,5.26471863 65.712234,7.51471863 65.712234,10 L65.712234,10 L65.712234,65 L10.712234,65 C8.22695259,65 5.97695259,63.9926407 4.34827294,62.363961 C2.71959328,60.7352814 1.71223397,58.4852814 1.71223397,56 L1.71223397,56 L1.71223397,10 C1.71223397,7.51471863 2.71959328,5.26471863 4.34827294,3.63603897 C5.97695259,2.00735931 8.22695259,1 10.712234,1 L10.712234,1 Z" id="rectangle" stroke="#000000" stroke-width="2" fill="#FFFFFF"></path>
            <path d="M11.993484,21.96875 C10.962234,22.082031 10.188797,22.964844 10.212234,24 L10.212234,42 C10.200515,42.722656 10.579422,43.390625 11.204422,43.753906 C11.825515,44.121094 12.598953,44.121094 13.220047,43.753906 C13.845047,43.390625 14.223953,42.722656 14.212234,42 L14.212234,24 C14.220047,23.457031 14.009109,22.9375 13.626297,22.554688 C13.243484,22.171875 12.723953,21.960938 12.180984,21.96875 C12.118484,21.964844 12.055984,21.964844 11.993484,21.96875 Z M55.993484,21.96875 C54.962234,22.082031 54.188797,22.964844 54.212234,24 L54.212234,42 C54.200515,42.722656 54.579422,43.390625 55.204422,43.753906 C55.825515,44.121094 56.598953,44.121094 57.220047,43.753906 C57.845047,43.390625 58.223953,42.722656 58.212234,42 L58.212234,24 C58.220047,23.457031 58.009109,22.9375 57.626297,22.554688 C57.243484,22.171875 56.723953,21.960938 56.180984,21.96875 C56.118484,21.964844 56.055984,21.964844 55.993484,21.96875 Z M16.212234,22 C15.661453,22 15.212234,22.449219 15.212234,23 C15.212234,23.550781 15.661453,24 16.212234,24 C16.763015,24 17.212234,23.550781 17.212234,23 C17.212234,22.449219 16.763015,22 16.212234,22 Z M20.212234,22 C19.661453,22 19.212234,22.449219 19.212234,23 C19.212234,23.550781 19.661453,24 20.212234,24 C20.763015,24 21.212234,23.550781 21.212234,23 C21.212234,22.449219 20.763015,22 20.212234,22 Z M24.212234,22 C23.661453,22 23.212234,22.449219 23.212234,23 C23.212234,23.550781 23.661453,24 24.212234,24 C24.763015,24 25.212234,23.550781 25.212234,23 C25.212234,22.449219 24.763015,22 24.212234,22 Z M28.212234,22 C27.661453,22 27.212234,22.449219 27.212234,23 C27.212234,23.550781 27.661453,24 28.212234,24 C28.763015,24 29.212234,23.550781 29.212234,23 C29.212234,22.449219 28.763015,22 28.212234,22 Z M32.212234,22 C31.661453,22 31.212234,22.449219 31.212234,23 C31.212234,23.550781 31.661453,24 32.212234,24 C32.763015,24 33.212234,23.550781 33.212234,23 C33.212234,22.449219 32.763015,22 32.212234,22 Z M36.212234,22 C35.661453,22 35.212234,22.449219 35.212234,23 C35.212234,23.550781 35.661453,24 36.212234,24 C36.763015,24 37.212234,23.550781 37.212234,23 C37.212234,22.449219 36.763015,22 36.212234,22 Z M40.212234,22 C39.661453,22 39.212234,22.449219 39.212234,23 C39.212234,23.550781 39.661453,24 40.212234,24 C40.763015,24 41.212234,23.550781 41.212234,23 C41.212234,22.449219 40.763015,22 40.212234,22 Z M44.212234,22 C43.661453,22 43.212234,22.449219 43.212234,23 C43.212234,23.550781 43.661453,24 44.212234,24 C44.763015,24 45.212234,23.550781 45.212234,23 C45.212234,22.449219 44.763015,22 44.212234,22 Z M48.212234,22 C47.661453,22 47.212234,22.449219 47.212234,23 C47.212234,23.550781 47.661453,24 48.212234,24 C48.763015,24 49.212234,23.550781 49.212234,23 C49.212234,22.449219 48.763015,22 48.212234,22 Z M52.212234,22 C51.661453,22 51.212234,22.449219 51.212234,23 C51.212234,23.550781 51.661453,24 52.212234,24 C52.763015,24 53.212234,23.550781 53.212234,23 C53.212234,22.449219 52.763015,22 52.212234,22 Z M21.462234,27.96875 C21.419265,27.976563 21.376297,27.988281 21.337234,28 C21.177078,28.027344 21.02864,28.089844 20.899734,28.1875 L15.618484,32.1875 C15.356765,32.375 15.200515,32.679688 15.200515,33 C15.200515,33.320313 15.356765,33.625 15.618484,33.8125 L20.899734,37.8125 C21.348953,38.148438 21.985672,38.058594 22.321609,37.609375 C22.657547,37.160156 22.567703,36.523438 22.118484,36.1875 L19.212234,34 L49.212234,34 L46.305984,36.1875 C45.856765,36.523438 45.766922,37.160156 46.102859,37.609375 C46.438797,38.058594 47.075515,38.148438 47.524734,37.8125 L52.805984,33.8125 C53.067703,33.625 53.223953,33.320313 53.223953,33 C53.223953,32.679688 53.067703,32.375 52.805984,32.1875 L47.524734,28.1875 C47.30989,28.027344 47.040359,27.960938 46.774734,28 C46.743484,28 46.712234,28 46.680984,28 C46.282547,28.074219 45.96614,28.382813 45.884109,28.78125 C45.802078,29.179688 45.970047,29.585938 46.305984,29.8125 L49.212234,32 L19.212234,32 L22.118484,29.8125 C22.520828,29.566406 22.696609,29.070313 22.536453,28.625 C22.380203,28.179688 21.930984,27.90625 21.462234,27.96875 Z M16.212234,42 C15.661453,42 15.212234,42.449219 15.212234,43 C15.212234,43.550781 15.661453,44 16.212234,44 C16.763015,44 17.212234,43.550781 17.212234,43 C17.212234,42.449219 16.763015,42 16.212234,42 Z M20.212234,42 C19.661453,42 19.212234,42.449219 19.212234,43 C19.212234,43.550781 19.661453,44 20.212234,44 C20.763015,44 21.212234,43.550781 21.212234,43 C21.212234,42.449219 20.763015,42 20.212234,42 Z M24.212234,42 C23.661453,42 23.212234,42.449219 23.212234,43 C23.212234,43.550781 23.661453,44 24.212234,44 C24.763015,44 25.212234,43.550781 25.212234,43 C25.212234,42.449219 24.763015,42 24.212234,42 Z M28.212234,42 C27.661453,42 27.212234,42.449219 27.212234,43 C27.212234,43.550781 27.661453,44 28.212234,44 C28.763015,44 29.212234,43.550781 29.212234,43 C29.212234,42.449219 28.763015,42 28.212234,42 Z M32.212234,42 C31.661453,42 31.212234,42.449219 31.212234,43 C31.212234,43.550781 31.661453,44 32.212234,44 C32.763015,44 33.212234,43.550781 33.212234,43 C33.212234,42.449219 32.763015,42 32.212234,42 Z M36.212234,42 C35.661453,42 35.212234,42.449219 35.212234,43 C35.212234,43.550781 35.661453,44 36.212234,44 C36.763015,44 37.212234,43.550781 37.212234,43 C37.212234,42.449219 36.763015,42 36.212234,42 Z M40.212234,42 C39.661453,42 39.212234,42.449219 39.212234,43 C39.212234,43.550781 39.661453,44 40.212234,44 C40.763015,44 41.212234,43.550781 41.212234,43 C41.212234,42.449219 40.763015,42 40.212234,42 Z M44.212234,42 C43.661453,42 43.212234,42.449219 43.212234,43 C43.212234,43.550781 43.661453,44 44.212234,44 C44.763015,44 45.212234,43.550781 45.212234,43 C45.212234,42.449219 44.763015,42 44.212234,42 Z M48.212234,42 C47.661453,42 47.212234,42.449219 47.212234,43 C47.212234,43.550781 47.661453,44 48.212234,44 C48.763015,44 49.212234,43.550781 49.212234,43 C49.212234,42.449219 48.763015,42 48.212234,42 Z M52.212234,42 C51.661453,42 51.212234,42.449219 51.212234,43 C51.212234,43.550781 51.661453,44 52.212234,44 C52.763015,44 53.212234,43.550781 53.212234,43 C53.212234,42.449219 52.763015,42 52.212234,42 Z" id="inside_range" fill="#000000" fill-rule="nonzero"></path>
        </g>
    </g>
</svg>
        </div>
        <div style="font-family: 'IBM Plex Mono', monospace, courier; color: black; font-size: 10px; display: inline-block; vertical-align: middle;">
            <div>col_vals_between()</div>
        </div>
        </td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">sales</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">[0, 10000]</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" class="gt_row gt_center"><svg width="25px" height="25px" viewBox="0 0 25 25" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="vertical-align: middle;">
    <g id="unchanged" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="unchanged" transform="translate(0.500000, 0.570147)">
            <rect id="Rectangle" x="0.125132506" y="0" width="23.749735" height="23.7894737"></rect>
            <path d="M5.80375046,8.18194736 C3.77191832,8.18194736 2.11875046,9.83495328 2.11875046,11.8669474 C2.11875046,13.8989414 3.77191832,15.5519474 5.80375046,15.5519474 C7.8355826,15.5519474 9.48875046,13.8989414 9.48875046,11.8669474 C9.48875046,9.83495328 7.83552863,8.18194736 5.80375046,8.18194736 Z M5.80375046,14.814915 C4.17821997,14.814915 2.85578285,13.4924778 2.85578285,11.8669474 C2.85578285,10.2414169 4.17821997,8.91897975 5.80375046,8.91897975 C7.42928095,8.91897975 8.75171807,10.2414169 8.75171807,11.8669474 C8.75171807,13.4924778 7.42928095,14.814915 5.80375046,14.814915 Z" id="Shape" fill="#000000" fill-rule="nonzero"></path>
            <path d="M13.9638189,8.699335 C13.9364621,8.70430925 13.9091059,8.71176968 13.8842359,8.71923074 C13.7822704,8.73663967 13.6877654,8.77643115 13.6056956,8.83860518 L10.2433156,11.3852598 C10.0766886,11.5046343 9.97720993,11.6986181 9.97720993,11.9025491 C9.97720993,12.1064807 10.0766886,12.3004639 10.2433156,12.4198383 L13.6056956,14.966493 C13.891697,15.1803725 14.2970729,15.1231721 14.5109517,14.8371707 C14.7248313,14.5511692 14.6676309,14.145794 14.3816294,13.9319145 L12.5313257,12.5392127 L21.8812495,12.5392127 L21.8812495,11.2658854 L12.5313257,11.2658854 L14.3816294,9.87318364 C14.6377872,9.71650453 14.7497006,9.40066014 14.6477351,9.11714553 C14.5482564,8.83363156 14.262255,8.65954352 13.9638189,8.699335 Z" id="arrow" fill="#000000" transform="translate(15.929230, 11.894737) rotate(-180.000000) translate(-15.929230, -11.894737) "></path>
        </g>
    </g>
</svg></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" class="gt_row gt_center"><span style="color:#4CA64C;">&check;</span></td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" class="gt_row gt_right">7</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" class="gt_row gt_right">7<br />1.00</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" class="gt_row gt_right">0<br />0.00</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" class="gt_row gt_center">&mdash;</td>
    <td style="height: 40px; background-color: #FCFCFC;" class="gt_row gt_center">&mdash;</td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" class="gt_row gt_center">&mdash;</td>
    <td style="height: 40px;" class="gt_row gt_center">—</td>
  </tr>
  <tr>
    <td style="height: 40px; background-color: #4CA64C; color: transparent;font-size: 0px;" class="gt_row gt_left">#4CA64C</td>
    <td style="height: 40px; color: #666666;font-size: 13px;font-weight: bold;" class="gt_row gt_right">3</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" class="gt_row gt_left">
        <div style="margin: 0; padding: 0; display: inline-block; height: 30px; vertical-align: middle; width: 16%;">
            <!--?xml version="1.0" encoding="UTF-8"?--><?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="30px" viewBox="0 0 67 67" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>col_vals_between</title>
    <g id="Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="col_vals_between" transform="translate(0.000000, 0.206897)">
            <path d="M56.712234,1 C59.1975153,1 61.4475153,2.00735931 63.076195,3.63603897 C64.7048747,5.26471863 65.712234,7.51471863 65.712234,10 L65.712234,10 L65.712234,65 L10.712234,65 C8.22695259,65 5.97695259,63.9926407 4.34827294,62.363961 C2.71959328,60.7352814 1.71223397,58.4852814 1.71223397,56 L1.71223397,56 L1.71223397,10 C1.71223397,7.51471863 2.71959328,5.26471863 4.34827294,3.63603897 C5.97695259,2.00735931 8.22695259,1 10.712234,1 L10.712234,1 Z" id="rectangle" stroke="#000000" stroke-width="2" fill="#FFFFFF"></path>
            <path d="M11.993484,21.96875 C10.962234,22.082031 10.188797,22.964844 10.212234,24 L10.212234,42 C10.200515,42.722656 10.579422,43.390625 11.204422,43.753906 C11.825515,44.121094 12.598953,44.121094 13.220047,43.753906 C13.845047,43.390625 14.223953,42.722656 14.212234,42 L14.212234,24 C14.220047,23.457031 14.009109,22.9375 13.626297,22.554688 C13.243484,22.171875 12.723953,21.960938 12.180984,21.96875 C12.118484,21.964844 12.055984,21.964844 11.993484,21.96875 Z M55.993484,21.96875 C54.962234,22.082031 54.188797,22.964844 54.212234,24 L54.212234,42 C54.200515,42.722656 54.579422,43.390625 55.204422,43.753906 C55.825515,44.121094 56.598953,44.121094 57.220047,43.753906 C57.845047,43.390625 58.223953,42.722656 58.212234,42 L58.212234,24 C58.220047,23.457031 58.009109,22.9375 57.626297,22.554688 C57.243484,22.171875 56.723953,21.960938 56.180984,21.96875 C56.118484,21.964844 56.055984,21.964844 55.993484,21.96875 Z M16.212234,22 C15.661453,22 15.212234,22.449219 15.212234,23 C15.212234,23.550781 15.661453,24 16.212234,24 C16.763015,24 17.212234,23.550781 17.212234,23 C17.212234,22.449219 16.763015,22 16.212234,22 Z M20.212234,22 C19.661453,22 19.212234,22.449219 19.212234,23 C19.212234,23.550781 19.661453,24 20.212234,24 C20.763015,24 21.212234,23.550781 21.212234,23 C21.212234,22.449219 20.763015,22 20.212234,22 Z M24.212234,22 C23.661453,22 23.212234,22.449219 23.212234,23 C23.212234,23.550781 23.661453,24 24.212234,24 C24.763015,24 25.212234,23.550781 25.212234,23 C25.212234,22.449219 24.763015,22 24.212234,22 Z M28.212234,22 C27.661453,22 27.212234,22.449219 27.212234,23 C27.212234,23.550781 27.661453,24 28.212234,24 C28.763015,24 29.212234,23.550781 29.212234,23 C29.212234,22.449219 28.763015,22 28.212234,22 Z M32.212234,22 C31.661453,22 31.212234,22.449219 31.212234,23 C31.212234,23.550781 31.661453,24 32.212234,24 C32.763015,24 33.212234,23.550781 33.212234,23 C33.212234,22.449219 32.763015,22 32.212234,22 Z M36.212234,22 C35.661453,22 35.212234,22.449219 35.212234,23 C35.212234,23.550781 35.661453,24 36.212234,24 C36.763015,24 37.212234,23.550781 37.212234,23 C37.212234,22.449219 36.763015,22 36.212234,22 Z M40.212234,22 C39.661453,22 39.212234,22.449219 39.212234,23 C39.212234,23.550781 39.661453,24 40.212234,24 C40.763015,24 41.212234,23.550781 41.212234,23 C41.212234,22.449219 40.763015,22 40.212234,22 Z M44.212234,22 C43.661453,22 43.212234,22.449219 43.212234,23 C43.212234,23.550781 43.661453,24 44.212234,24 C44.763015,24 45.212234,23.550781 45.212234,23 C45.212234,22.449219 44.763015,22 44.212234,22 Z M48.212234,22 C47.661453,22 47.212234,22.449219 47.212234,23 C47.212234,23.550781 47.661453,24 48.212234,24 C48.763015,24 49.212234,23.550781 49.212234,23 C49.212234,22.449219 48.763015,22 48.212234,22 Z M52.212234,22 C51.661453,22 51.212234,22.449219 51.212234,23 C51.212234,23.550781 51.661453,24 52.212234,24 C52.763015,24 53.212234,23.550781 53.212234,23 C53.212234,22.449219 52.763015,22 52.212234,22 Z M21.462234,27.96875 C21.419265,27.976563 21.376297,27.988281 21.337234,28 C21.177078,28.027344 21.02864,28.089844 20.899734,28.1875 L15.618484,32.1875 C15.356765,32.375 15.200515,32.679688 15.200515,33 C15.200515,33.320313 15.356765,33.625 15.618484,33.8125 L20.899734,37.8125 C21.348953,38.148438 21.985672,38.058594 22.321609,37.609375 C22.657547,37.160156 22.567703,36.523438 22.118484,36.1875 L19.212234,34 L49.212234,34 L46.305984,36.1875 C45.856765,36.523438 45.766922,37.160156 46.102859,37.609375 C46.438797,38.058594 47.075515,38.148438 47.524734,37.8125 L52.805984,33.8125 C53.067703,33.625 53.223953,33.320313 53.223953,33 C53.223953,32.679688 53.067703,32.375 52.805984,32.1875 L47.524734,28.1875 C47.30989,28.027344 47.040359,27.960938 46.774734,28 C46.743484,28 46.712234,28 46.680984,28 C46.282547,28.074219 45.96614,28.382813 45.884109,28.78125 C45.802078,29.179688 45.970047,29.585938 46.305984,29.8125 L49.212234,32 L19.212234,32 L22.118484,29.8125 C22.520828,29.566406 22.696609,29.070313 22.536453,28.625 C22.380203,28.179688 21.930984,27.90625 21.462234,27.96875 Z M16.212234,42 C15.661453,42 15.212234,42.449219 15.212234,43 C15.212234,43.550781 15.661453,44 16.212234,44 C16.763015,44 17.212234,43.550781 17.212234,43 C17.212234,42.449219 16.763015,42 16.212234,42 Z M20.212234,42 C19.661453,42 19.212234,42.449219 19.212234,43 C19.212234,43.550781 19.661453,44 20.212234,44 C20.763015,44 21.212234,43.550781 21.212234,43 C21.212234,42.449219 20.763015,42 20.212234,42 Z M24.212234,42 C23.661453,42 23.212234,42.449219 23.212234,43 C23.212234,43.550781 23.661453,44 24.212234,44 C24.763015,44 25.212234,43.550781 25.212234,43 C25.212234,42.449219 24.763015,42 24.212234,42 Z M28.212234,42 C27.661453,42 27.212234,42.449219 27.212234,43 C27.212234,43.550781 27.661453,44 28.212234,44 C28.763015,44 29.212234,43.550781 29.212234,43 C29.212234,42.449219 28.763015,42 28.212234,42 Z M32.212234,42 C31.661453,42 31.212234,42.449219 31.212234,43 C31.212234,43.550781 31.661453,44 32.212234,44 C32.763015,44 33.212234,43.550781 33.212234,43 C33.212234,42.449219 32.763015,42 32.212234,42 Z M36.212234,42 C35.661453,42 35.212234,42.449219 35.212234,43 C35.212234,43.550781 35.661453,44 36.212234,44 C36.763015,44 37.212234,43.550781 37.212234,43 C37.212234,42.449219 36.763015,42 36.212234,42 Z M40.212234,42 C39.661453,42 39.212234,42.449219 39.212234,43 C39.212234,43.550781 39.661453,44 40.212234,44 C40.763015,44 41.212234,43.550781 41.212234,43 C41.212234,42.449219 40.763015,42 40.212234,42 Z M44.212234,42 C43.661453,42 43.212234,42.449219 43.212234,43 C43.212234,43.550781 43.661453,44 44.212234,44 C44.763015,44 45.212234,43.550781 45.212234,43 C45.212234,42.449219 44.763015,42 44.212234,42 Z M48.212234,42 C47.661453,42 47.212234,42.449219 47.212234,43 C47.212234,43.550781 47.661453,44 48.212234,44 C48.763015,44 49.212234,43.550781 49.212234,43 C49.212234,42.449219 48.763015,42 48.212234,42 Z M52.212234,42 C51.661453,42 51.212234,42.449219 51.212234,43 C51.212234,43.550781 51.661453,44 52.212234,44 C52.763015,44 53.212234,43.550781 53.212234,43 C53.212234,42.449219 52.763015,42 52.212234,42 Z" id="inside_range" fill="#000000" fill-rule="nonzero"></path>
        </g>
    </g>
</svg>
        </div>
        <div style="font-family: 'IBM Plex Mono', monospace, courier; color: black; font-size: 10px; display: inline-block; vertical-align: middle;">
            <div>col_vals_between()</div>
        </div>
        </td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">customer_rating</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">[1.0, 5.0]</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" class="gt_row gt_center"><svg width="25px" height="25px" viewBox="0 0 25 25" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="vertical-align: middle;">
    <g id="unchanged" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="unchanged" transform="translate(0.500000, 0.570147)">
            <rect id="Rectangle" x="0.125132506" y="0" width="23.749735" height="23.7894737"></rect>
            <path d="M5.80375046,8.18194736 C3.77191832,8.18194736 2.11875046,9.83495328 2.11875046,11.8669474 C2.11875046,13.8989414 3.77191832,15.5519474 5.80375046,15.5519474 C7.8355826,15.5519474 9.48875046,13.8989414 9.48875046,11.8669474 C9.48875046,9.83495328 7.83552863,8.18194736 5.80375046,8.18194736 Z M5.80375046,14.814915 C4.17821997,14.814915 2.85578285,13.4924778 2.85578285,11.8669474 C2.85578285,10.2414169 4.17821997,8.91897975 5.80375046,8.91897975 C7.42928095,8.91897975 8.75171807,10.2414169 8.75171807,11.8669474 C8.75171807,13.4924778 7.42928095,14.814915 5.80375046,14.814915 Z" id="Shape" fill="#000000" fill-rule="nonzero"></path>
            <path d="M13.9638189,8.699335 C13.9364621,8.70430925 13.9091059,8.71176968 13.8842359,8.71923074 C13.7822704,8.73663967 13.6877654,8.77643115 13.6056956,8.83860518 L10.2433156,11.3852598 C10.0766886,11.5046343 9.97720993,11.6986181 9.97720993,11.9025491 C9.97720993,12.1064807 10.0766886,12.3004639 10.2433156,12.4198383 L13.6056956,14.966493 C13.891697,15.1803725 14.2970729,15.1231721 14.5109517,14.8371707 C14.7248313,14.5511692 14.6676309,14.145794 14.3816294,13.9319145 L12.5313257,12.5392127 L21.8812495,12.5392127 L21.8812495,11.2658854 L12.5313257,11.2658854 L14.3816294,9.87318364 C14.6377872,9.71650453 14.7497006,9.40066014 14.6477351,9.11714553 C14.5482564,8.83363156 14.262255,8.65954352 13.9638189,8.699335 Z" id="arrow" fill="#000000" transform="translate(15.929230, 11.894737) rotate(-180.000000) translate(-15.929230, -11.894737) "></path>
        </g>
    </g>
</svg></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" class="gt_row gt_center"><span style="color:#4CA64C;">&check;</span></td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" class="gt_row gt_right">7</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" class="gt_row gt_right">7<br />1.00</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" class="gt_row gt_right">0<br />0.00</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" class="gt_row gt_center">&mdash;</td>
    <td style="height: 40px; background-color: #FCFCFC;" class="gt_row gt_center">&mdash;</td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" class="gt_row gt_center">&mdash;</td>
    <td style="height: 40px;" class="gt_row gt_center">—</td>
  </tr>
  <tr>
    <td style="height: 40px; background-color: #4CA64C; color: transparent;font-size: 0px;" class="gt_row gt_left">#4CA64C</td>
    <td style="height: 40px; color: #666666;font-size: 13px;font-weight: bold;" class="gt_row gt_right">4</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" class="gt_row gt_left">
        <div style="margin: 0; padding: 0; display: inline-block; height: 30px; vertical-align: middle; width: 16%;">
            <!--?xml version="1.0" encoding="UTF-8"?--><?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="30px" viewBox="0 0 67 67" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>col_vals_in_set</title>
    <g id="Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="col_vals_in_set" transform="translate(0.000000, 0.172414)">
            <path d="M56.712234,1 C59.1975153,1 61.4475153,2.00735931 63.076195,3.63603897 C64.7048747,5.26471863 65.712234,7.51471863 65.712234,10 L65.712234,10 L65.712234,65 L10.712234,65 C8.22695259,65 5.97695259,63.9926407 4.34827294,62.363961 C2.71959328,60.7352814 1.71223397,58.4852814 1.71223397,56 L1.71223397,56 L1.71223397,10 C1.71223397,7.51471863 2.71959328,5.26471863 4.34827294,3.63603897 C5.97695259,2.00735931 8.22695259,1 10.712234,1 L10.712234,1 Z" id="rectangle" stroke="#000000" stroke-width="2" fill="#FFFFFF"></path>
            <path d="M44.127969,41.1538382 L31.0814568,41.1538382 C29.9510748,41.1536429 28.8827052,40.9256134 27.9079888,40.5136953 C26.4467442,39.8960136 25.19849,38.8599685 24.3189894,37.5577099 C23.8792391,36.906727 23.5314818,36.1899233 23.2936866,35.4252675 C23.2130217,35.16589 23.1460289,34.9005554 23.0913409,34.6307286 L44.1278714,34.6307286 C45.028466,34.6306309 45.7586488,33.9004481 45.7586488,32.9998535 C45.7586488,32.0992589 45.028466,31.3690761 44.1278714,31.3690761 L23.0905596,31.3690761 C23.1990567,30.8337194 23.3597028,30.3180894 23.5675173,29.8264831 C24.185199,28.3652386 25.2212442,27.1169844 26.5236004,26.2374838 C27.1745833,25.7977334 27.891387,25.4499762 28.6560428,25.2122786 C29.4208939,24.9744833 30.2334994,24.8459665 31.0813591,24.8459665 L44.1277737,24.8459665 C45.0283683,24.8459665 45.7586488,24.1157837 45.7586488,23.2151891 C45.7586488,22.3145945 45.0283683,21.5844117 44.1277737,21.5844117 L31.0813591,21.5844117 C29.5096643,21.5844117 28.0039858,21.9038483 26.6373711,22.4820765 C24.5866678,23.3498583 22.8469049,24.7950871 21.6163267,26.616296 C20.3856508,28.4362354 19.665136,30.6413347 19.6658191,33.0000488 C19.6658191,34.5717436 19.9852563,36.0774222 20.5635822,37.4440369 C21.4312663,39.4947402 22.8765927,41.2345031 24.697704,42.4650813 C26.5176434,43.6957572 28.7227427,44.4155883 31.0814568,44.4155883 L44.1278714,44.4155883 C45.028466,44.4155883 45.7586488,43.6854055 45.7586488,42.7848109 C45.7586488,41.8842163 45.0285636,41.1538382 44.127969,41.1538382 Z" id="set_of" fill="#000000" fill-rule="nonzero"></path>
        </g>
    </g>
</svg>
        </div>
        <div style="font-family: 'IBM Plex Mono', monospace, courier; color: black; font-size: 11px; display: inline-block; vertical-align: middle;">
            <div>col_vals_in_set()</div>
        </div>
        </td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">region</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">North, South, East, West</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" class="gt_row gt_center"><svg width="25px" height="25px" viewBox="0 0 25 25" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="vertical-align: middle;">
    <g id="unchanged" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="unchanged" transform="translate(0.500000, 0.570147)">
            <rect id="Rectangle" x="0.125132506" y="0" width="23.749735" height="23.7894737"></rect>
            <path d="M5.80375046,8.18194736 C3.77191832,8.18194736 2.11875046,9.83495328 2.11875046,11.8669474 C2.11875046,13.8989414 3.77191832,15.5519474 5.80375046,15.5519474 C7.8355826,15.5519474 9.48875046,13.8989414 9.48875046,11.8669474 C9.48875046,9.83495328 7.83552863,8.18194736 5.80375046,8.18194736 Z M5.80375046,14.814915 C4.17821997,14.814915 2.85578285,13.4924778 2.85578285,11.8669474 C2.85578285,10.2414169 4.17821997,8.91897975 5.80375046,8.91897975 C7.42928095,8.91897975 8.75171807,10.2414169 8.75171807,11.8669474 C8.75171807,13.4924778 7.42928095,14.814915 5.80375046,14.814915 Z" id="Shape" fill="#000000" fill-rule="nonzero"></path>
            <path d="M13.9638189,8.699335 C13.9364621,8.70430925 13.9091059,8.71176968 13.8842359,8.71923074 C13.7822704,8.73663967 13.6877654,8.77643115 13.6056956,8.83860518 L10.2433156,11.3852598 C10.0766886,11.5046343 9.97720993,11.6986181 9.97720993,11.9025491 C9.97720993,12.1064807 10.0766886,12.3004639 10.2433156,12.4198383 L13.6056956,14.966493 C13.891697,15.1803725 14.2970729,15.1231721 14.5109517,14.8371707 C14.7248313,14.5511692 14.6676309,14.145794 14.3816294,13.9319145 L12.5313257,12.5392127 L21.8812495,12.5392127 L21.8812495,11.2658854 L12.5313257,11.2658854 L14.3816294,9.87318364 C14.6377872,9.71650453 14.7497006,9.40066014 14.6477351,9.11714553 C14.5482564,8.83363156 14.262255,8.65954352 13.9638189,8.699335 Z" id="arrow" fill="#000000" transform="translate(15.929230, 11.894737) rotate(-180.000000) translate(-15.929230, -11.894737) "></path>
        </g>
    </g>
</svg></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" class="gt_row gt_center"><span style="color:#4CA64C;">&check;</span></td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" class="gt_row gt_right">7</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" class="gt_row gt_right">7<br />1.00</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" class="gt_row gt_right">0<br />0.00</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" class="gt_row gt_center">&mdash;</td>
    <td style="height: 40px; background-color: #FCFCFC;" class="gt_row gt_center">&mdash;</td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" class="gt_row gt_center">&mdash;</td>
    <td style="height: 40px;" class="gt_row gt_center">—</td>
  </tr>
</tbody>
  <tfoot class="gt_sourcenotes">
  <tr>
    <td class="gt_sourcenote" colspan="14" style="text-align: left;"><div style='margin-top: 5px; margin-bottom: 5px;'><span style='background-color: #FFF; color: #444; padding: 0.5em 0.5em; position: inherit; text-transform: uppercase; margin-left: 10px; margin-right: 5px; border: solid 1px #999999; font-variant-numeric: tabular-nums; border-radius: 0; padding: 2px 10px 2px 10px;'>2026-06-04 17:00:11 UTC</span><span style='background-color: #FFF; color: #444; padding: 0.5em 0.5em; position: inherit; margin-right: 5px; border: solid 1px #999999; font-variant-numeric: tabular-nums; border-radius: 0; padding: 2px 10px 2px 10px;'>< 1 s</span><span style='background-color: #FFF; color: #444; padding: 0.5em 0.5em; position: inherit; text-transform: uppercase; margin: 5px 1px 5px -1px; border: solid 1px #999999; font-variant-numeric: tabular-nums; border-radius: 0; padding: 2px 10px 2px 10px;'>2026-06-04 17:00:11 UTC</span></div></td>
  </tr>
</tfoot>
</table>
</div>
<p>In natural language, the steps that the agent performs are:</p>
<ul>
<li>Validate the <code>sales_data</code> DataFrame</li>
<li>Make sure that no values in <code>Date</code> are null</li>
<li>Make sure that the values in <code>sales</code> are between 0 and 10000</li>
<li>Make sure that the values in <code>customer_rating</code> are between 1 and 5</li>
<li>Make sure that the values in <code>region</code> are &ldquo;North&rdquo;, &ldquo;South&rdquo;, &ldquo;East&rdquo;, or &ldquo;West&rdquo;</li>
<li>Now, interrogate!</li>
</ul>
<p>The resulting table lets us know for each step what was expected, how many values passed, the percentage of values that passed, and so on. And, the validation agent works directly with Polars DataFrames, no need to convert to pandas!</p>
<p>Also, about that nifty table that gets output? 👀 <strong>Directly</strong> in this blog post (written in <a href="https://quarto.org/" target="_blank" rel="noopener">Quarto</a>)? <a href="https://posit-dev.github.io/great-tables/" target="_blank" rel="noopener">That is Great Tables</a>! But Great Tables isn&rsquo;t just for pointblank&hellip;</p>
<h2 id="creating-beautiful-tables-with-great-tables">Creating beautiful tables with Great Tables
</h2>
<p>Let&rsquo;s summarize some data:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">daily_summary</span> <span class="o">=</span> <span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">sales_data</span><span class="o">.</span><span class="n">group_by</span><span class="p">(</span><span class="s2">&#34;date&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">agg</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="p">[</span>
</span></span><span class="line"><span class="cl">            <span class="n">pl</span><span class="o">.</span><span class="n">col</span><span class="p">(</span><span class="s2">&#34;sales&#34;</span><span class="p">)</span><span class="o">.</span><span class="n">sum</span><span class="p">()</span><span class="o">.</span><span class="n">alias</span><span class="p">(</span><span class="s2">&#34;total_sales&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">            <span class="n">pl</span><span class="o">.</span><span class="n">col</span><span class="p">(</span><span class="s2">&#34;units_sold&#34;</span><span class="p">)</span><span class="o">.</span><span class="n">sum</span><span class="p">()</span><span class="o">.</span><span class="n">alias</span><span class="p">(</span><span class="s2">&#34;total_units&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">            <span class="n">pl</span><span class="o">.</span><span class="n">col</span><span class="p">(</span><span class="s2">&#34;customer_rating&#34;</span><span class="p">)</span><span class="o">.</span><span class="n">mean</span><span class="p">()</span><span class="o">.</span><span class="n">alias</span><span class="p">(</span><span class="s2">&#34;avg_rating&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="p">]</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">sort</span><span class="p">(</span><span class="s2">&#34;date&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">regional_summary</span> <span class="o">=</span> <span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">sales_data</span><span class="o">.</span><span class="n">group_by</span><span class="p">(</span><span class="s2">&#34;region&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">agg</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="p">[</span>
</span></span><span class="line"><span class="cl">            <span class="n">pl</span><span class="o">.</span><span class="n">col</span><span class="p">(</span><span class="s2">&#34;sales&#34;</span><span class="p">)</span><span class="o">.</span><span class="n">sum</span><span class="p">()</span><span class="o">.</span><span class="n">alias</span><span class="p">(</span><span class="s2">&#34;total_sales&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">            <span class="n">pl</span><span class="o">.</span><span class="n">col</span><span class="p">(</span><span class="s2">&#34;sales&#34;</span><span class="p">)</span><span class="o">.</span><span class="n">mean</span><span class="p">()</span><span class="o">.</span><span class="n">alias</span><span class="p">(</span><span class="s2">&#34;avg_sales&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">            <span class="n">pl</span><span class="o">.</span><span class="n">col</span><span class="p">(</span><span class="s2">&#34;units_sold&#34;</span><span class="p">)</span><span class="o">.</span><span class="n">sum</span><span class="p">()</span><span class="o">.</span><span class="n">alias</span><span class="p">(</span><span class="s2">&#34;total_units&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">            <span class="n">pl</span><span class="o">.</span><span class="n">col</span><span class="p">(</span><span class="s2">&#34;sales&#34;</span><span class="p">)</span><span class="o">.</span><span class="n">alias</span><span class="p">(</span><span class="s2">&#34;sales_trend&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="p">]</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">sort</span><span class="p">(</span><span class="s2">&#34;total_sales&#34;</span><span class="p">,</span> <span class="n">descending</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span></span></span></code></pre></div></div>
<p>Let&rsquo;s present our regional summary in a ✨publication-quality table✨ using <strong>Great Tables</strong>:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">great_tables</span> <span class="kn">import</span> <span class="n">loc</span><span class="p">,</span> <span class="n">style</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">GT</span><span class="p">(</span><span class="n">regional_summary</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">tab_header</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">title</span><span class="o">=</span><span class="s2">&#34;Regional Sales Performance&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">subtitle</span><span class="o">=</span><span class="s2">&#34;Week of January 15-21, 2026&#34;</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">fmt_currency</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">columns</span><span class="o">=</span><span class="p">[</span><span class="s2">&#34;total_sales&#34;</span><span class="p">,</span> <span class="s2">&#34;avg_sales&#34;</span><span class="p">],</span>
</span></span><span class="line"><span class="cl">        <span class="n">currency</span><span class="o">=</span><span class="s2">&#34;USD&#34;</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">fmt_number</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">columns</span><span class="o">=</span><span class="s2">&#34;total_units&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">decimals</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">sep_mark</span><span class="o">=</span><span class="s2">&#34;,&#34;</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">fmt_nanoplot</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">columns</span><span class="o">=</span><span class="s2">&#34;sales_trend&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">plot_type</span><span class="o">=</span><span class="s2">&#34;line&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">autoscale</span><span class="o">=</span><span class="kc">True</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">cols_label</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">region</span><span class="o">=</span><span class="s2">&#34;Region&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">total_sales</span><span class="o">=</span><span class="s2">&#34;Total Sales&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">avg_sales</span><span class="o">=</span><span class="s2">&#34;Average Sale&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">total_units</span><span class="o">=</span><span class="s2">&#34;Units Sold&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">sales_trend</span><span class="o">=</span><span class="s2">&#34;Trend&#34;</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">data_color</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">columns</span><span class="o">=</span><span class="s2">&#34;total_sales&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">palette</span><span class="o">=</span><span class="p">[</span><span class="s2">&#34;#f0f0f0&#34;</span><span class="p">,</span> <span class="s2">&#34;#447099&#34;</span><span class="p">],</span>
</span></span><span class="line"><span class="cl">        <span class="n">domain</span><span class="o">=</span><span class="p">[</span><span class="mi">1000</span><span class="p">,</span> <span class="mi">5000</span><span class="p">]</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">tab_style</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">style</span><span class="o">=</span><span class="n">style</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="n">weight</span><span class="o">=</span><span class="s2">&#34;bold&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">locations</span><span class="o">=</span><span class="n">loc</span><span class="o">.</span><span class="n">body</span><span class="p">(</span><span class="n">columns</span><span class="o">=</span><span class="s2">&#34;region&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">tab_style</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">style</span><span class="o">=</span><span class="n">style</span><span class="o">.</span><span class="n">fill</span><span class="p">(</span><span class="n">color</span><span class="o">=</span><span class="s2">&#34;#e8f4f8&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">locations</span><span class="o">=</span><span class="n">loc</span><span class="o">.</span><span class="n">body</span><span class="p">(</span><span class="n">rows</span><span class="o">=</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">tab_source_note</span><span class="p">(</span><span class="s2">&#34;Data validated with pointblank · Trend shows daily sales pattern&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">tab_options</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">table_font_size</span><span class="o">=</span><span class="s2">&#34;14px&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">heading_title_font_size</span><span class="o">=</span><span class="s2">&#34;18px&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">heading_subtitle_font_size</span><span class="o">=</span><span class="s2">&#34;14px&#34;</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span></span></span></code></pre></div></div>
<div id="ihvfoecgvb" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
<style>
#ihvfoecgvb table {
          font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }
#ihvfoecgvb thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#ihvfoecgvb p { margin: 0; padding: 0; }
 #ihvfoecgvb .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 14px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }
 #ihvfoecgvb .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #ihvfoecgvb .gt_title { color: #333333; font-size: 18px; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
 #ihvfoecgvb .gt_subtitle { color: #333333; font-size: 14px; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
 #ihvfoecgvb .gt_heading { background-color: #FFFFFF; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #ihvfoecgvb .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #ihvfoecgvb .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #ihvfoecgvb .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; overflow-x: hidden; }
 #ihvfoecgvb .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
 #ihvfoecgvb .gt_column_spanner_outer:first-child { padding-left: 0; }
 #ihvfoecgvb .gt_column_spanner_outer:last-child { padding-right: 0; }
 #ihvfoecgvb .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
 #ihvfoecgvb .gt_spanner_row { border-bottom-style: hidden; }
 #ihvfoecgvb .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }
 #ihvfoecgvb .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }
 #ihvfoecgvb .gt_from_md> :first-child { margin-top: 0; }
 #ihvfoecgvb .gt_from_md> :last-child { margin-bottom: 0; }
 #ihvfoecgvb .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }
 #ihvfoecgvb .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; }
 #ihvfoecgvb .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; vertical-align: top; }
 #ihvfoecgvb .gt_row_group_first td { border-top-width: 2px; }
 #ihvfoecgvb .gt_row_group_first th { border-top-width: 2px; }
 #ihvfoecgvb .gt_striped { color: #333333; background-color: #F4F4F4; }
 #ihvfoecgvb .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #ihvfoecgvb .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #ihvfoecgvb .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #ihvfoecgvb .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #ihvfoecgvb .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #ihvfoecgvb .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #ihvfoecgvb .gt_left { text-align: left; }
 #ihvfoecgvb .gt_center { text-align: center; }
 #ihvfoecgvb .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #ihvfoecgvb .gt_font_normal { font-weight: normal; }
 #ihvfoecgvb .gt_font_bold { font-weight: bold; }
 #ihvfoecgvb .gt_font_italic { font-style: italic; }
 #ihvfoecgvb .gt_super { font-size: 65%; }
 #ihvfoecgvb .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #ihvfoecgvb .gt_asterisk { font-size: 100%; vertical-align: 0; }
</style>
<table class="gt_table" data-quarto-postprocess="true" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
<colgroup>
<col style="width: 20%" />
<col style="width: 20%" />
<col style="width: 20%" />
<col style="width: 20%" />
<col style="width: 20%" />
</colgroup>
<thead>
<tr class="gt_heading">
<th colspan="5" class="gt_heading gt_title gt_font_normal">Regional Sales Performance</th>
</tr>
<tr class="gt_heading">
<th colspan="5" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Week of January 15-21, 2026</th>
</tr>
<tr class="gt_col_headings">
<th id="region" class="gt_col_heading gt_columns_bottom_border gt_left" data-quarto-table-cell-role="th" scope="col">Region</th>
<th id="total_sales" class="gt_col_heading gt_columns_bottom_border gt_right" data-quarto-table-cell-role="th" scope="col">Total Sales</th>
<th id="avg_sales" class="gt_col_heading gt_columns_bottom_border gt_right" data-quarto-table-cell-role="th" scope="col">Average Sale</th>
<th id="total_units" class="gt_col_heading gt_columns_bottom_border gt_right" data-quarto-table-cell-role="th" scope="col">Units Sold</th>
<th id="sales_trend" class="gt_col_heading gt_columns_bottom_border gt_center" data-quarto-table-cell-role="th" scope="col">Trend</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<td class="gt_row gt_left" style="font-weight: bold; background-color: #e8f4f8">North</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #557da2; background-color: #e8f4f8">$4,600.00</td>
<td class="gt_row gt_right" style="background-color: #e8f4f8">$1,533.33</td>
<td class="gt_row gt_right" style="background-color: #e8f4f8">92</td>
<td class="gt_row gt_center" style="background-color: #e8f4f8"><div>
<svg role="img" viewbox="0 0 250 130" style="height: 2em; margin-left: auto; margin-right: auto; font-size: inherit; overflow: visible; vertical-align: middle; position:relative;">
<defs><pattern id="area_pattern" width="8" height="8" patternunits="userSpaceOnUse"><path class="pattern-line" d="M 0,8 l 8,-8 M -1,1 l 4,-4 M 6,10 l 4,-4" stroke="#FF0000" stroke-width="1.5" stroke-linecap="round" shape-rendering="geometricPrecision"></path></pattern></defs><path class="area-closed" d="M 50.0,115.0 125.0,87.72727272727273 200.0,51.36363636363637 200.0,125 50.0,125 Z" stroke="transparent" stroke-width="2" fill="url(#area_pattern)" fill-opacity="0.7"></path><path d="M 50.0,115.0 C 75.0,115.0 100.0,87.72727272727273 125.0,87.72727272727273 C 150.0,87.72727272727273 175.0,51.36363636363637 200.0,51.36363636363637" stroke="#4682B4" stroke-width="8" fill="none"></path><circle cx="50.0" cy="115.0" r="10" stroke="#FFFFFF" stroke-width="4" fill="#FF0000"></circle><circle cx="125.0" cy="87.72727272727273" r="10" stroke="#FFFFFF" stroke-width="4" fill="#FF0000"></circle><circle cx="200.0" cy="51.36363636363637" r="10" stroke="#FFFFFF" stroke-width="4" fill="#FF0000"></circle><g class="y-axis-line"><rect x="0" y="0" width="65" height="130" stroke="transparent" stroke-width="0" fill="transparent"></rect><text x="0" y="19.0" fill="transparent" stroke="transparent" font-size="25">2.30K</text><text x="0" y="126.0" fill="transparent" stroke="transparent" font-size="25">1.20K</text></g><g class="vert-line"><rect x="40.0" y="0" width="20" height="130" stroke="transparent" stroke-width="12" fill="transparent"></rect><text x="60.0" y="20" fill="transparent" stroke="transparent" font-size="30px">1.20K</text></g><g class="vert-line"><rect x="115.0" y="0" width="20" height="130" stroke="transparent" stroke-width="12" fill="transparent"></rect><text x="135.0" y="20" fill="transparent" stroke="transparent" font-size="30px">1.50K</text></g><g class="vert-line"><rect x="190.0" y="0" width="20" height="130" stroke="transparent" stroke-width="12" fill="transparent"></rect><text x="210.0" y="20" fill="transparent" stroke="transparent" font-size="30px">1.90K</text></g>
</svg>
</div></td>
</tr>
<tr>
<td class="gt_row gt_left" style="font-weight: bold">West</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #5e83a6">$4,400.00</td>
<td class="gt_row gt_right">$2,200.00</td>
<td class="gt_row gt_right">88</td>
<td class="gt_row gt_center"><div>
<svg role="img" viewbox="0 0 200 130" style="height: 2em; margin-left: auto; margin-right: auto; font-size: inherit; overflow: visible; vertical-align: middle; position:relative;">
<defs><pattern id="area_pattern" width="8" height="8" patternunits="userSpaceOnUse"><path class="pattern-line" d="M 0,8 l 8,-8 M -1,1 l 4,-4 M 6,10 l 4,-4" stroke="#FF0000" stroke-width="1.5" stroke-linecap="round" shape-rendering="geometricPrecision"></path></pattern></defs><path class="area-closed" d="M 50.0,33.18181818181817 150.0,15.0 150.0,125 50.0,125 Z" stroke="transparent" stroke-width="2" fill="url(#area_pattern)" fill-opacity="0.7"></path><path d="M 50.0,33.18181818181817 C 75.0,33.18181818181817 125.0,15.0 150.0,15.0" stroke="#4682B4" stroke-width="8" fill="none"></path><circle cx="50.0" cy="33.18181818181817" r="10" stroke="#FFFFFF" stroke-width="4" fill="#FF0000"></circle><circle cx="150.0" cy="15.0" r="10" stroke="#FFFFFF" stroke-width="4" fill="#FF0000"></circle><g class="y-axis-line"><rect x="0" y="0" width="65" height="130" stroke="transparent" stroke-width="0" fill="transparent"></rect><text x="0" y="19.0" fill="transparent" stroke="transparent" font-size="25">2.30K</text><text x="0" y="126.0" fill="transparent" stroke="transparent" font-size="25">1.20K</text></g><g class="vert-line"><rect x="40.0" y="0" width="20" height="130" stroke="transparent" stroke-width="12" fill="transparent"></rect><text x="60.0" y="20" fill="transparent" stroke="transparent" font-size="30px">2.10K</text></g><g class="vert-line"><rect x="140.0" y="0" width="20" height="130" stroke="transparent" stroke-width="12" fill="transparent"></rect><text x="160.0" y="20" fill="transparent" stroke="transparent" font-size="30px">2.30K</text></g>
</svg>
</div></td>
</tr>
<tr>
<td class="gt_row gt_left" style="font-weight: bold">South</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #87a2bb">$3,450.00</td>
<td class="gt_row gt_right">$1,725.00</td>
<td class="gt_row gt_right">69</td>
<td class="gt_row gt_center"><div>
<svg role="img" viewbox="0 0 200 130" style="height: 2em; margin-left: auto; margin-right: auto; font-size: inherit; overflow: visible; vertical-align: middle; position:relative;">
<defs><pattern id="area_pattern" width="8" height="8" patternunits="userSpaceOnUse"><path class="pattern-line" d="M 0,8 l 8,-8 M -1,1 l 4,-4 M 6,10 l 4,-4" stroke="#FF0000" stroke-width="1.5" stroke-linecap="round" shape-rendering="geometricPrecision"></path></pattern></defs><path class="area-closed" d="M 50.0,60.45454545454546 150.0,74.09090909090908 150.0,125 50.0,125 Z" stroke="transparent" stroke-width="2" fill="url(#area_pattern)" fill-opacity="0.7"></path><path d="M 50.0,60.45454545454546 C 75.0,60.45454545454546 125.0,74.09090909090908 150.0,74.09090909090908" stroke="#4682B4" stroke-width="8" fill="none"></path><circle cx="50.0" cy="60.45454545454546" r="10" stroke="#FFFFFF" stroke-width="4" fill="#FF0000"></circle><circle cx="150.0" cy="74.09090909090908" r="10" stroke="#FFFFFF" stroke-width="4" fill="#FF0000"></circle><g class="y-axis-line"><rect x="0" y="0" width="65" height="130" stroke="transparent" stroke-width="0" fill="transparent"></rect><text x="0" y="19.0" fill="transparent" stroke="transparent" font-size="25">2.30K</text><text x="0" y="126.0" fill="transparent" stroke="transparent" font-size="25">1.20K</text></g><g class="vert-line"><rect x="40.0" y="0" width="20" height="130" stroke="transparent" stroke-width="12" fill="transparent"></rect><text x="60.0" y="20" fill="transparent" stroke="transparent" font-size="30px">1.80K</text></g><g class="vert-line"><rect x="140.0" y="0" width="20" height="130" stroke="transparent" stroke-width="12" fill="transparent"></rect><text x="160.0" y="20" fill="transparent" stroke="transparent" font-size="30px">1.65K</text></g>
</svg>
</div></td>
</tr>
</tbody><tfoot class="gt_sourcenotes">
<tr>
<td colspan="5" class="gt_sourcenote">Data validated with pointblank · Trend shows daily sales pattern</td>
</tr>
</tfoot>
&#10;</table>
</div>
<p>In this example, Great Tables:</p>
<ul>
<li>Adds a title using <code>tab_header</code></li>
<li>Formats currency using <code>fmt_currency</code></li>
<li>Formats numbers using <code>fmt_number</code></li>
<li>Creates a nanoplot (a miniature line chart) using <code>fmt_nanoplot</code></li>
<li>Labels the columns using <code>cols_label</code></li>
<li>Edit color, styling, and font sizes with <code>data_color</code>, <code>tab_style</code>, and <code>tab_options</code></li>
<li>Add a source note using <code>tab_source_note</code></li>
</ul>
<p>All with full Polars support! In fact, Great Tables is the <a href="https://docs.pola.rs/user-guide/misc/styling/" target="_blank" rel="noopener">default way to style Polars DataFrames</a>, using <code>df.style</code>.</p>
<h2 id="visualizations-with-plotnine">Visualizations with plotnine
</h2>
<p>For visualizations, <a href="https://plotnine.org/" target="_blank" rel="noopener"><strong>plotnine</strong></a> brings the <a href="https://en.wikipedia.org/wiki/Wilkinson%27s_Grammar_of_Graphics" target="_blank" rel="noopener">grammar of graphics</a> to Python. Let&rsquo;s create some nice-looking plots:</p>
<h3 id="daily-sales-trend">Daily sales trend
</h3>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">ggplot</span><span class="p">(</span><span class="n">daily_summary</span><span class="p">,</span> <span class="n">aes</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="s2">&#34;date&#34;</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="s2">&#34;total_sales&#34;</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">    <span class="o">+</span> <span class="n">geom_line</span><span class="p">(</span><span class="n">color</span><span class="o">=</span><span class="s2">&#34;#447099&#34;</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mf">1.5</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">+</span> <span class="n">geom_point</span><span class="p">(</span><span class="n">color</span><span class="o">=</span><span class="s2">&#34;#447099&#34;</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mi">4</span><span class="p">,</span> <span class="n">fill</span><span class="o">=</span><span class="s2">&#34;white&#34;</span><span class="p">,</span> <span class="n">stroke</span><span class="o">=</span><span class="mf">1.5</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">+</span> <span class="n">geom_text</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">aes</span><span class="p">(</span><span class="n">label</span><span class="o">=</span><span class="s2">&#34;total_sales&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">va</span><span class="o">=</span><span class="s2">&#34;bottom&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">nudge_y</span><span class="o">=</span><span class="mi">100</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">size</span><span class="o">=</span><span class="mi">9</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">color</span><span class="o">=</span><span class="s2">&#34;#333333&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">format_string</span><span class="o">=</span><span class="s2">&#34;$</span><span class="si">{:,.0f}</span><span class="s2">&#34;</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">+</span> <span class="n">scale_y_continuous</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">labels</span><span class="o">=</span><span class="k">lambda</span> <span class="n">l</span><span class="p">:</span> <span class="p">[</span><span class="sa">f</span><span class="s2">&#34;$</span><span class="si">{</span><span class="n">x</span><span class="si">:</span><span class="s2">,.0f</span><span class="si">}</span><span class="s2">&#34;</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">l</span><span class="p">],</span>
</span></span><span class="line"><span class="cl">        <span class="n">limits</span><span class="o">=</span><span class="p">(</span><span class="mi">1000</span><span class="p">,</span> <span class="mi">2600</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">expand</span><span class="o">=</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">+</span> <span class="n">labs</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">title</span><span class="o">=</span><span class="s2">&#34;Daily Sales Trend&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">subtitle</span><span class="o">=</span><span class="s2">&#34;Week of January 15-21, 2026 • Total revenue trending upward&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">x</span><span class="o">=</span><span class="s2">&#34;&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">y</span><span class="o">=</span><span class="s2">&#34;&#34;</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">+</span> <span class="n">theme_minimal</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">    <span class="o">+</span> <span class="n">theme</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">plot_title</span><span class="o">=</span><span class="n">element_text</span><span class="p">(</span><span class="n">size</span><span class="o">=</span><span class="mi">16</span><span class="p">,</span> <span class="n">weight</span><span class="o">=</span><span class="s2">&#34;bold&#34;</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s2">&#34;#2c3e50&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">plot_subtitle</span><span class="o">=</span><span class="n">element_text</span><span class="p">(</span><span class="n">size</span><span class="o">=</span><span class="mi">11</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s2">&#34;#7f8c8d&#34;</span><span class="p">,</span> <span class="n">margin</span><span class="o">=</span><span class="p">{</span><span class="s2">&#34;b&#34;</span><span class="p">:</span> <span class="mi">15</span><span class="p">}),</span>
</span></span><span class="line"><span class="cl">        <span class="n">axis_title_y</span><span class="o">=</span><span class="n">element_blank</span><span class="p">(),</span>
</span></span><span class="line"><span class="cl">        <span class="n">axis_text_y</span><span class="o">=</span><span class="n">element_text</span><span class="p">(</span><span class="n">size</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s2">&#34;#666666&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">axis_text_x</span><span class="o">=</span><span class="n">element_text</span><span class="p">(</span><span class="n">size</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s2">&#34;#666666&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">panel_grid_major_x</span><span class="o">=</span><span class="n">element_blank</span><span class="p">(),</span>
</span></span><span class="line"><span class="cl">        <span class="n">panel_grid_minor</span><span class="o">=</span><span class="n">element_blank</span><span class="p">(),</span>
</span></span><span class="line"><span class="cl">        <span class="n">panel_grid_major_y</span><span class="o">=</span><span class="n">element_line</span><span class="p">(</span><span class="n">color</span><span class="o">=</span><span class="s2">&#34;#e0e0e0&#34;</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mf">0.5</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">plot_background</span><span class="o">=</span><span class="n">element_rect</span><span class="p">(</span><span class="n">fill</span><span class="o">=</span><span class="s2">&#34;white&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">panel_background</span><span class="o">=</span><span class="n">element_rect</span><span class="p">(</span><span class="n">fill</span><span class="o">=</span><span class="s2">&#34;white&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">figure_size</span><span class="o">=</span><span class="p">(</span><span class="mi">8</span><span class="p">,</span> <span class="mi">6</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span></span></span></code></pre></div></div>
<img src="https://opensource.posit.co/blog/2026-06-04_libraries-for-python-polars/index_files/figure-markdown_strict/cell-9-output-1.png" data-fig-alt="Line chart showing daily sales from January 15-21, 2026. Sales increase from around $1,900 to $2,300 over the week, with values labeled on each data point." width="768" height="576" />
<h3 id="sales-by-region-and-product">Sales by region and product
</h3>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="c1"># Custom color palette with Posit-inspired colors</span>
</span></span><span class="line"><span class="cl"><span class="n">product_colors</span> <span class="o">=</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;Widget A&#34;</span><span class="p">:</span> <span class="s2">&#34;#447099&#34;</span><span class="p">,</span>  <span class="c1"># Blue</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;Widget B&#34;</span><span class="p">:</span> <span class="s2">&#34;#72994e&#34;</span><span class="p">,</span>  <span class="c1"># Green</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;Widget C&#34;</span><span class="p">:</span> <span class="s2">&#34;#c65d47&#34;</span><span class="p">,</span>  <span class="c1"># Rust</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">ggplot</span><span class="p">(</span><span class="n">sales_data</span><span class="p">,</span> <span class="n">aes</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="s2">&#34;region&#34;</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="s2">&#34;sales&#34;</span><span class="p">,</span> <span class="n">fill</span><span class="o">=</span><span class="s2">&#34;product&#34;</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">    <span class="o">+</span> <span class="n">geom_col</span><span class="p">(</span><span class="n">position</span><span class="o">=</span><span class="n">position_dodge</span><span class="p">(</span><span class="n">width</span><span class="o">=</span><span class="mf">0.8</span><span class="p">),</span> <span class="n">width</span><span class="o">=</span><span class="mf">0.7</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">+</span> <span class="n">scale_fill_manual</span><span class="p">(</span><span class="n">values</span><span class="o">=</span><span class="n">product_colors</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">+</span> <span class="n">scale_y_continuous</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">labels</span><span class="o">=</span><span class="k">lambda</span> <span class="n">l</span><span class="p">:</span> <span class="p">[</span><span class="sa">f</span><span class="s2">&#34;$</span><span class="si">{</span><span class="n">x</span><span class="si">:</span><span class="s2">,.0f</span><span class="si">}</span><span class="s2">&#34;</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">l</span><span class="p">],</span>
</span></span><span class="line"><span class="cl">        <span class="n">limits</span><span class="o">=</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">2500</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">breaks</span><span class="o">=</span><span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">2501</span><span class="p">,</span> <span class="mi">500</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">expand</span><span class="o">=</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">+</span> <span class="n">labs</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">title</span><span class="o">=</span><span class="s2">&#34;Sales Performance by Region&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">subtitle</span><span class="o">=</span><span class="s2">&#34;Product comparison across geographic markets&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">x</span><span class="o">=</span><span class="s2">&#34;&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">y</span><span class="o">=</span><span class="s2">&#34;&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">fill</span><span class="o">=</span><span class="s2">&#34;&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">+</span> <span class="n">theme_minimal</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">    <span class="o">+</span> <span class="n">theme</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">plot_title</span><span class="o">=</span><span class="n">element_text</span><span class="p">(</span><span class="n">size</span><span class="o">=</span><span class="mi">16</span><span class="p">,</span> <span class="n">weight</span><span class="o">=</span><span class="s2">&#34;bold&#34;</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s2">&#34;#2c3e50&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">plot_subtitle</span><span class="o">=</span><span class="n">element_text</span><span class="p">(</span><span class="n">size</span><span class="o">=</span><span class="mi">11</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s2">&#34;#7f8c8d&#34;</span><span class="p">,</span> <span class="n">margin</span><span class="o">=</span><span class="p">{</span><span class="s2">&#34;b&#34;</span><span class="p">:</span> <span class="mi">15</span><span class="p">}),</span>
</span></span><span class="line"><span class="cl">        <span class="n">axis_title</span><span class="o">=</span><span class="n">element_blank</span><span class="p">(),</span>
</span></span><span class="line"><span class="cl">        <span class="n">axis_text_y</span><span class="o">=</span><span class="n">element_text</span><span class="p">(</span><span class="n">size</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s2">&#34;#666666&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">axis_text_x</span><span class="o">=</span><span class="n">element_text</span><span class="p">(</span><span class="n">size</span><span class="o">=</span><span class="mi">11</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s2">&#34;#333333&#34;</span><span class="p">,</span> <span class="n">weight</span><span class="o">=</span><span class="s2">&#34;bold&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">legend_position</span><span class="o">=</span><span class="s2">&#34;top&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">legend_title</span><span class="o">=</span><span class="n">element_blank</span><span class="p">(),</span>
</span></span><span class="line"><span class="cl">        <span class="n">legend_text</span><span class="o">=</span><span class="n">element_text</span><span class="p">(</span><span class="n">size</span><span class="o">=</span><span class="mi">10</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">legend_box_margin</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">panel_grid_major_x</span><span class="o">=</span><span class="n">element_blank</span><span class="p">(),</span>
</span></span><span class="line"><span class="cl">        <span class="n">panel_grid_minor</span><span class="o">=</span><span class="n">element_blank</span><span class="p">(),</span>
</span></span><span class="line"><span class="cl">        <span class="n">panel_grid_major_y</span><span class="o">=</span><span class="n">element_line</span><span class="p">(</span><span class="n">color</span><span class="o">=</span><span class="s2">&#34;#e0e0e0&#34;</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mf">0.5</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">plot_background</span><span class="o">=</span><span class="n">element_rect</span><span class="p">(</span><span class="n">fill</span><span class="o">=</span><span class="s2">&#34;white&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">panel_background</span><span class="o">=</span><span class="n">element_rect</span><span class="p">(</span><span class="n">fill</span><span class="o">=</span><span class="s2">&#34;white&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">figure_size</span><span class="o">=</span><span class="p">(</span><span class="mi">8</span><span class="p">,</span> <span class="mi">6</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span></span></span></code></pre></div></div>
<img src="https://opensource.posit.co/blog/2026-06-04_libraries-for-python-polars/index_files/figure-markdown_strict/cell-10-output-1.png" data-fig-alt="Grouped bar chart showing sales performance by region (North, South, West) and product (Widget A, B, C). Bars are color-coded by product with Widget A in blue, Widget B in green, and Widget C in rust. West region shows highest sales, particularly for Widget C at approximately $2,300." width="768" height="576" />
<p>Plotnine works seamlessly with Polars DataFrames, no conversion needed! These visualizations can include:</p>
<ul>
<li>Values displayed directly on points for easy reading with <code>geom_text</code></li>
<li>Currency labels, appropriate limits, and controlled breaks with <code>scale_y_continuous</code></li>
<li>Larger, bolder titles with subtle subtitle styling with <code>theme</code></li>
<li>Pure white backgrounds with subtle gray gridlines with <code>theme_minimal</code> (my favorite built-in theme)</li>
</ul>
<p>Again, with full Polars support. There&rsquo;s more about it in the <a href="https://docs.pola.rs/user-guide/misc/visualization/" target="_blank" rel="noopener">Polars documentation for visualization</a>.</p>
<h2 id="ai-powered-insights-with-mall">AI-powered insights with mall
</h2>
<p>Finally, let&rsquo;s use <a href="https://mlverse.github.io/mall/" target="_blank" rel="noopener"><strong>mall</strong></a> to add LLM-powered analysis to our workflow. I used <a href="https://ollama.com/" target="_blank" rel="noopener">Ollama</a> <sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> with a local model, but mall works with OpenAI, Anthropic, and other providers through the <a href="https://github.com/cpsievert/chatlas" target="_blank" rel="noopener">chatlas</a> package.</p>
<p>Mall extends Polars DataFrames with an <code>.llm</code> accessor that provides natural language operations. We can use mall to add natural language descriptions to our sales data, rating the performance of each row as &ldquo;low&rdquo;, &ldquo;medium&rdquo;, or &ldquo;high&rdquo;:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">sales_data</span><span class="o">.</span><span class="n">llm</span><span class="o">.</span><span class="n">use</span><span class="p">(</span><span class="s2">&#34;ollama&#34;</span><span class="p">,</span> <span class="s2">&#34;llama3.2&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">sales_with_performance</span> <span class="o">=</span> <span class="n">sales_data</span><span class="o">.</span><span class="n">llm</span><span class="o">.</span><span class="n">classify</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;sales&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="p">[</span><span class="s2">&#34;high&#34;</span><span class="p">,</span> <span class="s2">&#34;medium&#34;</span><span class="p">,</span> <span class="s2">&#34;low&#34;</span><span class="p">],</span>
</span></span><span class="line"><span class="cl">    <span class="n">pred_name</span><span class="o">=</span><span class="s2">&#34;performance&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">sales_with_performance</span><span class="o">.</span><span class="n">select</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="p">[</span><span class="s2">&#34;date&#34;</span><span class="p">,</span> <span class="s2">&#34;region&#34;</span><span class="p">,</span> <span class="s2">&#34;product&#34;</span><span class="p">,</span> <span class="s2">&#34;sales&#34;</span><span class="p">,</span> <span class="s2">&#34;performance&#34;</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="p">))</span></span></span></code></pre></div></div>
<pre><code>shape: (7, 5)
┌────────────┬────────┬──────────┬───────┬─────────────┐
│ date       ┆ region ┆ product  ┆ sales ┆ performance │
│ ---        ┆ ---    ┆ ---      ┆ ---   ┆ ---         │
│ date       ┆ str    ┆ str      ┆ i64   ┆ str         │
╞════════════╪════════╪══════════╪═══════╪═════════════╡
│ 2026-01-15 ┆ North  ┆ Widget A ┆ 1200  ┆ low         │
│ 2026-01-16 ┆ South  ┆ Widget B ┆ 1800  ┆ low         │
│ 2026-01-17 ┆ North  ┆ Widget A ┆ 1500  ┆ low         │
│ 2026-01-18 ┆ West   ┆ Widget C ┆ 2100  ┆ low         │
│ 2026-01-19 ┆ South  ┆ Widget B ┆ 1650  ┆ low         │
│ 2026-01-20 ┆ North  ┆ Widget A ┆ 1900  ┆ low         │
│ 2026-01-21 ┆ West   ┆ Widget C ┆ 2300  ┆ low         │
└────────────┴────────┴──────────┴───────┴─────────────┘
</code></pre>
<p>Or we can generate custom descriptions for each product:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="c1"># mall&#39;s custom() processes a single text column, so first combine the</span>
</span></span><span class="line"><span class="cl"><span class="c1"># relevant fields into one column for the LLM to read.</span>
</span></span><span class="line"><span class="cl"><span class="n">sales_with_description</span> <span class="o">=</span> <span class="n">sales_data</span><span class="o">.</span><span class="n">with_columns</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">pl</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="s2">&#34;Product: </span><span class="si">{}</span><span class="s2">, Region: </span><span class="si">{}</span><span class="s2">, Sales: </span><span class="si">{}</span><span class="s2">, Customer rating: </span><span class="si">{}</span><span class="s2">&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">pl</span><span class="o">.</span><span class="n">col</span><span class="p">(</span><span class="s2">&#34;product&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">pl</span><span class="o">.</span><span class="n">col</span><span class="p">(</span><span class="s2">&#34;region&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">pl</span><span class="o">.</span><span class="n">col</span><span class="p">(</span><span class="s2">&#34;sales&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">pl</span><span class="o">.</span><span class="n">col</span><span class="p">(</span><span class="s2">&#34;customer_rating&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span><span class="o">.</span><span class="n">alias</span><span class="p">(</span><span class="s2">&#34;product_info&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span><span class="o">.</span><span class="n">llm</span><span class="o">.</span><span class="n">custom</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;product_info&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="n">pred_name</span><span class="o">=</span><span class="s2">&#34;description&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="n">prompt</span><span class="o">=</span><span class="s2">&#34;Based on this product, region, sales amount, and customer rating, create a brief insight about the product&#39;s performance in 15 words or less&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">with</span> <span class="n">pl</span><span class="o">.</span><span class="n">Config</span><span class="p">(</span><span class="n">fmt_str_lengths</span><span class="o">=</span><span class="mi">200</span><span class="p">):</span>
</span></span><span class="line"><span class="cl">    <span class="nb">print</span><span class="p">(</span><span class="n">sales_with_description</span><span class="o">.</span><span class="n">select</span><span class="p">([</span><span class="s2">&#34;product&#34;</span><span class="p">,</span> <span class="s2">&#34;description&#34;</span><span class="p">]))</span></span></span></code></pre></div></div>
<pre><code>shape: (7, 2)
┌──────────┬───────────────────────────────────────────────────────────────────────────────────────┐
│ product  ┆ description                                                                           │
│ ---      ┆ ---                                                                                   │
│ str      ┆ str                                                                                   │
╞══════════╪═══════════════════════════════════════════════════════════════════════════════════════╡
│ Widget A ┆ Widget A performs well in North region with strong customer satisfaction and moderate │
│          ┆ sales growth.                                                                         │
│ Widget B ┆ Widget B performs well in the South region with high customer satisfaction and sales. │
│ Widget A ┆ Widget A performs well in the North region with high sales and customer satisfaction  │
│          ┆ ratings.                                                                              │
│ Widget C ┆ Widget C excels with high sales and exceptional customer satisfaction in Western      │
│          ┆ region markets.                                                                       │
│ Widget B ┆ Widget B performs well with strong sales and high customer satisfaction ratings       │
│          ┆ overall.                                                                              │
│ Widget A ┆ Widget A excels with high sales (1900) and excellent customer reviews (4.8/5 in North │
│          ┆ region).                                                                              │
│ Widget C ┆ Widget C performs well with high sales and exceptional customer satisfaction in       │
│          ┆ Western region.                                                                       │
└──────────┴───────────────────────────────────────────────────────────────────────────────────────┘
</code></pre>
<p>Mall has a bunch of other powerful operations you can use:</p>
<ul>
<li><code>.llm.classify</code> &mdash; Categorize data into predefined labels</li>
<li><code>.llm.sentiment</code> &mdash; Analyze sentiment (positive/negative/neutral)</li>
<li><code>.llm.summarize</code> &mdash; Condense text columns to key points</li>
<li><code>.llm.extract</code> &mdash; Pull specific information from text</li>
<li><code>.llm.translate</code> &mdash; Convert text to another language</li>
<li><code>.llm.verify</code> &mdash; Check if statements are supported by data</li>
</ul>
<p>And not surprisingly, mall keeps everything in Polars format, which means fast, AI-enhanced data operations that fit naturally into your Polars pipelines.</p>
<h2 id="wrapping-up">Wrapping up
</h2>
<p>The Python data ecosystem has embraced Polars, and so has Posit! These four libraries show how we can build complete data workflows without ever leaving the Polars DataFrame format:</p>
<ul>
<li><strong>pointblank</strong> &mdash; Ensure your data quality before analysis begins</li>
<li><strong>Great Tables</strong> &mdash; Create publication-ready tables with rich formatting options</li>
<li><strong>plotnine</strong> &mdash; Build beautiful, reproducible visualizations with the grammar of graphics</li>
<li><strong>mall</strong> &mdash; Integrate LLM capabilities directly into your data pipelines</li>
</ul>
<p>All of these libraries work seamlessly with Polars, so you can stay in the fast, efficient world of Polars from start to finish. Hope you check them out!</p>
<h2 id="learn-more">Learn more
</h2>
<ul>
<li><a href="https://posit-dev.github.io/pointblank/" target="_blank" rel="noopener">pointblank documentation</a></li>
<li><a href="https://posit-dev.github.io/great-tables/" target="_blank" rel="noopener">Great Tables documentation</a></li>
<li><a href="https://plotnine.org/" target="_blank" rel="noopener">plotnine documentation</a></li>
<li><a href="https://mlverse.github.io/mall/" target="_blank" rel="noopener">mall documentation</a></li>
</ul>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>For instructions, please review the <a href="https://posit.co/blog/setting-up-local-llms-for-r-and-python" target="_blank" rel="noopener">Setting up local LLMs for R and Python</a> blog post.&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></description>
      <enclosure url="https://opensource.posit.co/blog/2026-06-04_libraries-for-python-polars/images/featured-image.jpg" length="77502" type="image/jpeg" />
    </item>
    <item>
      <title>nanoparquet 0.5.1</title>
      <link>https://opensource.posit.co/blog/2026-04-30_nanoparquet-0-5-1/</link>
      <pubDate>Thu, 30 Apr 2026 00:00:00 +0000</pubDate>
      <guid>https://opensource.posit.co/blog/2026-04-30_nanoparquet-0-5-1/</guid>
      <dc:creator>Gábor Csárdi</dc:creator><description><![CDATA[<!--
TODO:
- [x] Add image (1920×1080 PNG or JPG) and image-alt
- [x] Trim topics, software, and languages to only what applies
- [ ] Open a PR against main for a Netlify preview
-->
<p>We&rsquo;re very chuffed to announce the release of
<a href="https://nanoparquet.r-lib.org/" target="_blank" rel="noopener">nanoparquet</a> 0.5.1 (and 0.5.0).
nanoparquet is a small, self-sufficient R package for reading and
writing Parquet files.</p>
<p>You can install it from CRAN with:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">install.packages</span><span class="p">(</span><span class="s">&#34;nanoparquet&#34;</span><span class="p">)</span></span></span></code></pre></div></div>
<p>This blog post will go over some of the improvements in nanoparquet 0.5.0
and 0.5.1.</p>
<p>You can see a full list of changes in the release notes
<a href="https://github.com/r-lib/nanoparquet/releases/tag/v0.5.0" target="_blank" rel="noopener">here</a> and
<a href="https://github.com/r-lib/nanoparquet/releases/tag/v0.5.1" target="_blank" rel="noopener">here</a>.</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">library</span><span class="p">(</span><span class="n">nanoparquet</span><span class="p">)</span></span></span></code></pre></div></div>
<h2 id="list-columns">List columns
</h2>
<p>Parquet has a <code>LIST</code> type for columns whose values are variable-length
sequences of scalars. nanoparquet 0.5.0 adds support for reading and
writing such columns.</p>
<blockquote>
<p><strong>Note:</strong> for now nanoparquet supports one level of nesting: each
element of a list column must be an atomic vector of a single type,
not a list of lists. All elements in a column must have the same scalar
type.</p>
</blockquote>
<p>To write a list column, put a regular R list into your data frame.
Each element must be an atomic vector (integer, double, or character),
<code>NULL</code> for a missing list, or an empty vector for an empty list.
<code>NA</code> values inside an element vector encode missing elements.</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="n">df</span> <span class="o">&lt;-</span> <span class="nf">data.frame</span><span class="p">(</span><span class="n">id</span> <span class="o">=</span> <span class="m">1</span><span class="o">:</span><span class="m">4</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">df</span><span class="o">$</span><span class="n">scores</span> <span class="o">&lt;-</span> <span class="nf">list</span><span class="p">(</span><span class="nf">c</span><span class="p">(</span><span class="m">80L</span><span class="p">,</span> <span class="m">95L</span><span class="p">,</span> <span class="m">70L</span><span class="p">),</span> <span class="nf">c</span><span class="p">(</span><span class="m">100L</span><span class="p">),</span> <span class="kc">NULL</span><span class="p">,</span> <span class="nf">integer</span><span class="p">(</span><span class="m">0</span><span class="p">))</span>
</span></span><span class="line"><span class="cl"><span class="nf">write_parquet</span><span class="p">(</span><span class="n">df</span><span class="p">,</span> <span class="n">tmp</span> <span class="o">&lt;-</span> <span class="nf">tempfile</span><span class="p">(</span><span class="n">fileext</span> <span class="o">=</span> <span class="s">&#34;.parquet&#34;</span><span class="p">))</span></span></span></code></pre></div></div>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">read_parquet_schema</span><span class="p">(</span><span class="n">tmp</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code># A data frame: 5 × 14
  file_name  r_col name  r_type type  type_length repetition_type converted_type
  &lt;chr&gt;      &lt;int&gt; &lt;chr&gt; &lt;chr&gt;  &lt;chr&gt;       &lt;int&gt; &lt;chr&gt;           &lt;chr&gt;         
1 /var/fold…    NA sche… &lt;NA&gt;   &lt;NA&gt;           NA &lt;NA&gt;            &lt;NA&gt;          
2 /var/fold…     1 id    integ… INT32          NA REQUIRED        INT_32        
3 /var/fold…     2 scor… list(… &lt;NA&gt;           NA OPTIONAL        LIST          
4 /var/fold…     2 list  &lt;NA&gt;   &lt;NA&gt;           NA REPEATED        &lt;NA&gt;          
5 /var/fold…     2 elem… &lt;NA&gt;   INT32          NA OPTIONAL        INT_32        
# ℹ 6 more variables: logical_type &lt;I&lt;list&gt;&gt;, num_children &lt;int&gt;, scale &lt;int&gt;,
#   precision &lt;int&gt;, field_id &lt;int&gt;, children &lt;list&gt;
</code></pre>
<p><code>read_parquet()</code> reads <code>LIST</code> columns back as R list columns:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">as.data.frame</span><span class="p">(</span><span class="nf">read_parquet</span><span class="p">(</span><span class="n">tmp</span><span class="p">))</span></span></span></code></pre></div></div>
<pre><code>  id     scores
1  1 80, 95, 70
2  2        100
3  3       NULL
4  4           
</code></pre>
<p><code>infer_parquet_schema()</code> shows how nanoparquet maps each column to a Parquet
type. For list columns, the <code>r_type</code> shows e.g. <code>list(integer)</code>:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">infer_parquet_schema</span><span class="p">(</span><span class="n">df</span><span class="p">)</span><span class="n">[2</span><span class="o">:</span><span class="m">7</span><span class="n">]</span></span></span></code></pre></div></div>
<pre><code># A data frame: 4 × 6
  r_col name    r_type        type  type_length repetition_type
  &lt;int&gt; &lt;chr&gt;   &lt;chr&gt;         &lt;chr&gt;       &lt;int&gt; &lt;chr&gt;          
1     1 id      integer       INT32          NA REQUIRED       
2     2 scores  list(integer) &lt;NA&gt;           NA OPTIONAL       
3     2 list    &lt;NA&gt;          &lt;NA&gt;           NA REPEATED       
4     2 element &lt;NA&gt;          INT32          NA OPTIONAL       
</code></pre>
<p>A <code>LIST</code> column occupies three rows in the schema: the outer list node,
a repeated group node, and the leaf element node.</p>
<p>When you need to specify the element type explicitly, you can use
<code>parquet_schema()</code>:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">&lt;-</span> <span class="nf">parquet_schema</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">  <span class="n">id</span>     <span class="o">=</span> <span class="s">&#34;INT32&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="n">scores</span> <span class="o">=</span> <span class="nf">list</span><span class="p">(</span><span class="s">&#34;LIST&#34;</span><span class="p">,</span> <span class="n">element</span> <span class="o">=</span> <span class="s">&#34;INT32&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nf">write_parquet</span><span class="p">(</span><span class="n">df</span><span class="p">,</span> <span class="n">tmp2</span> <span class="o">&lt;-</span> <span class="nf">tempfile</span><span class="p">(</span><span class="n">fileext</span> <span class="o">=</span> <span class="s">&#34;.parquet&#34;</span><span class="p">),</span> <span class="n">schema</span> <span class="o">=</span> <span class="n">schema</span><span class="p">)</span></span></span></code></pre></div></div>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">read_parquet_schema</span><span class="p">(</span><span class="n">tmp2</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code># A data frame: 5 × 14
  file_name  r_col name  r_type type  type_length repetition_type converted_type
  &lt;chr&gt;      &lt;int&gt; &lt;chr&gt; &lt;chr&gt;  &lt;chr&gt;       &lt;int&gt; &lt;chr&gt;           &lt;chr&gt;         
1 /var/fold…    NA sche… &lt;NA&gt;   &lt;NA&gt;           NA &lt;NA&gt;            &lt;NA&gt;          
2 /var/fold…     1 id    integ… INT32          NA REQUIRED        &lt;NA&gt;          
3 /var/fold…     2 scor… list(… &lt;NA&gt;           NA OPTIONAL        LIST          
4 /var/fold…     2 list  &lt;NA&gt;   &lt;NA&gt;           NA REPEATED        &lt;NA&gt;          
5 /var/fold…     2 elem… &lt;NA&gt;   INT32          NA OPTIONAL        INT_32        
# ℹ 6 more variables: logical_type &lt;I&lt;list&gt;&gt;, num_children &lt;int&gt;, scale &lt;int&gt;,
#   precision &lt;int&gt;, field_id &lt;int&gt;, children &lt;list&gt;
</code></pre>
<h2 id="new-types">New types
</h2>
<h3 id="bit64integer64"><code>bit64::integer64</code>
</h3>
<p>Parquet&rsquo;s <code>INT64</code> type holds 64-bit integers. R&rsquo;s native <code>integer</code> is
only 32 bits, so nanoparquet has mapped <code>INT64</code> to <code>double</code> by default.
nanoparquet 0.5.1 adds support for <code>bit64::integer64</code>, which gives you true
64-bit integer arithmetic in R.</p>
<p><code>write_parquet()</code> now writes <code>bit64::integer64</code> columns as <code>INT64</code>:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">library</span><span class="p">(</span><span class="n">bit64</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">df2</span> <span class="o">&lt;-</span> <span class="nf">data.frame</span><span class="p">(</span><span class="n">id</span> <span class="o">=</span> <span class="nf">as.integer64</span><span class="p">(</span><span class="nf">c</span><span class="p">(</span><span class="m">1e18</span><span class="p">,</span> <span class="m">2e18</span><span class="p">,</span> <span class="m">3e18</span><span class="p">)))</span>
</span></span><span class="line"><span class="cl"><span class="nf">write_parquet</span><span class="p">(</span><span class="n">df2</span><span class="p">,</span> <span class="n">tmp3</span> <span class="o">&lt;-</span> <span class="nf">tempfile</span><span class="p">(</span><span class="n">fileext</span> <span class="o">=</span> <span class="s">&#34;.parquet&#34;</span><span class="p">))</span>
</span></span><span class="line"><span class="cl"><span class="nf">read_parquet_schema</span><span class="p">(</span><span class="n">tmp3</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code># A data frame: 2 × 14
  file_name  r_col name  r_type type  type_length repetition_type converted_type
  &lt;chr&gt;      &lt;int&gt; &lt;chr&gt; &lt;chr&gt;  &lt;chr&gt;       &lt;int&gt; &lt;chr&gt;           &lt;chr&gt;         
1 /var/fold…    NA sche… &lt;NA&gt;   &lt;NA&gt;           NA &lt;NA&gt;            &lt;NA&gt;          
2 /var/fold…     1 id    double INT64          NA REQUIRED        INT_64        
# ℹ 6 more variables: logical_type &lt;I&lt;list&gt;&gt;, num_children &lt;int&gt;, scale &lt;int&gt;,
#   precision &lt;int&gt;, field_id &lt;int&gt;, children &lt;list&gt;
</code></pre>
<p>To read <code>INT64</code> columns back as <code>bit64::integer64</code> instead of the default
<code>double</code>, use the <code>read_int64_type</code> option. The bit64 package must be
installed; if it isn&rsquo;t, nanoparquet throws a clear error.</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">read_parquet</span><span class="p">(</span><span class="n">tmp3</span><span class="p">,</span> <span class="n">options</span> <span class="o">=</span> <span class="nf">parquet_options</span><span class="p">(</span><span class="n">read_int64_type</span> <span class="o">=</span> <span class="s">&#34;integer64&#34;</span><span class="p">))</span></span></span></code></pre></div></div>
<pre><code># A data frame: 3 × 1
       id
  &lt;int64&gt;
1    0e18
2    2e18
3    3e18
</code></pre>
<h3 id="blobblob"><code>blob::blob</code>
</h3>
<p><code>read_parquet()</code> previously returned raw <code>BYTE_ARRAY</code> and
<code>FIXED_LEN_BYTE_ARRAY</code> columns (i.e. those without a string, UUID, or
decimal annotation) as plain lists of raw vectors. They are now returned as
<code>blob::blob</code> objects, which print more neatly and come with the full set of
blob helpers. <code>write_parquet()</code> now also accepts <code>blob::blob</code> columns, so
round-tripping binary data is straightforward:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">library</span><span class="p">(</span><span class="n">blob</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">df3</span> <span class="o">&lt;-</span> <span class="nf">data.frame</span><span class="p">(</span><span class="n">id</span> <span class="o">=</span> <span class="m">1</span><span class="o">:</span><span class="m">3</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">df3</span><span class="o">$</span><span class="n">payload</span> <span class="o">&lt;-</span> <span class="n">blob</span><span class="o">::</span><span class="nf">blob</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">  <span class="nf">charToRaw</span><span class="p">(</span><span class="s">&#34;hello&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">  <span class="nf">charToRaw</span><span class="p">(</span><span class="s">&#34;world&#34;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">  <span class="nf">charToRaw</span><span class="p">(</span><span class="s">&#34;!&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nf">write_parquet</span><span class="p">(</span><span class="n">df3</span><span class="p">,</span> <span class="n">tmp4</span> <span class="o">&lt;-</span> <span class="nf">tempfile</span><span class="p">(</span><span class="n">fileext</span> <span class="o">=</span> <span class="s">&#34;.parquet&#34;</span><span class="p">))</span>
</span></span><span class="line"><span class="cl"><span class="nf">as.data.frame</span><span class="p">(</span><span class="nf">read_parquet</span><span class="p">(</span><span class="n">tmp4</span><span class="p">))</span></span></span></code></pre></div></div>
<pre><code>  id   payload
1  1 blob[5 B]
2  2 blob[5 B]
3  3 blob[1 B]
</code></pre>
<h2 id="nanoparquet-as-a-filter">nanoparquet as a filter
</h2>
<p>In Unix, a <em>filter</em> is a program that reads from standard input and writes
to standard output, making it a composable building block in shell pipelines.
<code>write_parquet()</code> now supports writing to standard output via
<code>file = &quot;:stdout:&quot;</code>:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">write_parquet</span><span class="p">(</span><span class="n">mtcars</span><span class="p">,</span> <span class="s">&#34;:stdout:&#34;</span><span class="p">)</span></span></span></code></pre></div></div>
<p>The most common use case is from the command line:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">Rscript --quiet -e <span class="s1">&#39;nanoparquet::write_parquet(mtcars, &#34;:stdout:&#34;)&#39;</span> &gt; mtcars.parquet</span></span></code></pre></div></div>
<p>You can build this into a data pipeline. For example, to convert a CSV
to Parquet, and then process Parquet with another tool in one shot,
without an intermediate <code>.parquet</code> file on the disk, you can do:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">cat data.csv <span class="p">|</span>
</span></span><span class="line"><span class="cl">  Rscript --quiet -e <span class="s1">&#39;
</span></span></span><span class="line"><span class="cl"><span class="s1">    df &lt;- read.csv(file(&#34;stdin&#34;))
</span></span></span><span class="line"><span class="cl"><span class="s1">    nanoparquet::write_parquet(df, &#34;:stdout:&#34;)
</span></span></span><span class="line"><span class="cl"><span class="s1">  &#39;</span> <span class="p">|</span> another-parquet-tool</span></span></code></pre></div></div>
<p>Since nanoparquet 0.4.0, <code>read_parquet()</code> can also read from an R
connection, so you can pipe Parquet data <em>in</em> as well:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="n">url</span> <span class="o">&lt;-</span> <span class="s">&#34;https://raw.githubusercontent.com/r-lib/nanoparquet/main/inst/extdata/userdata1.parquet&#34;</span>
</span></span><span class="line"><span class="cl"><span class="n">con</span> <span class="o">&lt;-</span> <span class="nf">pipe</span><span class="p">(</span><span class="nf">paste</span><span class="p">(</span><span class="s">&#34;curl --silent&#34;</span><span class="p">,</span> <span class="n">url</span><span class="p">))</span>
</span></span><span class="line"><span class="cl"><span class="n">df</span> <span class="o">&lt;-</span> <span class="nf">read_parquet</span><span class="p">(</span><span class="n">con</span><span class="p">)</span></span></span></code></pre></div></div>
<h2 id="acknowledgements">Acknowledgements
</h2>
<p>We thank all contributors to nanoparquet so far, for opening issues,
submitting pull requests, and providing feedback:
<a href="https://github.com/Aariq" target="_blank" rel="noopener">@Aariq</a>,
<a href="https://github.com/alvarocombo" target="_blank" rel="noopener">@alvarocombo</a>,
<a href="https://github.com/apalacio9502" target="_blank" rel="noopener">@apalacio9502</a>,
<a href="https://github.com/atsyplenkov" target="_blank" rel="noopener">@atsyplenkov</a>,
<a href="https://github.com/cboettig" target="_blank" rel="noopener">@cboettig</a>,
<a href="https://github.com/ChandlerLutz" target="_blank" rel="noopener">@ChandlerLutz</a>,
<a href="https://github.com/cmrnp" target="_blank" rel="noopener">@cmrnp</a>,
<a href="https://github.com/D3SL" target="_blank" rel="noopener">@D3SL</a>,
<a href="https://github.com/damonbayer" target="_blank" rel="noopener">@damonbayer</a>,
<a href="https://github.com/DavideMessinaARS" target="_blank" rel="noopener">@DavideMessinaARS</a>,
<a href="https://github.com/eitsupi" target="_blank" rel="noopener">@eitsupi</a>,
<a href="https://github.com/gksmyth" target="_blank" rel="noopener">@gksmyth</a>,
<a href="https://github.com/hadley" target="_blank" rel="noopener">@hadley</a>,
<a href="https://github.com/jack-davison" target="_blank" rel="noopener">@jack-davison</a>,
<a href="https://github.com/jeroenjanssens" target="_blank" rel="noopener">@jeroenjanssens</a>,
<a href="https://github.com/lbm364dl" target="_blank" rel="noopener">@lbm364dl</a>,
<a href="https://github.com/lschneiderbauer" target="_blank" rel="noopener">@lschneiderbauer</a>,
<a href="https://github.com/mrcaseb" target="_blank" rel="noopener">@mrcaseb</a>,
<a href="https://github.com/pmarks" target="_blank" rel="noopener">@pmarks</a>,
<a href="https://github.com/PMassicotte" target="_blank" rel="noopener">@PMassicotte</a>,
<a href="https://github.com/r2evans" target="_blank" rel="noopener">@r2evans</a>,
<a href="https://github.com/RealTYPICAL" target="_blank" rel="noopener">@RealTYPICAL</a>,
<a href="https://github.com/tanho63" target="_blank" rel="noopener">@tanho63</a>,
<a href="https://github.com/thisisnic" target="_blank" rel="noopener">@thisisnic</a>,
<a href="https://github.com/torfason" target="_blank" rel="noopener">@torfason</a>,
<a href="https://github.com/TurnaevEvgeny" target="_blank" rel="noopener">@TurnaevEvgeny</a>,
<a href="https://github.com/Upipa" target="_blank" rel="noopener">@Upipa</a>,
<a href="https://github.com/vankesteren" target="_blank" rel="noopener">@vankesteren</a>,
<a href="https://github.com/vincentarelbundock" target="_blank" rel="noopener">@vincentarelbundock</a>,
<a href="https://github.com/wlandau" target="_blank" rel="noopener">@wlandau</a>,
<a href="https://github.com/YipengUva" target="_blank" rel="noopener">@YipengUva</a>, and
<a href="https://github.com/yutannihilation" target="_blank" rel="noopener">@yutannihilation</a>.</p>
]]></description>
      <enclosure url="https://opensource.posit.co/blog/2026-04-30_nanoparquet-0-5-1/featured.jpg" length="767877" type="image/jpeg" />
    </item>
    <item>
      <title>`dplyr::if_else()` and `dplyr::case_when()` are up to 30x faster</title>
      <link>https://opensource.posit.co/blog/2026-02-10_dplyr-performance/</link>
      <pubDate>Tue, 10 Feb 2026 00:00:00 +0000</pubDate>
      <guid>https://opensource.posit.co/blog/2026-02-10_dplyr-performance/</guid>
      <dc:creator>Davis Vaughan</dc:creator><description><![CDATA[<p>In this technical post, we&rsquo;ll dive into some performance improvements we&rsquo;ve made to dplyr 1.2.0 to make <a href="https://dplyr.tidyverse.org/reference/if_else.html" target="_blank" rel="noopener"><code>if_else()</code></a> and <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a> up to 30x faster and use up to 10x less memory.</p>
<p>If you haven&rsquo;t seen our <a href="https://opensource.posit.co/blog/2026-02-04_dplyr-1-2-0/">previous post</a> about the exciting new features in dplyr 1.2.0, you&rsquo;ll want to go check that out first!</p>
<p>Here&rsquo;s a before-and-after benchmark with <a href="https://dplyr.tidyverse.org/reference/if_else.html" target="_blank" rel="noopener"><code>if_else()</code></a>:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='c'># Using https://github.com/DavisVaughan/cross</span></span>
<span><span class='nf'>cross</span><span class='nf'>::</span><span class='nf'><a href='https://rdrr.io/pkg/cross/man/bench_versions.html'>bench_versions</a></span><span class='o'>(</span>pkgs <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"tidyverse/dplyr@v1.1.4"</span>, <span class='s'>"tidyverse/dplyr"</span><span class='o'>)</span>, <span class='o'>&#123;</span></span>
<span>  <span class='kr'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='o'>(</span><span class='nv'><a href='https://dplyr.tidyverse.org'>dplyr</a></span><span class='o'>)</span></span>
<span>  <span class='nf'><a href='https://rdrr.io/r/base/Random.html'>set.seed</a></span><span class='o'>(</span><span class='m'>123</span><span class='o'>)</span></span>
<span></span>
<span>  <span class='nv'>condition</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/sample.html'>sample</a></span><span class='o'>(</span><span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='kc'>TRUE</span>, <span class='kc'>FALSE</span>, <span class='kc'>NA</span><span class='o'>)</span>, size <span class='o'>=</span> <span class='m'>1e7</span>, replace <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span>  <span class='nv'>x</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/sample.html'>sample</a></span><span class='o'>(</span><span class='m'>10</span>, size <span class='o'>=</span> <span class='m'>1e7</span>, replace <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span>  <span class='nv'>y</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/sample.html'>sample</a></span><span class='o'>(</span><span class='m'>10</span>, size <span class='o'>=</span> <span class='m'>1e7</span>, replace <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span>  <span class='nv'>z</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/sample.html'>sample</a></span><span class='o'>(</span><span class='m'>10</span>, size <span class='o'>=</span> <span class='m'>1e7</span>, replace <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span></span>
<span>  <span class='nf'>bench</span><span class='nf'>::</span><span class='nf'><a href='https://bench.r-lib.org/reference/mark.html'>mark</a></span><span class='o'>(</span>if_else <span class='o'>=</span> <span class='nf'><a href='https://dplyr.tidyverse.org/reference/if_else.html'>if_else</a></span><span class='o'>(</span><span class='nv'>condition</span>, <span class='nv'>x</span>, <span class='nv'>y</span>, missing <span class='o'>=</span> <span class='nv'>z</span><span class='o'>)</span><span class='o'>)</span></span>
<span><span class='o'>&#125;</span><span class='o'>)</span></span></code></pre>
</div>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="c1">#&gt; # A tibble: 2 × 6</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt;   pkg                    expression      min   median `itr/sec` mem_alloc</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt;   &lt;chr&gt;                  &lt;bch:expr&gt; &lt;bch:tm&gt; &lt;bch:tm&gt;     &lt;dbl&gt; &lt;bch:byt&gt;</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 1 tidyverse/dplyr@v1.1.4 if_else    248.25ms 249.25ms      4.02   381.6MB</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 2 tidyverse/dplyr        if_else      7.27ms   7.51ms    132.      38.2MB</span></span></span></code></pre></div></div>
<p>And with <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a>:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nf'>cross</span><span class='nf'>::</span><span class='nf'><a href='https://rdrr.io/pkg/cross/man/bench_versions.html'>bench_versions</a></span><span class='o'>(</span>pkgs <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"tidyverse/dplyr@v1.1.4"</span>, <span class='s'>"tidyverse/dplyr"</span><span class='o'>)</span>, <span class='o'>&#123;</span></span>
<span>  <span class='kr'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='o'>(</span><span class='nv'><a href='https://dplyr.tidyverse.org'>dplyr</a></span><span class='o'>)</span></span>
<span>  <span class='nf'><a href='https://rdrr.io/r/base/Random.html'>set.seed</a></span><span class='o'>(</span><span class='m'>123</span><span class='o'>)</span></span>
<span></span>
<span>  <span class='nv'>column</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/sample.html'>sample</a></span><span class='o'>(</span><span class='m'>100</span>, size <span class='o'>=</span> <span class='m'>1e7</span>, replace <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span></span>
<span>  <span class='nv'>x_condition</span> <span class='o'>&lt;-</span> <span class='nv'>column</span> <span class='o'>&lt;</span> <span class='m'>20</span></span>
<span>  <span class='nv'>y_condition</span> <span class='o'>&lt;-</span> <span class='nv'>column</span> <span class='o'>&lt;</span> <span class='m'>50</span></span>
<span>  <span class='nv'>z_condition</span> <span class='o'>&lt;-</span> <span class='nv'>column</span> <span class='o'>&lt;</span> <span class='m'>80</span></span>
<span></span>
<span>  <span class='nv'>x</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/sample.html'>sample</a></span><span class='o'>(</span><span class='m'>10</span>, size <span class='o'>=</span> <span class='m'>1e7</span>, replace <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span>  <span class='nv'>y</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/sample.html'>sample</a></span><span class='o'>(</span><span class='m'>10</span>, size <span class='o'>=</span> <span class='m'>1e7</span>, replace <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span>  <span class='nv'>z</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/sample.html'>sample</a></span><span class='o'>(</span><span class='m'>10</span>, size <span class='o'>=</span> <span class='m'>1e7</span>, replace <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span></span>
<span>  <span class='nf'>bench</span><span class='nf'>::</span><span class='nf'><a href='https://bench.r-lib.org/reference/mark.html'>mark</a></span><span class='o'>(</span></span>
<span>    case_when <span class='o'>=</span> <span class='nf'><a href='https://dplyr.tidyverse.org/reference/case-and-replace-when.html'>case_when</a></span><span class='o'>(</span></span>
<span>      <span class='nv'>x_condition</span> <span class='o'>~</span> <span class='nv'>x</span>,</span>
<span>      <span class='nv'>y_condition</span> <span class='o'>~</span> <span class='nv'>y</span>,</span>
<span>      <span class='nv'>z_condition</span> <span class='o'>~</span> <span class='nv'>z</span></span>
<span>    <span class='o'>)</span></span>
<span>  <span class='o'>)</span></span>
<span><span class='o'>&#125;</span><span class='o'>)</span></span></code></pre>
</div>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="c1">#&gt; # A tibble: 2 × 6</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt;   pkg                    expression      min   median `itr/sec` mem_alloc</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt;   &lt;chr&gt;                  &lt;bch:expr&gt; &lt;bch:tm&gt; &lt;bch:tm&gt;     &lt;dbl&gt; &lt;bch:byt&gt;</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 1 tidyverse/dplyr@v1.1.4 case_when   228.3ms  231.2ms      4.33   419.9MB</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 2 tidyverse/dplyr        case_when    15.5ms   15.8ms     62.8     38.3MB</span></span></span></code></pre></div></div>
<p>So a 33x speed improvement for <a href="https://dplyr.tidyverse.org/reference/if_else.html" target="_blank" rel="noopener"><code>if_else()</code></a>, a 15x speed improvement for <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a>, and a 10x improvement in memory usage for both! In the rest of this post, we&rsquo;ll explain how we&rsquo;ve achieved these numbers.</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='kr'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='o'>(</span><span class='nv'><a href='https://dplyr.tidyverse.org'>dplyr</a></span><span class='o'>)</span></span></code></pre>
</div>
<h2 id="lets-talk-memory">Let&rsquo;s talk memory
</h2>
<p>We&rsquo;ll start with <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a>, because <a href="https://dplyr.tidyverse.org/reference/if_else.html" target="_blank" rel="noopener"><code>if_else()</code></a> is actually just a small variant of that.</p>
<p>The most important place to start is with the memory usage. Memory usage and raw speed are often related, as allocating memory takes time. Let&rsquo;s look at the memory usage of <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a> in dplyr 1.1.4:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nf'><a href='https://rdrr.io/r/base/Random.html'>set.seed</a></span><span class='o'>(</span><span class='m'>123</span><span class='o'>)</span></span>
<span></span>
<span><span class='nv'>column</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/sample.html'>sample</a></span><span class='o'>(</span><span class='m'>100</span>, size <span class='o'>=</span> <span class='m'>1e7</span>, replace <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span></span>
<span><span class='nv'>x_condition</span> <span class='o'>&lt;-</span> <span class='nv'>column</span> <span class='o'>&lt;</span> <span class='m'>20</span></span>
<span><span class='nv'>y_condition</span> <span class='o'>&lt;-</span> <span class='nv'>column</span> <span class='o'>&lt;</span> <span class='m'>50</span></span>
<span><span class='nv'>z_condition</span> <span class='o'>&lt;-</span> <span class='nv'>column</span> <span class='o'>&lt;</span> <span class='m'>80</span></span>
<span></span>
<span><span class='nv'>x</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/sample.html'>sample</a></span><span class='o'>(</span><span class='m'>10</span>, size <span class='o'>=</span> <span class='m'>1e7</span>, replace <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span><span class='nv'>y</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/sample.html'>sample</a></span><span class='o'>(</span><span class='m'>10</span>, size <span class='o'>=</span> <span class='m'>1e7</span>, replace <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span><span class='nv'>z</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/sample.html'>sample</a></span><span class='o'>(</span><span class='m'>10</span>, size <span class='o'>=</span> <span class='m'>1e7</span>, replace <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span></code></pre>
</div>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="n">profmem</span><span class="o">::</span><span class="nf">profmem</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">  <span class="n">threshold</span> <span class="o">=</span> <span class="m">1000</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="nf">case_when</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">x_condition</span> <span class="o">~</span> <span class="n">x</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="n">y_condition</span> <span class="o">~</span> <span class="n">y</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="n">z_condition</span> <span class="o">~</span> <span class="n">z</span>
</span></span><span class="line"><span class="cl">  <span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; Rprofmem memory profiling of:</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; case_when(x_condition ~ x, y_condition ~ y, z_condition ~ z)</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt;</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; Memory allocations (&gt;= 1000 bytes):</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt;        what     bytes                                           calls</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 1     alloc  40000048     case_when() -&gt; vec_case_when() -&gt; vec_rep()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 2     alloc  40000048                  case_when() -&gt; vec_case_when()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 3     alloc  40000056       case_when() -&gt; vec_case_when() -&gt; which()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 4     alloc   7600664       case_when() -&gt; vec_case_when() -&gt; which()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 5     alloc  40000048                  case_when() -&gt; vec_case_when()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 6     alloc  40000056       case_when() -&gt; vec_case_when() -&gt; which()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 7     alloc  12003312       case_when() -&gt; vec_case_when() -&gt; which()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 8     alloc  40000048                  case_when() -&gt; vec_case_when()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 9     alloc  40000056       case_when() -&gt; vec_case_when() -&gt; which()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 10    alloc  11996112       case_when() -&gt; vec_case_when() -&gt; which()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 11    alloc  40000056       case_when() -&gt; vec_case_when() -&gt; which()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 12    alloc   8400112       case_when() -&gt; vec_case_when() -&gt; which()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 13    alloc   7600664   case_when() -&gt; vec_case_when() -&gt; vec_slice()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 14    alloc  12003312   case_when() -&gt; vec_case_when() -&gt; vec_slice()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 15    alloc  11996112   case_when() -&gt; vec_case_when() -&gt; vec_slice()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 16    alloc   8400112 case_when() -&gt; vec_case_when() -&gt; vec_recycle()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 17    alloc  40000048 case_when() -&gt; vec_case_when() -&gt; list_unchop()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; total       440000864</span></span></span></code></pre></div></div>
<p>That&rsquo;s a lot of allocations! And it&rsquo;s pretty hard to understand where they are coming from without a bit more explanation. For that, we&rsquo;re actually going to &ldquo;manually&rdquo; implement an underpowered version of <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a> for this example.</p>
<p>Here&rsquo;s a diagram of what we need to accomplish:</p>
<p><div class="not-prose"><figure>
    <img class="h-auto max-w-full rounded-lg"
      src="https://opensource.posit.co/blog/2026-02-10_dplyr-performance/images/x-y-z-default.png"
      alt="" 
      loading="lazy"
    >
  </figure></div>
</p>
<p>In bullets:</p>
<ul>
<li><code>x_condition</code> selects the blue elements of <code>x</code></li>
<li><code>y_condition</code> selects the red elements of <code>y</code></li>
<li><code>z_condition</code> selects the green elements of <code>z</code></li>
<li>A <code>default</code> is built around the unused locations</li>
<li>We combine all of the pieces into <code>out</code></li>
</ul>
<p>The trickiest part about <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a> is handling places where <code>x_condition</code> and <code>y_condition</code> overlap. In the image, even though both <code>x</code> and <code>y</code> are selected at location 5, only the value of <code>x</code> is retained since it is hit &ldquo;first&rdquo;. This forces us to have to modify <code>y_condition</code> to avoid already &ldquo;used&rdquo; locations.</p>
<p>An R implementation that computes these modified locations might look like:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>n</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/length.html'>length</a></span><span class='o'>(</span><span class='nv'>x_condition</span><span class='o'>)</span></span>
<span></span>
<span><span class='nv'>unused</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/rep.html'>rep</a></span><span class='o'>(</span><span class='kc'>TRUE</span>, times <span class='o'>=</span> <span class='nv'>n</span><span class='o'>)</span> <span class='c'># 1</span></span>
<span></span>
<span><span class='nv'>x_loc</span> <span class='o'>&lt;-</span> <span class='nv'>unused</span> <span class='o'>&amp;</span> <span class='nv'>x_condition</span> <span class='c'># 2</span></span>
<span><span class='nv'>x_loc</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/which.html'>which</a></span><span class='o'>(</span><span class='nv'>x_loc</span><span class='o'>)</span> <span class='c'># 3,4</span></span>
<span><span class='nv'>unused</span><span class='o'>[</span><span class='nv'>x_loc</span><span class='o'>]</span> <span class='o'>&lt;-</span> <span class='kc'>FALSE</span></span>
<span></span>
<span><span class='nv'>y_loc</span> <span class='o'>&lt;-</span> <span class='nv'>unused</span> <span class='o'>&amp;</span> <span class='nv'>y_condition</span> <span class='c'># 5</span></span>
<span><span class='nv'>y_loc</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/which.html'>which</a></span><span class='o'>(</span><span class='nv'>y_loc</span><span class='o'>)</span> <span class='c'># 6,7</span></span>
<span><span class='nv'>unused</span><span class='o'>[</span><span class='nv'>y_loc</span><span class='o'>]</span> <span class='o'>&lt;-</span> <span class='kc'>FALSE</span></span>
<span></span>
<span><span class='nv'>z_loc</span> <span class='o'>&lt;-</span> <span class='nv'>unused</span> <span class='o'>&amp;</span> <span class='nv'>z_condition</span> <span class='c'># 8</span></span>
<span><span class='nv'>z_loc</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/which.html'>which</a></span><span class='o'>(</span><span class='nv'>z_loc</span><span class='o'>)</span> <span class='c'># 9,10</span></span>
<span><span class='nv'>unused</span><span class='o'>[</span><span class='nv'>z_loc</span><span class='o'>]</span> <span class='o'>&lt;-</span> <span class='kc'>FALSE</span></span></code></pre>
</div>
<p>Anything that is still <code>unused</code> falls through to the <code>default</code>:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>default</span> <span class='o'>&lt;-</span> <span class='kc'>NA_integer_</span></span>
<span><span class='nv'>default_loc</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/which.html'>which</a></span><span class='o'>(</span><span class='nv'>unused</span><span class='o'>)</span> <span class='c'># 11,12</span></span></code></pre>
</div>
<p>With <code>x_loc</code>, <code>y_loc</code>, <code>z_loc</code>, and <code>default_loc</code> in hand, we can build the output from the pieces:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>out</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/vector.html'>vector</a></span><span class='o'>(</span><span class='s'>"integer"</span>, length <span class='o'>=</span> <span class='nv'>n</span><span class='o'>)</span> <span class='c'># 17</span></span>
<span></span>
<span><span class='nv'>out</span><span class='o'>[</span><span class='nv'>x_loc</span><span class='o'>]</span> <span class='o'>&lt;-</span> <span class='nv'>x</span><span class='o'>[</span><span class='nv'>x_loc</span><span class='o'>]</span> <span class='c'># 13</span></span>
<span><span class='nv'>out</span><span class='o'>[</span><span class='nv'>y_loc</span><span class='o'>]</span> <span class='o'>&lt;-</span> <span class='nv'>y</span><span class='o'>[</span><span class='nv'>y_loc</span><span class='o'>]</span> <span class='c'># 14</span></span>
<span><span class='nv'>out</span><span class='o'>[</span><span class='nv'>z_loc</span><span class='o'>]</span> <span class='o'>&lt;-</span> <span class='nv'>z</span><span class='o'>[</span><span class='nv'>z_loc</span><span class='o'>]</span> <span class='c'># 15</span></span>
<span></span>
<span><span class='nv'>out</span><span class='o'>[</span><span class='nv'>default_loc</span><span class='o'>]</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/rep.html'>rep</a></span><span class='o'>(</span><span class='nv'>default</span>, times <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/length.html'>length</a></span><span class='o'>(</span><span class='nv'>default_loc</span><span class='o'>)</span><span class='o'>)</span> <span class='c'># 16</span></span></code></pre>
</div>
<p>And sure enough, this is identical to <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a>:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nf'><a href='https://rdrr.io/r/base/identical.html'>identical</a></span><span class='o'>(</span></span>
<span>  <span class='nv'>out</span>,</span>
<span>  <span class='nf'><a href='https://dplyr.tidyverse.org/reference/case-and-replace-when.html'>case_when</a></span><span class='o'>(</span></span>
<span>    <span class='nv'>x_condition</span> <span class='o'>~</span> <span class='nv'>x</span>,</span>
<span>    <span class='nv'>y_condition</span> <span class='o'>~</span> <span class='nv'>y</span>,</span>
<span>    <span class='nv'>z_condition</span> <span class='o'>~</span> <span class='nv'>z</span></span>
<span>  <span class='o'>)</span></span>
<span><span class='o'>)</span></span>
<span><span class='c'>#&gt; [1] TRUE</span></span>
<span></span></code></pre>
</div>
<p>You might be wondering what all of the comments with numbers beside them mean. Those actually map 1:1 with the allocations that <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a> was emitting. In fact, we can now split up those allocations into their respective role:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="c1">#&gt; # Tracking `unused` locations</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 1     alloc  40000048     case_when() -&gt; vec_case_when() -&gt; vec_rep()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; # Computing `x_loc`, `y_loc`, and `z_loc`</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 2     alloc  40000048                  case_when() -&gt; vec_case_when()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 3     alloc  40000056       case_when() -&gt; vec_case_when() -&gt; which()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 4     alloc   7600664       case_when() -&gt; vec_case_when() -&gt; which()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 5     alloc  40000048                  case_when() -&gt; vec_case_when()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 6     alloc  40000056       case_when() -&gt; vec_case_when() -&gt; which()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 7     alloc  12003312       case_when() -&gt; vec_case_when() -&gt; which()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 8     alloc  40000048                  case_when() -&gt; vec_case_when()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 9     alloc  40000056       case_when() -&gt; vec_case_when() -&gt; which()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 10    alloc  11996112       case_when() -&gt; vec_case_when() -&gt; which()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; # Computing `default_loc`</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 11    alloc  40000056       case_when() -&gt; vec_case_when() -&gt; which()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 12    alloc   8400112       case_when() -&gt; vec_case_when() -&gt; which()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; # Slicing `x`, `y`, and `z` to align with `x_loc`, `y_loc`, and `z_loc`</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 13    alloc   7600664   case_when() -&gt; vec_case_when() -&gt; vec_slice()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 14    alloc  12003312   case_when() -&gt; vec_case_when() -&gt; vec_slice()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 15    alloc  11996112   case_when() -&gt; vec_case_when() -&gt; vec_slice()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; # Recycling `default` of `NA` to align with `default_loc`</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 16    alloc   8400112 case_when() -&gt; vec_case_when() -&gt; vec_recycle()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; # Final output container, which we assign `x`, `y`, `z`, and `default` into</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; # at locations `x_loc`, `y_loc`, and `z_loc`</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 17    alloc  40000048 case_when() -&gt; vec_case_when() -&gt; list_unchop()</span></span></span></code></pre></div></div>
<p>We sought to remove every one of these allocations except for the last one, which is the final output container that is returned to the user. In other words, we were after this, which is the actual profmem result of this <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a> call in dplyr 1.2.0:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="c1">#&gt; Rprofmem memory profiling of:</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; case_when(x_condition ~ x, y_condition ~ y, z_condition ~ z)</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt;</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; Memory allocations (&gt;= 1000 bytes):</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt;        what    bytes                          calls</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 1     alloc 40000048 case_when() -&gt; vec_case_when()</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; total       40000048</span></span></span></code></pre></div></div>
<h2 id="sliced-assignment">Sliced assignment
</h2>
<p>To work towards this, let&rsquo;s focus on what happens to <code>x</code> throughout this process:</p>
<p><div class="not-prose"><figure>
    <img class="h-auto max-w-full rounded-lg"
      src="https://opensource.posit.co/blog/2026-02-10_dplyr-performance/images/just-x.png"
      alt="" 
      loading="lazy"
    >
  </figure></div>
</p>
<p>We had a hypothesis that we could cut out the intermediate work here. Ideally, we&rsquo;d take the logical LHS <code>x_condition</code> and the RHS <code>x</code> and map that straight into the output, with no extra allocations:</p>
<p><div class="not-prose"><figure>
    <img class="h-auto max-w-full rounded-lg"
      src="https://opensource.posit.co/blog/2026-02-10_dplyr-performance/images/just-x-ideal.png"
      alt="" 
      loading="lazy"
    >
  </figure></div>
</p>
<p>But this just wasn&rsquo;t possible with the way that assignment typically works in R!</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>x</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"a"</span>, <span class='s'>"b"</span>, <span class='s'>"c"</span>, <span class='s'>"d"</span>, <span class='s'>"e"</span>, <span class='s'>"f"</span>, <span class='s'>"g"</span><span class='o'>)</span></span>
<span><span class='nv'>x_condition</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='kc'>FALSE</span>, <span class='kc'>TRUE</span>, <span class='kc'>FALSE</span>, <span class='kc'>FALSE</span>, <span class='kc'>TRUE</span>, <span class='kc'>FALSE</span>, <span class='kc'>FALSE</span><span class='o'>)</span></span>
<span><span class='nv'>out</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/vector.html'>vector</a></span><span class='o'>(</span><span class='s'>"character"</span>, length <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/length.html'>length</a></span><span class='o'>(</span><span class='nv'>x_condition</span><span class='o'>)</span><span class='o'>)</span></span>
<span></span>
<span><span class='nv'>out</span><span class='o'>[</span><span class='nv'>x_condition</span><span class='o'>]</span> <span class='o'>&lt;-</span> <span class='nv'>x</span></span>
<span><span class='c'>#&gt; Warning in out[x_condition] &lt;- x: number of items to replace is not a multiple of replacement length</span></span>
<span></span></code></pre>
</div>
<p>Instead, you must pre-slice <code>x</code> to a length that matches the locations that <code>x_condition</code> points to in <code>out</code>, i.e.:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>out</span><span class='o'>[</span><span class='nv'>x_condition</span><span class='o'>]</span> <span class='o'>&lt;-</span> <span class='nv'>x</span><span class='o'>[</span><span class='nv'>x_condition</span><span class='o'>]</span></span></code></pre>
</div>
<p>Now, in <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a> we don&rsquo;t actually use <code>[&lt;-</code> for assignment or <code>[</code> for slicing. Instead, we use tools from <a href="https://vctrs.r-lib.org/" target="_blank" rel="noopener">vctrs</a>, a low level package for building consistent tidyverse functions. In this case, we&rsquo;d use <code>vctrs::vec_assign()</code> and <code>vctrs::vec_slice()</code>:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>out</span> <span class='o'>&lt;-</span> <span class='nf'>vctrs</span><span class='nf'>::</span><span class='nf'><a href='https://vctrs.r-lib.org/reference/vec_slice.html'>vec_assign</a></span><span class='o'>(</span><span class='nv'>out</span>, <span class='nv'>x_condition</span>, <span class='nf'>vctrs</span><span class='nf'>::</span><span class='nf'><a href='https://vctrs.r-lib.org/reference/vec_slice.html'>vec_slice</a></span><span class='o'>(</span><span class='nv'>x</span>, <span class='nv'>x_condition</span><span class='o'>)</span><span class='o'>)</span></span></code></pre>
</div>
<p>But <code>vec_assign()</code> had the same problem!</p>
<p>To solve this, we&rsquo;ve added a new boolean argument to <code>vec_assign()</code> called <code>slice_value</code>. You use it like this:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>out</span> <span class='o'>&lt;-</span> <span class='nf'>vctrs</span><span class='nf'>::</span><span class='nf'><a href='https://vctrs.r-lib.org/reference/vec_slice.html'>vec_assign</a></span><span class='o'>(</span><span class='nv'>out</span>, <span class='nv'>x_condition</span>, <span class='nv'>x</span>, slice_value <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span></code></pre>
</div>
<p>With <code>slice_value = TRUE</code>, <code>vec_assign()</code> assumes that both <code>out</code> and <code>x</code> are the same length and that <code>x_condition</code> applies to <em>both</em> of these. Internally, rather than materializing <code>x[x_condition]</code>, we instead just loop over both <code>out</code> and <code>x</code> at the same time (at C level) and copy over values from <code>x</code> whenever <code>x_condition</code> is <code>TRUE</code>.</p>
<p>This is huge! It means that allocations 13-15 from above related to slicing <code>x</code>, <code>y</code>, and <code>z</code> all disappear.</p>
<h2 id="logical-indices">Logical <code>i</code>ndices
</h2>
<p>You might have noticed that we&rsquo;ve been using <code>which()</code> quite a bit in the above algorithm. This turns a logical vector of <code>TRUE</code> and <code>FALSE</code> into an integer vector of locations pointing to where the logical vector was <code>TRUE</code>:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>x_condition</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='kc'>TRUE</span>, <span class='kc'>FALSE</span>, <span class='kc'>TRUE</span>, <span class='kc'>FALSE</span>, <span class='kc'>FALSE</span>, <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span><span class='nv'>x_loc</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/which.html'>which</a></span><span class='o'>(</span><span class='nv'>x_condition</span><span class='o'>)</span></span>
<span><span class='nv'>x_loc</span></span>
<span><span class='c'>#&gt; [1] 1 3 6</span></span>
<span></span></code></pre>
</div>
<p>We perform this conversion up front due to how the following works at C level:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>out</span><span class='o'>[</span><span class='nv'>x_condition</span><span class='o'>]</span> <span class='o'>&lt;-</span> <span class='nv'>x</span><span class='o'>[</span><span class='nv'>x_condition</span><span class='o'>]</span></span></code></pre>
</div>
<p>Both <code>[</code> and <code>[&lt;-</code> will convert a logical <code>x_condition</code> into the integer <code>x_loc</code> form before proceeding with the assignment, meaning that <code>which()</code> gets called twice if we don&rsquo;t do it once up front. And vctrs is the same way! Both <code>vec_assign()</code> and <code>vec_slice()</code> here would convert <code>x_condition</code> to an integer vector.</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nf'>vctrs</span><span class='nf'>::</span><span class='nf'><a href='https://vctrs.r-lib.org/reference/vec_slice.html'>vec_assign</a></span><span class='o'>(</span><span class='nv'>out</span>, <span class='nv'>x_condition</span>, <span class='nf'>vctrs</span><span class='nf'>::</span><span class='nf'><a href='https://vctrs.r-lib.org/reference/vec_slice.html'>vec_slice</a></span><span class='o'>(</span><span class='nv'>x</span>, <span class='nv'>x_condition</span><span class='o'>)</span><span class='o'>)</span></span></code></pre>
</div>
<p>Now, with the previous optimization we&rsquo;ve already seen that we can reduce this to:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nf'>vctrs</span><span class='nf'>::</span><span class='nf'><a href='https://vctrs.r-lib.org/reference/vec_slice.html'>vec_assign</a></span><span class='o'>(</span><span class='nv'>out</span>, <span class='nv'>x_condition</span>, <span class='nv'>x</span>, slice_value <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span></code></pre>
</div>
<p>But <code>vec_assign()</code> still converts a logical <code>x_condition</code> to integer locations internally before doing the assignment. So now it doesn&rsquo;t matter whether we do this conversion up front via <code>which()</code> or if we let <code>vec_assign()</code> do it, it still happens once per input. But we&rsquo;d like to avoid it entirely!</p>
<p>The solution here wasn&rsquo;t too magical, it just involved a good bit of grunt work. We&rsquo;ve added a path in <code>vec_assign()</code>&rsquo;s <a href="https://github.com/r-lib/vctrs/blob/94cea16b1ed3939aaa59c58dda75eedc75d6d075/src/slice-assign.c#L390-L417" target="_blank" rel="noopener">C code</a> that can handle logical indices like <code>x_condition</code> directly, rather than forcing them to be converted to integer locations first.</p>
<p>But this is a huge win, because it means that allocations 1-10, which were all related to <a href="https://rdrr.io/r/base/which.html" target="_blank" rel="noopener"><code>which()</code></a>, can now be removed. <code>vec_assign()</code> will just handle that optimally for us without any extra allocations.</p>
<p>The nice part about an optimization like this is that any other existing code that is using <code>vec_assign()</code> with a logical index will also benefit from this without having to change a thing!</p>
<h2 id="default-handling"><code>default</code> handling
</h2>
<p>The remaining allocations are 11-12 and 16, which all have to do with the implied <code>default</code>. Allocations 11-12 were about figuring out where to put <code>default</code>, and allocation 16 was about recycling a typed size 1 <code>default</code> to the right size before assigning it into <code>out</code>.</p>
<p>As it turns out, we don&rsquo;t need any of this!</p>
<p>In vctrs, when we initialize any output container, we use <code>vec_init()</code>:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nf'>vctrs</span><span class='nf'>::</span><span class='nf'><a href='https://vctrs.r-lib.org/reference/vec_init.html'>vec_init</a></span><span class='o'>(</span><span class='nf'><a href='https://rdrr.io/r/base/integer.html'>integer</a></span><span class='o'>(</span><span class='o'>)</span>, n <span class='o'>=</span> <span class='m'>5</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; [1] NA NA NA NA NA</span></span>
<span></span><span></span>
<span><span class='nf'>vctrs</span><span class='nf'>::</span><span class='nf'><a href='https://vctrs.r-lib.org/reference/vec_init.html'>vec_init</a></span><span class='o'>(</span><span class='nf'><a href='https://tibble.tidyverse.org/reference/tibble.html'>tibble</a></span><span class='o'>(</span>x <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/integer.html'>integer</a></span><span class='o'>(</span><span class='o'>)</span>, y <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/character.html'>character</a></span><span class='o'>(</span><span class='o'>)</span><span class='o'>)</span>, n <span class='o'>=</span> <span class='m'>5</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># A tibble: 5 × 2</span></span></span>
<span><span class='c'>#&gt;       x y    </span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;int&gt;</span> <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span>    <span style='color: #BB0000;'>NA</span> <span style='color: #BB0000;'>NA</span>   </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>2</span>    <span style='color: #BB0000;'>NA</span> <span style='color: #BB0000;'>NA</span>   </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>3</span>    <span style='color: #BB0000;'>NA</span> <span style='color: #BB0000;'>NA</span>   </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>4</span>    <span style='color: #BB0000;'>NA</span> <span style='color: #BB0000;'>NA</span>   </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>5</span>    <span style='color: #BB0000;'>NA</span> <span style='color: #BB0000;'>NA</span></span></span>
<span></span></code></pre>
</div>
<p>This <em>already</em> has the implied <code>default</code> assigned to every location. We then overwrite this with <code>x</code>, <code>y</code>, and <code>z</code> at the appropriate locations, but anything left untouched by those is still set to the <code>default</code>, so we&rsquo;re done!</p>
<p>For cases where the user supplies their own <code>default</code>, things are slightly more complicated. We actually do have to compute a <code>default_loc</code> implied from <code>x_condition</code>, <code>y_condition</code>, and <code>z_condition</code>, but internally we do so using a C vector of <code>bool</code> (even more efficient than R&rsquo;s logical vector type), so the memory footprint is as small as it can be.</p>
<h2 id="the-first-wins-conundrum">The &ldquo;first wins&rdquo; conundrum
</h2>
<p>One thing we&rsquo;ve skipped over is the &ldquo;first wins&rdquo; behavior of <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a> mentioned earlier. Now that we&rsquo;ve removed <code>x_loc</code>, <code>y_loc</code>, and <code>z_loc</code>, which is where that was being handled, how do we keep this behavior without slowing things down?</p>
<p>To be explicit, we are talking about this feature of <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a> where only the first hit is kept when you have overlapping logical indices:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>x</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"x1"</span>, <span class='s'>"x2"</span>, <span class='s'>"x3"</span><span class='o'>)</span></span>
<span><span class='nv'>y</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"y1"</span>, <span class='s'>"y2"</span>, <span class='s'>"y3"</span><span class='o'>)</span></span>
<span><span class='nv'>z</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"z1"</span>, <span class='s'>"z2"</span>, <span class='s'>"z3"</span><span class='o'>)</span></span>
<span></span>
<span><span class='nv'>x_condition</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='kc'>TRUE</span>, <span class='kc'>FALSE</span>, <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span><span class='nv'>y_condition</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='kc'>TRUE</span>, <span class='kc'>TRUE</span>, <span class='kc'>FALSE</span><span class='o'>)</span></span>
<span><span class='nv'>z_condition</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='kc'>FALSE</span>, <span class='kc'>TRUE</span>, <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span></span>
<span><span class='nf'><a href='https://dplyr.tidyverse.org/reference/case-and-replace-when.html'>case_when</a></span><span class='o'>(</span></span>
<span>  <span class='nv'>x_condition</span> <span class='o'>~</span> <span class='nv'>x</span>,</span>
<span>  <span class='nv'>y_condition</span> <span class='o'>~</span> <span class='nv'>y</span>,</span>
<span>  <span class='nv'>z_condition</span> <span class='o'>~</span> <span class='nv'>z</span></span>
<span><span class='o'>)</span></span>
<span><span class='c'>#&gt; [1] "x1" "y2" "x3"</span></span>
<span></span></code></pre>
</div>
<p>A naive approach doesn&rsquo;t work, as you end up with &ldquo;last wins&rdquo; behavior:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>out</span> <span class='o'>&lt;-</span> <span class='nf'>vctrs</span><span class='nf'>::</span><span class='nf'><a href='https://vctrs.r-lib.org/reference/vec_init.html'>vec_init</a></span><span class='o'>(</span><span class='nf'><a href='https://rdrr.io/r/base/character.html'>character</a></span><span class='o'>(</span><span class='o'>)</span>, n <span class='o'>=</span> <span class='m'>3</span><span class='o'>)</span></span>
<span></span>
<span><span class='nv'>out</span> <span class='o'>&lt;-</span> <span class='nf'>vctrs</span><span class='nf'>::</span><span class='nf'><a href='https://vctrs.r-lib.org/reference/vec_slice.html'>vec_assign</a></span><span class='o'>(</span><span class='nv'>out</span>, <span class='nv'>x_condition</span>, <span class='nv'>x</span>, slice_value <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span><span class='nv'>out</span> <span class='o'>&lt;-</span> <span class='nf'>vctrs</span><span class='nf'>::</span><span class='nf'><a href='https://vctrs.r-lib.org/reference/vec_slice.html'>vec_assign</a></span><span class='o'>(</span><span class='nv'>out</span>, <span class='nv'>y_condition</span>, <span class='nv'>y</span>, slice_value <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span><span class='nv'>out</span> <span class='o'>&lt;-</span> <span class='nf'>vctrs</span><span class='nf'>::</span><span class='nf'><a href='https://vctrs.r-lib.org/reference/vec_slice.html'>vec_assign</a></span><span class='o'>(</span><span class='nv'>out</span>, <span class='nv'>z_condition</span>, <span class='nv'>z</span>, slice_value <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span></span>
<span><span class='c'># This is wrong!</span></span>
<span><span class='nv'>out</span></span>
<span><span class='c'>#&gt; [1] "y1" "z2" "z3"</span></span>
<span></span><span></span>
<span><span class='nf'><a href='https://rdrr.io/r/base/identical.html'>identical</a></span><span class='o'>(</span></span>
<span>  <span class='nv'>out</span>,</span>
<span>  <span class='nf'><a href='https://dplyr.tidyverse.org/reference/case-and-replace-when.html'>case_when</a></span><span class='o'>(</span></span>
<span>    <span class='nv'>x_condition</span> <span class='o'>~</span> <span class='nv'>x</span>,</span>
<span>    <span class='nv'>y_condition</span> <span class='o'>~</span> <span class='nv'>y</span>,</span>
<span>    <span class='nv'>z_condition</span> <span class='o'>~</span> <span class='nv'>z</span></span>
<span>  <span class='o'>)</span></span>
<span><span class='o'>)</span></span>
<span><span class='c'>#&gt; [1] FALSE</span></span>
<span></span></code></pre>
</div>
<p>Instead, <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a> just <em>iterates in reverse</em>, assigning <code>z</code>, then <code>y</code>, then <code>x</code>:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>out</span> <span class='o'>&lt;-</span> <span class='nf'>vctrs</span><span class='nf'>::</span><span class='nf'><a href='https://vctrs.r-lib.org/reference/vec_init.html'>vec_init</a></span><span class='o'>(</span><span class='nf'><a href='https://rdrr.io/r/base/character.html'>character</a></span><span class='o'>(</span><span class='o'>)</span>, n <span class='o'>=</span> <span class='m'>3</span><span class='o'>)</span></span>
<span></span>
<span><span class='nv'>out</span> <span class='o'>&lt;-</span> <span class='nf'>vctrs</span><span class='nf'>::</span><span class='nf'><a href='https://vctrs.r-lib.org/reference/vec_slice.html'>vec_assign</a></span><span class='o'>(</span><span class='nv'>out</span>, <span class='nv'>z_condition</span>, <span class='nv'>z</span>, slice_value <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span><span class='nv'>out</span> <span class='o'>&lt;-</span> <span class='nf'>vctrs</span><span class='nf'>::</span><span class='nf'><a href='https://vctrs.r-lib.org/reference/vec_slice.html'>vec_assign</a></span><span class='o'>(</span><span class='nv'>out</span>, <span class='nv'>y_condition</span>, <span class='nv'>y</span>, slice_value <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span><span class='nv'>out</span> <span class='o'>&lt;-</span> <span class='nf'>vctrs</span><span class='nf'>::</span><span class='nf'><a href='https://vctrs.r-lib.org/reference/vec_slice.html'>vec_assign</a></span><span class='o'>(</span><span class='nv'>out</span>, <span class='nv'>x_condition</span>, <span class='nv'>x</span>, slice_value <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span></span>
<span><span class='nf'><a href='https://rdrr.io/r/base/identical.html'>identical</a></span><span class='o'>(</span></span>
<span>  <span class='nv'>out</span>,</span>
<span>  <span class='nf'><a href='https://dplyr.tidyverse.org/reference/case-and-replace-when.html'>case_when</a></span><span class='o'>(</span></span>
<span>    <span class='nv'>x_condition</span> <span class='o'>~</span> <span class='nv'>x</span>,</span>
<span>    <span class='nv'>y_condition</span> <span class='o'>~</span> <span class='nv'>y</span>,</span>
<span>    <span class='nv'>z_condition</span> <span class='o'>~</span> <span class='nv'>z</span></span>
<span>  <span class='o'>)</span></span>
<span><span class='o'>)</span></span>
<span><span class='c'>#&gt; [1] TRUE</span></span>
<span></span></code></pre>
</div>
<p>This diagram demonstrates how that works:</p>
<p><div class="not-prose"><figure>
    <img class="h-auto max-w-full rounded-lg"
      src="https://opensource.posit.co/blog/2026-02-10_dplyr-performance/images/case-when-reverse.png"
      alt="" 
      loading="lazy"
    >
  </figure></div>
</p>
<h2 id="optimizing-speed">Optimizing speed?
</h2>
<p>Now that we&rsquo;ve optimized the memory usage of <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a>, you might be wondering if we did anything else to specifically optimize its speed. Not really! We have moved everything from R to C, but focusing our efforts on reducing memory also resulted in some pretty performant code, and there wasn&rsquo;t much left to optimize after that.</p>
<h2 id="if_else"><code>if_else()</code>
</h2>
<p><a href="https://dplyr.tidyverse.org/reference/if_else.html" target="_blank" rel="noopener"><code>if_else()</code></a> can actually be written as a form of <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a>:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nf'><a href='https://dplyr.tidyverse.org/reference/if_else.html'>if_else</a></span><span class='o'>(</span><span class='nv'>condition</span>, <span class='nv'>true</span>, <span class='nv'>false</span>, <span class='nv'>missing</span><span class='o'>)</span></span>
<span></span>
<span><span class='nf'><a href='https://dplyr.tidyverse.org/reference/case-and-replace-when.html'>case_when</a></span><span class='o'>(</span></span>
<span>  <span class='nv'>condition</span> <span class='o'>~</span> <span class='nv'>true</span>,</span>
<span>  <span class='o'>!</span><span class='nv'>condition</span> <span class='o'>~</span> <span class='nv'>false</span>,</span>
<span>  <span class='nf'><a href='https://rdrr.io/r/base/NA.html'>is.na</a></span><span class='o'>(</span><span class='nv'>condition</span><span class='o'>)</span> <span class='o'>~</span> <span class='nv'>missing</span></span>
<span><span class='o'>)</span></span></code></pre>
</div>
<p>In our actual C implementation of <a href="https://dplyr.tidyverse.org/reference/if_else.html" target="_blank" rel="noopener"><code>if_else()</code></a>, for simple types like integer, character, or numeric vectors we have an <a href="https://github.com/r-lib/vctrs/blob/94cea16b1ed3939aaa59c58dda75eedc75d6d075/src/if-else.c#L276-L505" target="_blank" rel="noopener">extremely fast path</a> that&rsquo;s even more optimized than this, but for anything with a class we pretty much use this exact <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a> approach.</p>
<h2 id="for-package-developers">For package developers
</h2>
<p>If you&rsquo;re a package developer, you&rsquo;ll be happy to know that vctrs itself now exposes low dependency versions of <a href="https://dplyr.tidyverse.org/reference/if_else.html" target="_blank" rel="noopener"><code>if_else()</code></a> and <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a>, here&rsquo;s the full family:</p>
<ul>
<li><code>vec_if_else()</code></li>
<li><code>vec_case_when()</code></li>
<li><code>vec_replace_when()</code></li>
<li><code>vec_recode_values()</code></li>
<li><code>vec_replace_values()</code></li>
</ul>
<p><a href="https://dplyr.tidyverse.org/reference/if_else.html" target="_blank" rel="noopener"><code>dplyr::if_else()</code></a> and friends are now just very thin wrappers over these. Feel free to use the vctrs versions in your package if you need the consistency of the tidyverse without the heavy-ish dependency of dplyr.</p>
<h2 id="at-the-deepest-level-list_combine">At the deepest level, <code>list_combine()</code>
</h2>
<p>At the deepest level of all of this is one final new vctrs function, <code>list_combine()</code>. This is a flexible way to combine multiple vectors together at locations specified by <code>indices</code>.</p>
<p><code>list_combine()</code> powers all of <code>vec_case_when()</code>, <code>vec_replace_when()</code>, <code>vec_recode_values()</code>, <code>vec_replace_values()</code>, <code>vec_if_else()</code>, and even <code>vec_c()</code>, the tidyverse version of <a href="https://rdrr.io/r/base/c.html" target="_blank" rel="noopener"><code>c()</code></a>.</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nf'><a href='https://rdrr.io/r/base/Random.html'>set.seed</a></span><span class='o'>(</span><span class='m'>123</span><span class='o'>)</span></span>
<span></span>
<span><span class='nv'>column</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/sample.html'>sample</a></span><span class='o'>(</span><span class='m'>100</span>, size <span class='o'>=</span> <span class='m'>1e7</span>, replace <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span></span>
<span><span class='nv'>x_condition</span> <span class='o'>&lt;-</span> <span class='nv'>column</span> <span class='o'>&lt;</span> <span class='m'>20</span></span>
<span><span class='nv'>y_condition</span> <span class='o'>&lt;-</span> <span class='nv'>column</span> <span class='o'>&lt;</span> <span class='m'>50</span></span>
<span><span class='nv'>z_condition</span> <span class='o'>&lt;-</span> <span class='nv'>column</span> <span class='o'>&lt;</span> <span class='m'>80</span></span>
<span></span>
<span><span class='nv'>x</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/sample.html'>sample</a></span><span class='o'>(</span><span class='m'>10</span>, size <span class='o'>=</span> <span class='m'>1e7</span>, replace <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span><span class='nv'>y</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/sample.html'>sample</a></span><span class='o'>(</span><span class='m'>10</span>, size <span class='o'>=</span> <span class='m'>1e7</span>, replace <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span><span class='nv'>z</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/sample.html'>sample</a></span><span class='o'>(</span><span class='m'>10</span>, size <span class='o'>=</span> <span class='m'>1e7</span>, replace <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span></span>
<span><span class='nv'>out</span> <span class='o'>&lt;-</span> <span class='nf'>vctrs</span><span class='nf'>::</span><span class='nf'><a href='https://vctrs.r-lib.org/reference/list_combine.html'>list_combine</a></span><span class='o'>(</span></span>
<span>  x <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='o'>(</span><span class='nv'>x</span>, <span class='nv'>y</span>, <span class='nv'>z</span><span class='o'>)</span>,</span>
<span></span>
<span>  <span class='c'># `indices` are allowed to be logical and aren't forced to integer</span></span>
<span>  indices <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='o'>(</span><span class='nv'>x_condition</span>, <span class='nv'>y_condition</span>, <span class='nv'>z_condition</span><span class='o'>)</span>,</span>
<span>  size <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/length.html'>length</a></span><span class='o'>(</span><span class='nv'>x_condition</span><span class='o'>)</span>,</span>
<span></span>
<span>  <span class='c'># When there are overlaps, take the "first"</span></span>
<span>  multiple <span class='o'>=</span> <span class='s'>"first"</span>,</span>
<span></span>
<span>  <span class='c'># Same as `slice_value` from `vec_assign()`</span></span>
<span>  slice_x <span class='o'>=</span> <span class='kc'>TRUE</span></span>
<span><span class='o'>)</span></span></code></pre>
</div>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nf'><a href='https://rdrr.io/r/base/identical.html'>identical</a></span><span class='o'>(</span></span>
<span>  <span class='nv'>out</span>,</span>
<span>  <span class='nf'><a href='https://dplyr.tidyverse.org/reference/case-and-replace-when.html'>case_when</a></span><span class='o'>(</span></span>
<span>    <span class='nv'>x_condition</span> <span class='o'>~</span> <span class='nv'>x</span>,</span>
<span>    <span class='nv'>y_condition</span> <span class='o'>~</span> <span class='nv'>y</span>,</span>
<span>    <span class='nv'>z_condition</span> <span class='o'>~</span> <span class='nv'>z</span></span>
<span>  <span class='o'>)</span></span>
<span><span class='o'>)</span></span>
<span><span class='c'>#&gt; [1] TRUE</span></span>
<span></span></code></pre>
</div>
]]></description>
      <enclosure url="https://opensource.posit.co/blog/2026-02-10_dplyr-performance/thumbnail-wd.jpg" length="179655" type="image/jpeg" />
    </item>
    <item>
      <title>dplyr 1.2.0</title>
      <link>https://opensource.posit.co/blog/2026-02-04_dplyr-1-2-0/</link>
      <pubDate>Wed, 04 Feb 2026 00:00:00 +0000</pubDate>
      <guid>https://opensource.posit.co/blog/2026-02-04_dplyr-1-2-0/</guid>
      <dc:creator>Davis Vaughan</dc:creator><description><![CDATA[<p><a href="https://dplyr.tidyverse.org" target="_blank" rel="noopener">dplyr 1.2.0</a> is out now! This large release of dplyr comes with two sets of exciting features:</p>
<ul>
<li>
<p><a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter_out()</code></a>, the missing complement to <a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter()</code></a>, and accompanying <a href="https://dplyr.tidyverse.org/reference/when-any-all.html" target="_blank" rel="noopener"><code>when_any()</code></a> and <a href="https://dplyr.tidyverse.org/reference/when-any-all.html" target="_blank" rel="noopener"><code>when_all()</code></a> helpers.</p>
</li>
<li>
<p><a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>recode_values()</code></a>, <a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>replace_values()</code></a>, and <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>replace_when()</code></a>, three new functions that join <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a> to create a cohesive family of powerful tools for recoding and replacing.</p>
</li>
</ul>
<p>Both of these sets of features are backed by successful <em>tidyups</em>, the tidyverse&rsquo;s community facing proposal process (<a href="https://github.com/tidyverse/tidyups/pull/30" target="_blank" rel="noopener">filtering</a>, <a href="https://github.com/tidyverse/tidyups/pull/29" target="_blank" rel="noopener">recoding</a>). We really enjoyed having the community weigh in on these features!</p>
<p>You can install dplyr 1.2.0 from CRAN with:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nf'><a href='https://rdrr.io/r/utils/install.packages.html'>install.packages</a></span><span class='o'>(</span><span class='s'>"dplyr"</span><span class='o'>)</span></span></code></pre>
</div>
<p>You can see a full list of changes in the <a href="https://github.com/tidyverse/dplyr/releases/tag/v1.2.0" target="_blank" rel="noopener">release notes</a>.</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='kr'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='o'>(</span><span class='nv'><a href='https://dplyr.tidyverse.org'>dplyr</a></span><span class='o'>)</span></span></code></pre>
</div>
<h2 id="expanding-the-filter-family">Expanding the <code>filter()</code> family
</h2>
<p><a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter()</code></a> has been a core dplyr verb since the very beginning, but over the years we&rsquo;ve isolated a few key issues with it:</p>
<ul>
<li>
<p>The name <a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter()</code></a> is ambiguous, are you keeping or dropping rows? i.e., are you filtering <em>for</em> rows or filtering <em>out</em> rows?</p>
</li>
<li>
<p><a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter()</code></a> is optimized for the case of <em>keeping</em> rows, but you are just as likely to try and use it for <em>dropping</em> rows. Using <a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter()</code></a> to drop rows quickly forces you to confront complex boolean logic and explicitly handle missing values, which is difficult to teach, error prone to write, and hard to understand when you come back to it in the future.</p>
</li>
<li>
<p><a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter()</code></a> combines comma separated conditions with <code>&amp;</code> because this covers the majority of the cases. But if you&rsquo;d like to combine conditions with <code>|</code>, then you have to introduce parentheses around your conditions and combine them into one large condition separated by <code>|</code>, reducing readability.</p>
</li>
</ul>
<p>In the next few sections, we&rsquo;ll motivate these issues and discuss how some new features in dplyr can simplify things dramatically!</p>
<h3 id="filteringout">Filtering&hellip;out!
</h3>
<p>Take a look at this <code>patients</code> data. Our task with this data is:</p>
<blockquote>
<p><em>Filter out</em> rows where the patient is deceased <em>and</em> the year was before 2012.</p>
</blockquote>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>patients</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://tibble.tidyverse.org/reference/tibble.html'>tibble</a></span><span class='o'>(</span></span>
<span>  name <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"Anne"</span>, <span class='s'>"Mark"</span>, <span class='s'>"Sarah"</span>, <span class='s'>"Davis"</span>, <span class='s'>"Max"</span>, <span class='s'>"Derek"</span>, <span class='s'>"Tina"</span><span class='o'>)</span>,</span>
<span>  deceased <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='kc'>FALSE</span>, <span class='kc'>TRUE</span>, <span class='kc'>NA</span>, <span class='kc'>TRUE</span>, <span class='kc'>NA</span>, <span class='kc'>FALSE</span>, <span class='kc'>TRUE</span><span class='o'>)</span>,</span>
<span>  date <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='m'>2005</span>, <span class='m'>2010</span>, <span class='kc'>NA</span>, <span class='m'>2020</span>, <span class='m'>2010</span>, <span class='kc'>NA</span>, <span class='kc'>NA</span><span class='o'>)</span></span>
<span><span class='o'>)</span></span>
<span></span>
<span><span class='nv'>patients</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># A tibble: 7 × 3</span></span></span>
<span><span class='c'>#&gt;   name  deceased  date</span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span> <span style='color: #555555; font-style: italic;'>&lt;lgl&gt;</span>    <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span> Anne  FALSE     <span style='text-decoration: underline;'>2</span>005</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>2</span> Mark  TRUE      <span style='text-decoration: underline;'>2</span>010</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>3</span> Sarah <span style='color: #BB0000;'>NA</span>          <span style='color: #BB0000;'>NA</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>4</span> Davis TRUE      <span style='text-decoration: underline;'>2</span>020</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>5</span> Max   <span style='color: #BB0000;'>NA</span>        <span style='text-decoration: underline;'>2</span>010</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>6</span> Derek FALSE       <span style='color: #BB0000;'>NA</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>7</span> Tina  TRUE        <span style='color: #BB0000;'>NA</span></span></span>
<span></span></code></pre>
</div>
<p>With <a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter()</code></a>, you&rsquo;d probably start by translating &ldquo;patient is deceased and the year was before 2012&rdquo; into <code>deceased &amp; date &lt; 2012</code>, and then inverting that with <code>!(&lt;expression&gt;)</code> to drop rows:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>patients</span> <span class='o'>|&gt;</span></span>
<span>  <span class='nf'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span><span class='o'>(</span><span class='o'>!</span><span class='o'>(</span><span class='nv'>deceased</span> <span class='o'>&amp;</span> <span class='nv'>date</span> <span class='o'>&lt;</span> <span class='m'>2012</span><span class='o'>)</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># A tibble: 3 × 3</span></span></span>
<span><span class='c'>#&gt;   name  deceased  date</span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span> <span style='color: #555555; font-style: italic;'>&lt;lgl&gt;</span>    <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span> Anne  FALSE     <span style='text-decoration: underline;'>2</span>005</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>2</span> Davis TRUE      <span style='text-decoration: underline;'>2</span>020</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>3</span> Derek FALSE       <span style='color: #BB0000;'>NA</span></span></span>
<span></span></code></pre>
</div>
<p>That seems to have worked, let&rsquo;s use an <a href="https://dplyr.tidyverse.org/reference/filter-joins.html" target="_blank" rel="noopener"><code>anti_join()</code></a> to check with rows have been dropped from <code>patients</code>:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='c'># These rows were dropped</span></span>
<span><span class='nf'><a href='https://dplyr.tidyverse.org/reference/filter-joins.html'>anti_join</a></span><span class='o'>(</span></span>
<span>  <span class='nv'>patients</span>,</span>
<span>  <span class='nv'>patients</span> <span class='o'>|&gt;</span> <span class='nf'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span><span class='o'>(</span><span class='o'>!</span><span class='o'>(</span><span class='nv'>deceased</span> <span class='o'>&amp;</span> <span class='nv'>date</span> <span class='o'>&lt;</span> <span class='m'>2012</span><span class='o'>)</span><span class='o'>)</span>,</span>
<span>  <span class='nf'><a href='https://dplyr.tidyverse.org/reference/join_by.html'>join_by</a></span><span class='o'>(</span><span class='nv'>name</span>, <span class='nv'>deceased</span>, <span class='nv'>date</span><span class='o'>)</span></span>
<span><span class='o'>)</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># A tibble: 4 × 3</span></span></span>
<span><span class='c'>#&gt;   name  deceased  date</span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span> <span style='color: #555555; font-style: italic;'>&lt;lgl&gt;</span>    <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span> Mark  TRUE      <span style='text-decoration: underline;'>2</span>010</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>2</span> Sarah <span style='color: #BB0000;'>NA</span>          <span style='color: #BB0000;'>NA</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>3</span> Max   <span style='color: #BB0000;'>NA</span>        <span style='text-decoration: underline;'>2</span>010</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>4</span> Tina  TRUE        <span style='color: #BB0000;'>NA</span></span></span>
<span></span></code></pre>
</div>
<p>This is subtly wrong! We only wanted to drop rows where we <em>know</em> that the patient was deceased before 2012. If a missing value is present, we <em>don&rsquo;t</em> want to drop that row because we aren&rsquo;t sure about the condition. In this case, we were hoping to only drop <code>Mark</code>! It seems like <a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter()</code></a> has unexpectedly <em>dropped more rows than we expected</em>.</p>
<p>Here&rsquo;s what a technically correct <a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter()</code></a> call might look like:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>patients</span> <span class='o'>|&gt;</span></span>
<span>  <span class='nf'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span><span class='o'>(</span></span>
<span>    <span class='o'>!</span><span class='o'>(</span><span class='o'>(</span><span class='nv'>deceased</span> <span class='o'>&amp;</span> <span class='o'>!</span><span class='nf'><a href='https://rdrr.io/r/base/NA.html'>is.na</a></span><span class='o'>(</span><span class='nv'>deceased</span><span class='o'>)</span><span class='o'>)</span> <span class='o'>&amp;</span></span>
<span>      <span class='o'>(</span><span class='nv'>date</span> <span class='o'>&lt;</span> <span class='m'>2012</span> <span class='o'>&amp;</span> <span class='o'>!</span><span class='nf'><a href='https://rdrr.io/r/base/NA.html'>is.na</a></span><span class='o'>(</span><span class='nv'>date</span><span class='o'>)</span><span class='o'>)</span><span class='o'>)</span></span>
<span>  <span class='o'>)</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># A tibble: 6 × 3</span></span></span>
<span><span class='c'>#&gt;   name  deceased  date</span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span> <span style='color: #555555; font-style: italic;'>&lt;lgl&gt;</span>    <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span> Anne  FALSE     <span style='text-decoration: underline;'>2</span>005</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>2</span> Sarah <span style='color: #BB0000;'>NA</span>          <span style='color: #BB0000;'>NA</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>3</span> Davis TRUE      <span style='text-decoration: underline;'>2</span>020</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>4</span> Max   <span style='color: #BB0000;'>NA</span>        <span style='text-decoration: underline;'>2</span>010</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>5</span> Derek FALSE       <span style='color: #BB0000;'>NA</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>6</span> Tina  TRUE        <span style='color: #BB0000;'>NA</span></span></span>
<span></span></code></pre>
</div>
<p>That&rsquo;s horrible! You&rsquo;ll likely look back on this in a year wondering what you were even trying to do here.</p>
<p>This phenomenon is rather confusing, but is due to the fact that <a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter()</code></a> is designed around the idea that you&rsquo;re going to tell it which rows to <em>keep</em>. With that design in mind, dropping <code>NA</code>s makes sense, i.e. if you don&rsquo;t <em>know</em> that you want to keep that row (because an <code>NA</code> is ambiguous), then you probably don&rsquo;t want to keep it.</p>
<p>This works well until you try to use <a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter()</code></a> as a way to <em>filter out</em> rows, at which point this behavior works against you. At this point, most people (reasonably!) reach for <code>&amp; !is.na()</code> and you end up with the mess from above.</p>
<p>We took a close look at many examples like this one, and eventually realized that the core issue is:</p>
<ul>
<li><a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter()</code></a> is designed around supplying which rows to <em>keep</em></li>
<li>We are missing a verb designed around supplying which rows to <em>drop</em></li>
</ul>
<p><a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter_out()</code></a> fills that gap:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>patients</span> <span class='o'>|&gt;</span></span>
<span>  <span class='nf'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter_out</a></span><span class='o'>(</span><span class='nv'>deceased</span>, <span class='nv'>date</span> <span class='o'>&lt;</span> <span class='m'>2012</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># A tibble: 6 × 3</span></span></span>
<span><span class='c'>#&gt;   name  deceased  date</span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span> <span style='color: #555555; font-style: italic;'>&lt;lgl&gt;</span>    <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span> Anne  FALSE     <span style='text-decoration: underline;'>2</span>005</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>2</span> Sarah <span style='color: #BB0000;'>NA</span>          <span style='color: #BB0000;'>NA</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>3</span> Davis TRUE      <span style='text-decoration: underline;'>2</span>020</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>4</span> Max   <span style='color: #BB0000;'>NA</span>        <span style='text-decoration: underline;'>2</span>010</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>5</span> Derek FALSE       <span style='color: #BB0000;'>NA</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>6</span> Tina  TRUE        <span style='color: #BB0000;'>NA</span></span></span>
<span></span></code></pre>
</div>
<p>Just like with <a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter()</code></a>, <a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter_out()</code></a> treats <code>NA</code> values as <code>FALSE</code>. The difference is that <a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter_out()</code></a> expects that you are going to tell it which rows to <em>drop</em> (rather than which rows to keep), so the default behavior of treating <code>NA</code> like <code>FALSE</code> works <em>with you</em> rather than <em>against you</em>. It&rsquo;s also much easier to understand when you look back on it a year from now!</p>
<p>In general, our advice is that if you find yourself using &ldquo;negative&rdquo; operators like <code>!=</code> or <code>!</code> or reaching for the <code>!is.na()</code> pattern to manually handle missing values, try reaching for <a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter_out()</code></a> instead.</p>
<p>Personally, I&rsquo;ve always been pretty jealous of Stata here because they had both <a href="https://www.stata.com/manuals/ddrop.pdf" target="_blank" rel="noopener"><code>keep if</code> and <code>drop if</code></a>, allowing them to write <code>drop if deceased &amp; date &lt; 2012</code>. In my first job, I translated a bunch of Stata code over to R and still remember being frustrated by <code>NA</code> handling every time I had to translate a <code>drop if</code> to a <a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter()</code></a>. With <a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter_out()</code></a>, it feels like I can finally let go of a long term grudge I&rsquo;ve held over the past 6 years 🙂.</p>
<h3 id="combining-with-or-rather-than-and">Combining with <code>OR</code> rather than <code>AND</code>
</h3>
<p>So far, we&rsquo;ve talked a lot about <em>dropping</em> rows, but dplyr 1.2.0 also has a new feature to help with <em>keeping</em> rows using conditions combined with <code>|</code> - <a href="https://dplyr.tidyverse.org/reference/when-any-all.html" target="_blank" rel="noopener"><code>when_any()</code></a>.</p>
<p>Our goal here is:</p>
<blockquote>
<p><em>Filter for</em> rows where &ldquo;US&rdquo; and &ldquo;CA&rdquo; have a score between 200-300, <em>or</em> rows where &ldquo;PR&rdquo; and &ldquo;RU&rdquo; have a score between 100-200.</p>
</blockquote>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>countries</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://tibble.tidyverse.org/reference/tibble.html'>tibble</a></span><span class='o'>(</span></span>
<span>  name <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"US"</span>, <span class='s'>"CA"</span>, <span class='s'>"PR"</span>, <span class='s'>"RU"</span>, <span class='s'>"US"</span>, <span class='kc'>NA</span>, <span class='s'>"CA"</span>, <span class='s'>"PR"</span><span class='o'>)</span>,</span>
<span>  score <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='m'>200</span>, <span class='m'>100</span>, <span class='m'>150</span>, <span class='kc'>NA</span>, <span class='m'>50</span>, <span class='m'>100</span>, <span class='m'>300</span>, <span class='m'>250</span><span class='o'>)</span></span>
<span><span class='o'>)</span></span>
<span></span>
<span><span class='nv'>countries</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># A tibble: 8 × 2</span></span></span>
<span><span class='c'>#&gt;   name  score</span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span> <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span> US      200</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>2</span> CA      100</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>3</span> PR      150</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>4</span> RU       <span style='color: #BB0000;'>NA</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>5</span> US       50</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>6</span> <span style='color: #BB0000;'>NA</span>      100</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>7</span> CA      300</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>8</span> PR      250</span></span>
<span></span></code></pre>
</div>
<p>Here&rsquo;s a <a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter()</code></a> solution, note how we lose the ability to specify comma separated conditions, and in the process we&rsquo;ve introduced 3 operators, <code>&amp;</code>, <code>|</code>, and <code>()</code>, decreasing readability and increasing the mental gymnastics required to understand it:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>countries</span> <span class='o'>|&gt;</span></span>
<span>  <span class='nf'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span><span class='o'>(</span></span>
<span>    <span class='o'>(</span><span class='nv'>name</span> <span class='o'><a href='https://rdrr.io/r/base/match.html'>%in%</a></span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"US"</span>, <span class='s'>"CA"</span><span class='o'>)</span> <span class='o'>&amp;</span> <span class='nf'><a href='https://dplyr.tidyverse.org/reference/between.html'>between</a></span><span class='o'>(</span><span class='nv'>score</span>, <span class='m'>200</span>, <span class='m'>300</span><span class='o'>)</span><span class='o'>)</span> <span class='o'>|</span></span>
<span>      <span class='o'>(</span><span class='nv'>name</span> <span class='o'><a href='https://rdrr.io/r/base/match.html'>%in%</a></span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"PR"</span>, <span class='s'>"RU"</span><span class='o'>)</span> <span class='o'>&amp;</span> <span class='nf'><a href='https://dplyr.tidyverse.org/reference/between.html'>between</a></span><span class='o'>(</span><span class='nv'>score</span>, <span class='m'>100</span>, <span class='m'>200</span><span class='o'>)</span><span class='o'>)</span></span>
<span>  <span class='o'>)</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># A tibble: 3 × 2</span></span></span>
<span><span class='c'>#&gt;   name  score</span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span> <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span> US      200</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>2</span> PR      150</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>3</span> CA      300</span></span>
<span></span></code></pre>
</div>
<p>With <a href="https://dplyr.tidyverse.org/reference/when-any-all.html" target="_blank" rel="noopener"><code>when_any()</code></a>, you specify comma separated conditions like you&rsquo;re used to, but they get combined with <code>|</code> rather than <code>&amp;</code>. This allows us to reduce the amount of operators introduced down to just <code>&amp;</code>, and it remains very readable:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>countries</span> <span class='o'>|&gt;</span></span>
<span>  <span class='nf'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span><span class='o'>(</span><span class='nf'><a href='https://dplyr.tidyverse.org/reference/when-any-all.html'>when_any</a></span><span class='o'>(</span></span>
<span>    <span class='nv'>name</span> <span class='o'><a href='https://rdrr.io/r/base/match.html'>%in%</a></span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"US"</span>, <span class='s'>"CA"</span><span class='o'>)</span> <span class='o'>&amp;</span> <span class='nf'><a href='https://dplyr.tidyverse.org/reference/between.html'>between</a></span><span class='o'>(</span><span class='nv'>score</span>, <span class='m'>200</span>, <span class='m'>300</span><span class='o'>)</span>,</span>
<span>    <span class='nv'>name</span> <span class='o'><a href='https://rdrr.io/r/base/match.html'>%in%</a></span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"PR"</span>, <span class='s'>"RU"</span><span class='o'>)</span> <span class='o'>&amp;</span> <span class='nf'><a href='https://dplyr.tidyverse.org/reference/between.html'>between</a></span><span class='o'>(</span><span class='nv'>score</span>, <span class='m'>100</span>, <span class='m'>200</span><span class='o'>)</span></span>
<span>  <span class='o'>)</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># A tibble: 3 × 2</span></span></span>
<span><span class='c'>#&gt;   name  score</span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span> <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span> US      200</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>2</span> PR      150</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>3</span> CA      300</span></span>
<span></span></code></pre>
</div>
<p><a href="https://dplyr.tidyverse.org/reference/when-any-all.html" target="_blank" rel="noopener"><code>when_any()</code></a> and its counterpart <a href="https://dplyr.tidyverse.org/reference/when-any-all.html" target="_blank" rel="noopener"><code>when_all()</code></a> aren&rsquo;t restricted to <a href="https://dplyr.tidyverse.org/reference/filter.html" target="_blank" rel="noopener"><code>filter()</code></a>. They are normal vector functions that can be used anywhere. And if you&rsquo;re a package author, you might be interested in <a href="https://vctrs.r-lib.org/reference/parallel-operators.html" target="_blank" rel="noopener"><code>vctrs::vec_pany()</code></a> and <a href="https://vctrs.r-lib.org/reference/parallel-operators.html" target="_blank" rel="noopener"><code>vctrs::vec_pall()</code></a>, the underlying low dependency functions that power the dplyr variants.</p>
<h2 id="reaching-recoding-nirvana">Reaching recoding nirvana
</h2>
<p>Over the years, we&rsquo;ve experimented with various ways of recoding columns and replacing values within them, including:</p>
<ul>
<li><a href="https://rdrr.io/pkg/plyr/man/mapvalues.html" target="_blank" rel="noopener"><code>plyr::mapvalues()</code></a></li>
<li><a href="https://rdrr.io/pkg/plyr/man/revalue.html" target="_blank" rel="noopener"><code>plyr::revalue()</code></a></li>
<li><a href="https://dplyr.tidyverse.org/reference/recode.html" target="_blank" rel="noopener"><code>dplyr::recode()</code></a></li>
<li><a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>dplyr::case_when()</code></a></li>
</ul>
<p>Despite all of our improvements, it&rsquo;s felt like there have always been holes in our solutions. Most recently, this came to the forefront in a post about <a href="https://www.linkedin.com/posts/libbyheeren_rstats-activity-7343291858275487744-XlPl?utm_source=share&amp;utm_medium=member_desktop&amp;rcm=ACoAAAy7IywB2qfaREGGoCca5XkthJ2hLjru6ts" target="_blank" rel="noopener">recoding using a lookup table</a>, which is almost impossible to do with <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a>, and had people resorting to confusing solutions using the superseded <a href="https://dplyr.tidyverse.org/reference/recode.html" target="_blank" rel="noopener"><code>dplyr::recode()</code></a> combined with <code>!!!</code> to splice in a lookup table.</p>
<p>After seeing this, we took a step back and were finally able to isolate the issues with our current solutions. The result of our <a href="https://github.com/tidyverse/tidyups/pull/29" target="_blank" rel="noopener">analysis</a> is three new functions that join <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a> to form a powerful recoding and replacing family.</p>
<p>It&rsquo;ll be helpful to define exactly what we mean by recoding vs replacing:</p>
<ul>
<li>
<p><em>Recoding</em> a column creates an entirely new column using values from an existing column. The new column may have a different type from the original column.</p>
</li>
<li>
<p><em>Replacing</em> values within a column partially updates an existing column with new values. The result has the same type as the original column.</p>
</li>
</ul>
<p>The family of functions can be summarized by the following table:</p>
<table>
  <thead>
      <tr>
          <th></th>
          <th><strong>Recoding</strong></th>
          <th><strong>Replacing</strong></th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><strong>Match with conditions</strong></td>
          <td><a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a></td>
          <td><a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>replace_when()</code></a></td>
      </tr>
      <tr>
          <td><strong>Match with values</strong></td>
          <td><a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>recode_values()</code></a></td>
          <td><a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>replace_values()</code></a></td>
      </tr>
  </tbody>
</table>
<p>We&rsquo;ve written a <a href="https://dplyr.tidyverse.org/articles/recoding-replacing.html" target="_blank" rel="noopener">new vignette</a> that expands on all of these from first principles, and in the next few sections we&rsquo;ll look at some examples.</p>
<h3 id="recode_values"><code>recode_values()</code>
</h3>
<p>The goal of the post from above was to recode a numeric column of <a href="https://en.wikipedia.org/wiki/Likert_scale" target="_blank" rel="noopener">Likert scale</a> scores into their string counterparts.</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>likert</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://tibble.tidyverse.org/reference/tibble.html'>tibble</a></span><span class='o'>(</span></span>
<span>  score <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='m'>1</span>, <span class='m'>2</span>, <span class='m'>3</span>, <span class='m'>4</span>, <span class='m'>5</span>, <span class='m'>2</span>, <span class='m'>3</span>, <span class='m'>1</span>, <span class='m'>4</span><span class='o'>)</span></span>
<span><span class='o'>)</span></span></code></pre>
</div>
<p>We could certainly try <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a>:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>likert</span> <span class='o'>|&gt;</span></span>
<span>  <span class='nf'><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate</a></span><span class='o'>(</span></span>
<span>    category <span class='o'>=</span> <span class='nf'><a href='https://dplyr.tidyverse.org/reference/case-and-replace-when.html'>case_when</a></span><span class='o'>(</span></span>
<span>      <span class='nv'>score</span> <span class='o'>==</span> <span class='m'>1</span> <span class='o'>~</span> <span class='s'>"Strongly disagree"</span>,</span>
<span>      <span class='nv'>score</span> <span class='o'>==</span> <span class='m'>2</span> <span class='o'>~</span> <span class='s'>"Disagree"</span>,</span>
<span>      <span class='nv'>score</span> <span class='o'>==</span> <span class='m'>3</span> <span class='o'>~</span> <span class='s'>"Neutral"</span>,</span>
<span>      <span class='nv'>score</span> <span class='o'>==</span> <span class='m'>4</span> <span class='o'>~</span> <span class='s'>"Agree"</span>,</span>
<span>      <span class='nv'>score</span> <span class='o'>==</span> <span class='m'>5</span> <span class='o'>~</span> <span class='s'>"Strongly agree"</span></span>
<span>    <span class='o'>)</span></span>
<span>  <span class='o'>)</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># A tibble: 9 × 2</span></span></span>
<span><span class='c'>#&gt;   score category         </span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span> <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span>            </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span>     1 Strongly disagree</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>2</span>     2 Disagree         </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>3</span>     3 Neutral          </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>4</span>     4 Agree            </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>5</span>     5 Strongly agree   </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>6</span>     2 Disagree         </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>7</span>     3 Neutral          </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>8</span>     1 Strongly disagree</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>9</span>     4 Agree</span></span>
<span></span></code></pre>
</div>
<p>But <code>score ==</code> is repeated so many times! When you find yourself using <code>==</code> in this way, recognize that what you&rsquo;re really doing is matching on the <em>values</em> of a single column. In cases like these, you&rsquo;ll want to switch to <a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>recode_values()</code></a>. Rather than taking logical vectors, <a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>recode_values()</code></a> takes <em>values</em> on the left-hand side to match against a single input that you&rsquo;ll provide as the first argument.</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>likert</span> <span class='o'>|&gt;</span></span>
<span>  <span class='nf'><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate</a></span><span class='o'>(</span></span>
<span>    category <span class='o'>=</span> <span class='nv'>score</span> <span class='o'>|&gt;</span></span>
<span>      <span class='nf'><a href='https://dplyr.tidyverse.org/reference/recode-and-replace-values.html'>recode_values</a></span><span class='o'>(</span></span>
<span>        <span class='m'>1</span> <span class='o'>~</span> <span class='s'>"Strongly disagree"</span>,</span>
<span>        <span class='m'>2</span> <span class='o'>~</span> <span class='s'>"Disagree"</span>,</span>
<span>        <span class='m'>3</span> <span class='o'>~</span> <span class='s'>"Neutral"</span>,</span>
<span>        <span class='m'>4</span> <span class='o'>~</span> <span class='s'>"Agree"</span>,</span>
<span>        <span class='m'>5</span> <span class='o'>~</span> <span class='s'>"Strongly agree"</span></span>
<span>      <span class='o'>)</span></span>
<span>  <span class='o'>)</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># A tibble: 9 × 2</span></span></span>
<span><span class='c'>#&gt;   score category         </span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span> <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span>            </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span>     1 Strongly disagree</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>2</span>     2 Disagree         </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>3</span>     3 Neutral          </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>4</span>     4 Agree            </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>5</span>     5 Strongly agree   </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>6</span>     2 Disagree         </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>7</span>     3 Neutral          </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>8</span>     1 Strongly disagree</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>9</span>     4 Agree</span></span>
<span></span></code></pre>
</div>
<p>This removes all of the repetition, allowing you to focus on the mapping. And it should feel pretty familiar! This is the same formula interface of <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a>.</p>
<p>If you squint, the mapping should look roughly like a lookup table between the numeric value and the Likert encoding. One of the novel features of <a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>recode_values()</code></a> is that it has an alternate interface that allows you to make this lookup table more explicit. Using a <a href="https://tibble.tidyverse.org/reference/tribble.html" target="_blank" rel="noopener"><code>tribble()</code></a>, we can extract out the lookup table into its own standalone data frame.</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>lookup</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://tibble.tidyverse.org/reference/tribble.html'>tribble</a></span><span class='o'>(</span></span>
<span>  <span class='o'>~</span><span class='nv'>from</span> , <span class='o'>~</span><span class='nv'>to</span>                 ,</span>
<span>      <span class='m'>1</span> , <span class='s'>"Strongly disagree"</span> ,</span>
<span>      <span class='m'>2</span> , <span class='s'>"Disagree"</span>          ,</span>
<span>      <span class='m'>3</span> , <span class='s'>"Neutral"</span>           ,</span>
<span>      <span class='m'>4</span> , <span class='s'>"Agree"</span>             ,</span>
<span>      <span class='m'>5</span> , <span class='s'>"Strongly agree"</span>    ,</span>
<span><span class='o'>)</span></span></code></pre>
</div>
<p>We can then utilize the alternative <code>from</code> and <code>to</code> arguments of <a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>recode_values()</code></a> rather than supplying formulas to specify how the values should be recoded:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>likert</span> <span class='o'>|&gt;</span></span>
<span>  <span class='nf'><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate</a></span><span class='o'>(</span>category <span class='o'>=</span> <span class='nf'><a href='https://dplyr.tidyverse.org/reference/recode-and-replace-values.html'>recode_values</a></span><span class='o'>(</span><span class='nv'>score</span>, from <span class='o'>=</span> <span class='nv'>lookup</span><span class='o'>$</span><span class='nv'>from</span>, to <span class='o'>=</span> <span class='nv'>lookup</span><span class='o'>$</span><span class='nv'>to</span><span class='o'>)</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># A tibble: 9 × 2</span></span></span>
<span><span class='c'>#&gt;   score category         </span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span> <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span>            </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span>     1 Strongly disagree</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>2</span>     2 Disagree         </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>3</span>     3 Neutral          </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>4</span>     4 Agree            </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>5</span>     5 Strongly agree   </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>6</span>     2 Disagree         </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>7</span>     3 Neutral          </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>8</span>     1 Strongly disagree</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>9</span>     4 Agree</span></span>
<span></span></code></pre>
</div>
<p>Lifting the lookup table out to the top of the file is particularly nice when you have a long pipe chain. The details of the mapping get some room to breathe, and in the pipe chain you can focus on the actual data manipulations.</p>
<p>It&rsquo;s also very common for your <code>lookup</code> table to exist in a CSV file that you have to read in separately. In that case, you can replace the <a href="https://tibble.tidyverse.org/reference/tribble.html" target="_blank" rel="noopener"><code>tribble()</code></a> call with:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>lookup</span> <span class='o'>&lt;-</span> <span class='nf'>readr</span><span class='nf'>::</span><span class='nf'><a href='https://readr.tidyverse.org/reference/read_delim.html'>read_csv</a></span><span class='o'>(</span><span class='s'>"lookup.csv"</span><span class='o'>)</span></span></code></pre>
</div>
<p>Then everything else works the same.</p>
<h3 id="unmatched-cases">Unmatched cases
</h3>
<p>If you are confident that you&rsquo;ve captured every case during the recoding process, you can now supply <code>unmatched = &quot;error&quot;</code> as an alternative to <code>default</code>. <a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>recode_values()</code></a> will error if that assertion doesn&rsquo;t hold. This is great for defensive programming!</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='c'># Notice the `0` that we don't have a mapping for!</span></span>
<span><span class='nv'>likert</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://tibble.tidyverse.org/reference/tibble.html'>tibble</a></span><span class='o'>(</span></span>
<span>  score <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='m'>0</span>, <span class='m'>1</span>, <span class='m'>2</span>, <span class='m'>2</span>, <span class='m'>4</span>, <span class='m'>5</span>, <span class='m'>2</span>, <span class='m'>3</span>, <span class='m'>1</span>, <span class='m'>4</span><span class='o'>)</span></span>
<span><span class='o'>)</span></span>
<span></span>
<span><span class='nv'>likert</span> <span class='o'>|&gt;</span></span>
<span>  <span class='nf'><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate</a></span><span class='o'>(</span></span>
<span>    score <span class='o'>=</span> <span class='nv'>score</span> <span class='o'>|&gt;</span></span>
<span>      <span class='nf'><a href='https://dplyr.tidyverse.org/reference/recode-and-replace-values.html'>recode_values</a></span><span class='o'>(</span></span>
<span>        from <span class='o'>=</span> <span class='nv'>lookup</span><span class='o'>$</span><span class='nv'>from</span>,</span>
<span>        to <span class='o'>=</span> <span class='nv'>lookup</span><span class='o'>$</span><span class='nv'>to</span>,</span>
<span>        unmatched <span class='o'>=</span> <span class='s'>"error"</span></span>
<span>      <span class='o'>)</span></span>
<span>  <span class='o'>)</span></span>
<span><span class='c'>#&gt; <span style='color: #BBBB00; font-weight: bold;'>Error</span><span style='font-weight: bold;'> in `mutate()`:</span></span></span>
<span><span class='c'>#&gt; <span style='color: #00BBBB;'>ℹ</span> In argument: `score = recode_values(score, from = lookup$from, to = lookup$to, unmatched = "error")`.</span></span>
<span><span class='c'>#&gt; <span style='font-weight: bold;'>Caused by error in `recode_values()`:</span></span></span>
<span><span class='c'>#&gt; <span style='color: #BBBB00;'>!</span> Each location must be matched.</span></span>
<span><span class='c'>#&gt; <span style='color: #BB0000;'>✖</span> Location 1 is unmatched.</span></span>
<span></span></code></pre>
</div>
<p>Note that missing values must be explicitly handled when setting <code>unmatched = &quot;error&quot;</code>, even if that&rsquo;s just setting <code>NA ~ NA</code>, otherwise they will trigger the unmatched error. This forces you to explicitly opt in to expecting missing values.</p>
<p>Similar to <a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>recode_values()</code></a>, <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a> has also gained the <code>.unmatched</code> argument.</p>
<h3 id="replace_values"><code>replace_values()</code>
</h3>
<p>Out of all of the new things introduced in dplyr 1.2.0, I think I&rsquo;m most excited about <a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>replace_values()</code></a>.</p>
<p>While <a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>recode_values()</code></a> is great for creating an entirely new column (possibly with a new type), if you just need to replace a few rows of an existing column, then <a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>replace_values()</code></a> is the best tool for the job!</p>
<p>Imagine we&rsquo;d like to collapse some, but not all, of these school names into common buckets:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>schools</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://tibble.tidyverse.org/reference/tibble.html'>tibble</a></span><span class='o'>(</span></span>
<span>  name <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span></span>
<span>    <span class='s'>"UNC"</span>,</span>
<span>    <span class='s'>"Chapel Hill"</span>,</span>
<span>    <span class='kc'>NA</span>,</span>
<span>    <span class='s'>"Duke"</span>,</span>
<span>    <span class='s'>"Duke University"</span>,</span>
<span>    <span class='s'>"UNC"</span>,</span>
<span>    <span class='s'>"NC State"</span>,</span>
<span>    <span class='s'>"ECU"</span></span>
<span>  <span class='o'>)</span></span>
<span><span class='o'>)</span></span></code></pre>
</div>
<p>We could use <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a> or <a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>recode_values()</code></a>:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>schools</span> <span class='o'>|&gt;</span></span>
<span>  <span class='nf'><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate</a></span><span class='o'>(</span></span>
<span>    name <span class='o'>=</span> <span class='nf'><a href='https://dplyr.tidyverse.org/reference/case-and-replace-when.html'>case_when</a></span><span class='o'>(</span></span>
<span>      <span class='nv'>name</span> <span class='o'><a href='https://rdrr.io/r/base/match.html'>%in%</a></span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"UNC"</span>, <span class='s'>"Chapel Hill"</span><span class='o'>)</span> <span class='o'>~</span> <span class='s'>"UNC Chapel Hill"</span>,</span>
<span>      <span class='nv'>name</span> <span class='o'><a href='https://rdrr.io/r/base/match.html'>%in%</a></span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"Duke"</span>, <span class='s'>"Duke University"</span><span class='o'>)</span> <span class='o'>~</span> <span class='s'>"Duke"</span>,</span>
<span>      .default <span class='o'>=</span> <span class='nv'>name</span></span>
<span>    <span class='o'>)</span></span>
<span>  <span class='o'>)</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># A tibble: 8 × 1</span></span></span>
<span><span class='c'>#&gt;   name           </span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span>          </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span> UNC Chapel Hill</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>2</span> UNC Chapel Hill</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>3</span> <span style='color: #BB0000;'>NA</span>             </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>4</span> Duke           </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>5</span> Duke           </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>6</span> UNC Chapel Hill</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>7</span> NC State       </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>8</span> ECU</span></span>
<span></span><span></span>
<span><span class='nv'>schools</span> <span class='o'>|&gt;</span></span>
<span>  <span class='nf'><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate</a></span><span class='o'>(</span></span>
<span>    name <span class='o'>=</span> <span class='nf'><a href='https://dplyr.tidyverse.org/reference/recode-and-replace-values.html'>recode_values</a></span><span class='o'>(</span></span>
<span>      <span class='nv'>name</span>,</span>
<span>      <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"UNC"</span>, <span class='s'>"Chapel Hill"</span><span class='o'>)</span> <span class='o'>~</span> <span class='s'>"UNC Chapel Hill"</span>,</span>
<span>      <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"Duke"</span>, <span class='s'>"Duke University"</span><span class='o'>)</span> <span class='o'>~</span> <span class='s'>"Duke"</span>,</span>
<span>      default <span class='o'>=</span> <span class='nv'>name</span></span>
<span>    <span class='o'>)</span></span>
<span>  <span class='o'>)</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># A tibble: 8 × 1</span></span></span>
<span><span class='c'>#&gt;   name           </span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span>          </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span> UNC Chapel Hill</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>2</span> UNC Chapel Hill</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>3</span> <span style='color: #BB0000;'>NA</span>             </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>4</span> Duke           </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>5</span> Duke           </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>6</span> UNC Chapel Hill</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>7</span> NC State       </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>8</span> ECU</span></span>
<span></span></code></pre>
</div>
<p>But this &ldquo;partial update&rdquo; operation is so common that it really deserves its own name that doesn&rsquo;t require you to specify <code>default</code> and is type stable on the input. For that, we have <a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>replace_values()</code></a>:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>schools</span> <span class='o'>|&gt;</span></span>
<span>  <span class='nf'><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate</a></span><span class='o'>(</span></span>
<span>    name <span class='o'>=</span> <span class='nv'>name</span> <span class='o'>|&gt;</span></span>
<span>      <span class='nf'><a href='https://dplyr.tidyverse.org/reference/recode-and-replace-values.html'>replace_values</a></span><span class='o'>(</span></span>
<span>        <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"UNC"</span>, <span class='s'>"Chapel Hill"</span><span class='o'>)</span> <span class='o'>~</span> <span class='s'>"UNC Chapel Hill"</span>,</span>
<span>        <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"Duke"</span>, <span class='s'>"Duke University"</span><span class='o'>)</span> <span class='o'>~</span> <span class='s'>"Duke"</span></span>
<span>      <span class='o'>)</span></span>
<span>  <span class='o'>)</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># A tibble: 8 × 1</span></span></span>
<span><span class='c'>#&gt;   name           </span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span>          </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span> UNC Chapel Hill</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>2</span> UNC Chapel Hill</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>3</span> <span style='color: #BB0000;'>NA</span>             </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>4</span> Duke           </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>5</span> Duke           </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>6</span> UNC Chapel Hill</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>7</span> NC State       </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>8</span> ECU</span></span>
<span></span></code></pre>
</div>
<p>Notice how pipe friendly <a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>replace_values()</code></a> is! The first input is your &ldquo;primary&rdquo; input, and you can expect the output to have the same type and size as that input.</p>
<p>Like <a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>recode_values()</code></a>, <a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>replace_values()</code></a> has an alternative <code>from</code> and <code>to</code> API that works well with lookup tables and allows you to move your mapping out of the pipe chain:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>lookup</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://tibble.tidyverse.org/reference/tribble.html'>tribble</a></span><span class='o'>(</span></span>
<span>  <span class='o'>~</span><span class='nv'>from</span>             , <span class='o'>~</span><span class='nv'>to</span>               ,</span>
<span>  <span class='s'>"UNC"</span>             , <span class='s'>"UNC Chapel Hill"</span> ,</span>
<span>  <span class='s'>"Chapel Hill"</span>     , <span class='s'>"UNC Chapel Hill"</span> ,</span>
<span>  <span class='s'>"Duke"</span>            , <span class='s'>"Duke"</span>            ,</span>
<span>  <span class='s'>"Duke University"</span> , <span class='s'>"Duke"</span>            ,</span>
<span><span class='o'>)</span></span>
<span></span>
<span><span class='nv'>schools</span> <span class='o'>|&gt;</span></span>
<span>  <span class='nf'><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate</a></span><span class='o'>(</span>name <span class='o'>=</span> <span class='nf'><a href='https://dplyr.tidyverse.org/reference/recode-and-replace-values.html'>replace_values</a></span><span class='o'>(</span><span class='nv'>name</span>, from <span class='o'>=</span> <span class='nv'>lookup</span><span class='o'>$</span><span class='nv'>from</span>, to <span class='o'>=</span> <span class='nv'>lookup</span><span class='o'>$</span><span class='nv'>to</span><span class='o'>)</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># A tibble: 8 × 1</span></span></span>
<span><span class='c'>#&gt;   name           </span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span>          </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span> UNC Chapel Hill</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>2</span> UNC Chapel Hill</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>3</span> <span style='color: #BB0000;'>NA</span>             </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>4</span> Duke           </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>5</span> Duke           </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>6</span> UNC Chapel Hill</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>7</span> NC State       </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>8</span> ECU</span></span>
<span></span></code></pre>
</div>
<p>An extremely neat feature of the <code>from</code> and <code>to</code> API is that they also take <em>lists</em> of vectors that describe the mapping, which has been designed to work elegantly with the fact that <a href="https://tibble.tidyverse.org/reference/tribble.html" target="_blank" rel="noopener"><code>tribble()</code></a> can create list columns, allowing you to further collapse this lookup table:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='c'># Condensed lookup table with a `many:1` mapping per row</span></span>
<span><span class='nv'>lookup</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://tibble.tidyverse.org/reference/tribble.html'>tribble</a></span><span class='o'>(</span></span>
<span>  <span class='o'>~</span><span class='nv'>from</span>                        , <span class='o'>~</span><span class='nv'>to</span>               ,</span>
<span>  <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"UNC"</span>, <span class='s'>"Chapel Hill"</span><span class='o'>)</span>      , <span class='s'>"UNC Chapel Hill"</span> ,</span>
<span>  <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"Duke"</span>, <span class='s'>"Duke University"</span><span class='o'>)</span> , <span class='s'>"Duke"</span>            ,</span>
<span><span class='o'>)</span></span>
<span></span>
<span><span class='c'># Note that `from` is a list column</span></span>
<span><span class='nv'>lookup</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># A tibble: 2 × 2</span></span></span>
<span><span class='c'>#&gt;   from      to             </span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;list&gt;</span>    <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span>          </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span> <span style='color: #555555;'>&lt;chr [2]&gt;</span> UNC Chapel Hill</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>2</span> <span style='color: #555555;'>&lt;chr [2]&gt;</span> Duke</span></span>
<span></span><span></span>
<span><span class='nv'>lookup</span><span class='o'>$</span><span class='nv'>from</span></span>
<span><span class='c'>#&gt; [[1]]</span></span>
<span><span class='c'>#&gt; [1] "UNC"         "Chapel Hill"</span></span>
<span><span class='c'>#&gt; </span></span>
<span><span class='c'>#&gt; [[2]]</span></span>
<span><span class='c'>#&gt; [1] "Duke"            "Duke University"</span></span>
<span></span><span></span>
<span><span class='c'># Works the same as before</span></span>
<span><span class='nv'>schools</span> <span class='o'>|&gt;</span></span>
<span>  <span class='nf'><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate</a></span><span class='o'>(</span>name <span class='o'>=</span> <span class='nf'><a href='https://dplyr.tidyverse.org/reference/recode-and-replace-values.html'>replace_values</a></span><span class='o'>(</span><span class='nv'>name</span>, from <span class='o'>=</span> <span class='nv'>lookup</span><span class='o'>$</span><span class='nv'>from</span>, to <span class='o'>=</span> <span class='nv'>lookup</span><span class='o'>$</span><span class='nv'>to</span><span class='o'>)</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># A tibble: 8 × 1</span></span></span>
<span><span class='c'>#&gt;   name           </span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span>          </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span> UNC Chapel Hill</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>2</span> UNC Chapel Hill</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>3</span> <span style='color: #BB0000;'>NA</span>             </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>4</span> Duke           </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>5</span> Duke           </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>6</span> UNC Chapel Hill</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>7</span> NC State       </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>8</span> ECU</span></span>
<span></span></code></pre>
</div>
<p>The formula interface of <a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>replace_values()</code></a> is a bit of a Swiss Army knife for all manner of scenarios where you might have previously reached for <a href="https://dplyr.tidyverse.org/reference/coalesce.html" target="_blank" rel="noopener"><code>dplyr::coalesce()</code></a>, <a href="https://dplyr.tidyverse.org/reference/na_if.html" target="_blank" rel="noopener"><code>dplyr::na_if()</code></a>, or <a href="https://tidyr.tidyverse.org/reference/replace_na.html" target="_blank" rel="noopener"><code>tidyr::replace_na()</code></a>:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>state</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"NC"</span>, <span class='s'>"NY"</span>, <span class='s'>"CA"</span>, <span class='kc'>NA</span>, <span class='s'>"NY"</span>, <span class='s'>"Unknown"</span>, <span class='kc'>NA</span><span class='o'>)</span></span>
<span></span>
<span><span class='c'># Replace missing values with a constant</span></span>
<span><span class='nf'><a href='https://dplyr.tidyverse.org/reference/recode-and-replace-values.html'>replace_values</a></span><span class='o'>(</span><span class='nv'>state</span>, <span class='kc'>NA</span> <span class='o'>~</span> <span class='s'>"Unknown"</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; [1] "NC"      "NY"      "CA"      "Unknown" "NY"      "Unknown" "Unknown"</span></span>
<span></span><span></span>
<span><span class='c'># Replace missing values with the corresponding value from another column</span></span>
<span><span class='nv'>region</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='s'>"South"</span>, <span class='s'>"North"</span>, <span class='s'>"West"</span>, <span class='s'>"East"</span>, <span class='s'>"North"</span>, <span class='s'>"Unknown"</span>, <span class='s'>"West"</span><span class='o'>)</span></span>
<span><span class='nf'><a href='https://dplyr.tidyverse.org/reference/recode-and-replace-values.html'>replace_values</a></span><span class='o'>(</span><span class='nv'>state</span>, <span class='kc'>NA</span> <span class='o'>~</span> <span class='nv'>region</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; [1] "NC"      "NY"      "CA"      "East"    "NY"      "Unknown" "West"</span></span>
<span></span><span></span>
<span><span class='c'># Replace problematic values with a missing value</span></span>
<span><span class='nf'><a href='https://dplyr.tidyverse.org/reference/recode-and-replace-values.html'>replace_values</a></span><span class='o'>(</span><span class='nv'>state</span>, <span class='s'>"Unknown"</span> <span class='o'>~</span> <span class='kc'>NA</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; [1] "NC" "NY" "CA" NA   "NY" NA   NA</span></span>
<span></span><span></span>
<span><span class='c'># Standardize multiple issues at once</span></span>
<span><span class='nf'><a href='https://dplyr.tidyverse.org/reference/recode-and-replace-values.html'>replace_values</a></span><span class='o'>(</span><span class='nv'>state</span>, <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='kc'>NA</span>, <span class='s'>"Unknown"</span><span class='o'>)</span> <span class='o'>~</span> <span class='s'>"&lt;missing&gt;"</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; [1] "NC"        "NY"        "CA"        "&lt;missing&gt;" "NY"        "&lt;missing&gt;"</span></span>
<span><span class='c'>#&gt; [7] "&lt;missing&gt;"</span></span>
<span></span></code></pre>
</div>
<p>We also think it better expresses intent than <a href="https://dplyr.tidyverse.org/reference/if_else.html" target="_blank" rel="noopener"><code>if_else()</code></a> or <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a> when performing a partial update:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='c'># - Type stable on `x`</span></span>
<span><span class='c'># - Intent of "partially updating" `state` is clear</span></span>
<span><span class='c'># - Pipe friendly</span></span>
<span><span class='nv'>state</span> <span class='o'>|&gt;</span> <span class='nf'><a href='https://dplyr.tidyverse.org/reference/recode-and-replace-values.html'>replace_values</a></span><span class='o'>(</span><span class='kc'>NA</span> <span class='o'>~</span> <span class='s'>"Unknown"</span><span class='o'>)</span></span>
<span></span>
<span><span class='c'># Historically this has been "the way" to do a partial update,</span></span>
<span><span class='c'># but it's odd that the "primary" input is at the end!</span></span>
<span><span class='nf'><a href='https://dplyr.tidyverse.org/reference/if_else.html'>if_else</a></span><span class='o'>(</span><span class='nf'><a href='https://rdrr.io/r/base/NA.html'>is.na</a></span><span class='o'>(</span><span class='nv'>state</span><span class='o'>)</span>, <span class='s'>"Unknown"</span>, <span class='nv'>state</span><span class='o'>)</span></span>
<span><span class='nf'><a href='https://dplyr.tidyverse.org/reference/case-and-replace-when.html'>case_when</a></span><span class='o'>(</span><span class='nf'><a href='https://rdrr.io/r/base/NA.html'>is.na</a></span><span class='o'>(</span><span class='nv'>state</span><span class='o'>)</span> <span class='o'>~</span> <span class='s'>"Unknown"</span>, .default <span class='o'>=</span> <span class='nv'>state</span><span class='o'>)</span></span></code></pre>
</div>
<p>If you&rsquo;re a package author, you&rsquo;ll probably also be interested in <a href="https://vctrs.r-lib.org/reference/vec-recode-and-replace.html" target="_blank" rel="noopener"><code>vctrs::vec_recode_values()</code></a> and <a href="https://vctrs.r-lib.org/reference/vec-recode-and-replace.html" target="_blank" rel="noopener"><code>vctrs::vec_replace_values()</code></a>, which are low dependency functions that power the dplyr variants.</p>
<h3 id="what-about-case_match">What about <code>case_match()</code>?
</h3>
<p>We&rsquo;ve soft-deprecated <a href="https://dplyr.tidyverse.org/reference/case_match.html" target="_blank" rel="noopener"><code>case_match()</code></a> in favor of <a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>recode_values()</code></a>, which is a drop in replacement.</p>
<p><a href="https://dplyr.tidyverse.org/reference/case_match.html" target="_blank" rel="noopener"><code>case_match()</code></a> was an incremental step towards this recoding family, but:</p>
<ul>
<li>It has a pretty confusing name compared with <a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>recode_values()</code></a>.</li>
<li>It lacked a way to work with lookup tables, like <code>from</code> and <code>to</code>.</li>
<li>It lacks a replacement variant, like <a href="https://dplyr.tidyverse.org/reference/recode-and-replace-values.html" target="_blank" rel="noopener"><code>replace_values()</code></a>.</li>
</ul>
<p>Rather than keeping <a href="https://dplyr.tidyverse.org/reference/case_match.html" target="_blank" rel="noopener"><code>case_match()</code></a> around indefinitely, we&rsquo;ve decided to initiate the process of its removal since it was only introduced in dplyr 1.1.0.</p>
<h2 id="deprecations">Deprecations
</h2>
<p>dplyr 1.2.0 advances the lifecycle stage of many deprecated functions. These deprecations have been in the works for many years now, due to our slow and very deliberate deprecation process via the <a href="https://lifecycle.r-lib.org/" target="_blank" rel="noopener">lifecycle package</a>. We&rsquo;ll cover the highlights, and you can find the full list <a href="https://github.com/tidyverse/dplyr/releases/tag/v1.2.0" target="_blank" rel="noopener">here</a>.</p>
<p>For any packages that we broke via these deprecations, we provided a pull request (or at least an issue, for complex cases) and some advance warning. We semi-automated some of this process using Claude Code, which you can read about <a href="https://blog.davisvaughan.com/posts/2026-01-09-claude-200-pull-requests/" target="_blank" rel="noopener">here</a>.</p>
<ul>
<li>
<p>All underscored verbs have moved from deprecated to defunct, such as <a href="https://dplyr.tidyverse.org/reference/defunct-lazyeval.html" target="_blank" rel="noopener"><code>mutate_()</code></a> and <a href="https://dplyr.tidyverse.org/reference/defunct-lazyeval.html" target="_blank" rel="noopener"><code>arrange_()</code></a>. These have been deprecated since dplyr 0.7.0 back in 2017 (yes, 2017!!). Use the non-underscored versions, see <a href="https://dplyr.tidyverse.org/articles/programming.html" target="_blank" rel="noopener"><code>vignette(&quot;programming&quot;)</code></a> for details.</p>
</li>
<li>
<p><a href="https://dplyr.tidyverse.org/reference/defunct-each.html" target="_blank" rel="noopener"><code>mutate_each()</code></a> and <a href="https://dplyr.tidyverse.org/reference/defunct-each.html" target="_blank" rel="noopener"><code>summarise_each()</code></a> have moved from deprecated to defunct. These were also deprecated in dplyr 0.7.0. Use <a href="https://dplyr.tidyverse.org/reference/mutate.html" target="_blank" rel="noopener"><code>mutate()</code></a> and <a href="https://dplyr.tidyverse.org/reference/summarise.html" target="_blank" rel="noopener"><code>summarise()</code></a> with <a href="https://dplyr.tidyverse.org/reference/across.html" target="_blank" rel="noopener"><code>across()</code></a> instead.</p>
</li>
<li>
<p>Returning more or less than 1 row per group in <a href="https://dplyr.tidyverse.org/reference/summarise.html" target="_blank" rel="noopener"><code>summarise()</code></a> has moved from deprecated to defunct. This was deprecated in dplyr 1.1.0 in 2023 after we realized that this was an unsafe feature for <a href="https://dplyr.tidyverse.org/reference/summarise.html" target="_blank" rel="noopener"><code>summarise()</code></a>, which you should always expect to return exactly 1 row per group. <a href="https://dplyr.tidyverse.org/reference/reframe.html" target="_blank" rel="noopener"><code>reframe()</code></a> is a drop in replacement when you need this.</p>
</li>
<li>
<p>In <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a>, supplying all size 1 LHS inputs along with a size &gt;1 RHS input is now soft-deprecated. This is an improper usage of <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a> that should instead be a series of if statements, like:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="c1"># Scalars!</span>
</span></span><span class="line"><span class="cl"><span class="n">code</span> <span class="o">&lt;-</span> <span class="m">1L</span>
</span></span><span class="line"><span class="cl"><span class="n">flavor</span> <span class="o">&lt;-</span> <span class="s">&#34;vanilla&#34;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Improper usage:</span>
</span></span><span class="line"><span class="cl"><span class="nf">case_when</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">  <span class="n">code</span> <span class="o">==</span> <span class="m">1L</span> <span class="o">&amp;&amp;</span> <span class="n">flavor</span> <span class="o">==</span> <span class="s">&#34;chocolate&#34;</span> <span class="o">~</span> <span class="n">x</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="n">code</span> <span class="o">==</span> <span class="m">1L</span> <span class="o">&amp;&amp;</span> <span class="n">flavor</span> <span class="o">==</span> <span class="s">&#34;vanilla&#34;</span> <span class="o">~</span> <span class="n">y</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="n">code</span> <span class="o">==</span> <span class="m">2L</span> <span class="o">&amp;&amp;</span> <span class="n">flavor</span> <span class="o">==</span> <span class="s">&#34;vanilla&#34;</span> <span class="o">~</span> <span class="n">z</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="n">.default</span> <span class="o">=</span> <span class="n">default</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Recommended:</span>
</span></span><span class="line"><span class="cl"><span class="kr">if</span> <span class="p">(</span><span class="n">code</span> <span class="o">==</span> <span class="m">1L</span> <span class="o">&amp;&amp;</span> <span class="n">flavor</span> <span class="o">==</span> <span class="s">&#34;chocolate&#34;</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">  <span class="n">x</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span> <span class="kr">else</span> <span class="kr">if</span> <span class="p">(</span><span class="n">code</span> <span class="o">==</span> <span class="m">1L</span> <span class="o">&amp;&amp;</span> <span class="n">flavor</span> <span class="o">==</span> <span class="s">&#34;vanilla&#34;</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">  <span class="n">y</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span> <span class="kr">else</span> <span class="kr">if</span> <span class="p">(</span><span class="n">code</span> <span class="o">==</span> <span class="m">2L</span> <span class="o">&amp;&amp;</span> <span class="n">flavor</span> <span class="o">==</span> <span class="s">&#34;vanilla&#34;</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">  <span class="n">z</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span> <span class="kr">else</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">  <span class="n">default</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div></div>
<p>The recycling behavior that allows this style of <a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" target="_blank" rel="noopener"><code>case_when()</code></a> to work is unsafe, and can result in silent bugs that we&rsquo;d like to guard against with an error in the future. See <a href="https://github.com/tidyverse/dplyr/issues/7082" target="_blank" rel="noopener">this issue</a> for context.</p>
</li>
<li>
<p>The <code>dplyr.legacy_locale</code> global option is soft-deprecated. If you used this to affect the ordering of <a href="https://dplyr.tidyverse.org/reference/arrange.html" target="_blank" rel="noopener"><code>arrange()</code></a>, use <code>arrange(.locale =)</code> instead. If you used this to affect the ordering of <code>group_by() |&gt; summarise()</code>, follow up with an additional call to <code>arrange(.locale =)</code> instead.</p>
</li>
<li>
<p><a href="https://dplyr.tidyverse.org/reference/if_else.html" target="_blank" rel="noopener"><code>if_else()</code></a> no longer allows <code>condition</code> to be a logical array. It must be a logical vector with no <code>dim</code> attribute.</p>
</li>
<li>
<p>We&rsquo;ve removed a number of previously defunct functions, shrinking the footprint of dplyr&rsquo;s API:</p>
<ul>
<li><code>id()</code></li>
<li><code>failwith()</code></li>
<li><code>select_vars()</code> and <code>select_vars_()</code></li>
<li><code>rename_vars()</code> and <code>rename_vars_()</code></li>
<li><code>select_var()</code></li>
<li><code>current_vars()</code></li>
<li><code>bench_tbls()</code>, <code>compare_tbls()</code>, <code>compare_tbls2()</code>, <code>eval_tbls()</code>, and <code>eval_tbls2()</code></li>
<li><code>location()</code> and <code>changes()</code></li>
</ul>
</li>
</ul>
<h2 id="acknowledgements">Acknowledgements
</h2>
<p>We&rsquo;d like to thank all 177 contributors who help in someway, whether it was filing issues or contributing code and documentation: <a href="https://github.com/abalter" target="_blank" rel="noopener">@abalter</a>, <a href="https://github.com/abichat" target="_blank" rel="noopener">@abichat</a>, <a href="https://github.com/adupaix" target="_blank" rel="noopener">@adupaix</a>, <a href="https://github.com/AlexBainton" target="_blank" rel="noopener">@AlexBainton</a>, <a href="https://github.com/alexmcsw" target="_blank" rel="noopener">@alexmcsw</a>, <a href="https://github.com/AltfunsMA" target="_blank" rel="noopener">@AltfunsMA</a>, <a href="https://github.com/AmeliaMN" target="_blank" rel="noopener">@AmeliaMN</a>, <a href="https://github.com/antdurrant" target="_blank" rel="noopener">@antdurrant</a>, <a href="https://github.com/AnthonyEbert" target="_blank" rel="noopener">@AnthonyEbert</a>, <a href="https://github.com/apalacio9502" target="_blank" rel="noopener">@apalacio9502</a>, <a href="https://github.com/apeterson91" target="_blank" rel="noopener">@apeterson91</a>, <a href="https://github.com/arnaudgallou" target="_blank" rel="noopener">@arnaudgallou</a>, <a href="https://github.com/awpsoras" target="_blank" rel="noopener">@awpsoras</a>, <a href="https://github.com/bakaburg1" target="_blank" rel="noopener">@bakaburg1</a>, <a href="https://github.com/barnabasharris" target="_blank" rel="noopener">@barnabasharris</a>, <a href="https://github.com/BHII-KSC" target="_blank" rel="noopener">@BHII-KSC</a>, <a href="https://github.com/bholtemeyer" target="_blank" rel="noopener">@bholtemeyer</a>, <a href="https://github.com/billdenney" target="_blank" rel="noopener">@billdenney</a>, <a href="https://github.com/bounlu" target="_blank" rel="noopener">@bounlu</a>, <a href="https://github.com/brendensm" target="_blank" rel="noopener">@brendensm</a>, <a href="https://github.com/bridroberts1" target="_blank" rel="noopener">@bridroberts1</a>, <a href="https://github.com/brookslogan" target="_blank" rel="noopener">@brookslogan</a>, <a href="https://github.com/catalamarti" target="_blank" rel="noopener">@catalamarti</a>, <a href="https://github.com/cboettig" target="_blank" rel="noopener">@cboettig</a>, <a href="https://github.com/cbrnr" target="_blank" rel="noopener">@cbrnr</a>, <a href="https://github.com/ccani007" target="_blank" rel="noopener">@ccani007</a>, <a href="https://github.com/charliejhadley" target="_blank" rel="noopener">@charliejhadley</a>, <a href="https://github.com/ChrisHIV" target="_blank" rel="noopener">@ChrisHIV</a>, <a href="https://github.com/ChristianRohde" target="_blank" rel="noopener">@ChristianRohde</a>, <a href="https://github.com/cobac" target="_blank" rel="noopener">@cobac</a>, <a href="https://github.com/conig" target="_blank" rel="noopener">@conig</a>, <a href="https://github.com/const-ae" target="_blank" rel="noopener">@const-ae</a>, <a href="https://github.com/Copilot" target="_blank" rel="noopener">@Copilot</a>, <a href="https://github.com/d-morrison" target="_blank" rel="noopener">@d-morrison</a>, <a href="https://github.com/DanChaltiel" target="_blank" rel="noopener">@DanChaltiel</a>, <a href="https://github.com/daniel-simeone" target="_blank" rel="noopener">@daniel-simeone</a>, <a href="https://github.com/DanielBraddock" target="_blank" rel="noopener">@DanielBraddock</a>, <a href="https://github.com/david-romano" target="_blank" rel="noopener">@david-romano</a>, <a href="https://github.com/davidrsch" target="_blank" rel="noopener">@davidrsch</a>, <a href="https://github.com/davidss101" target="_blank" rel="noopener">@davidss101</a>, <a href="https://github.com/DavisVaughan" target="_blank" rel="noopener">@DavisVaughan</a>, <a href="https://github.com/dcaud" target="_blank" rel="noopener">@dcaud</a>, <a href="https://github.com/deschen1" target="_blank" rel="noopener">@deschen1</a>, <a href="https://github.com/DesiQuintans" target="_blank" rel="noopener">@DesiQuintans</a>, <a href="https://github.com/devster31" target="_blank" rel="noopener">@devster31</a>, <a href="https://github.com/dkutner" target="_blank" rel="noopener">@dkutner</a>, <a href="https://github.com/dmuenz" target="_blank" rel="noopener">@dmuenz</a>, <a href="https://github.com/ds-jim" target="_blank" rel="noopener">@ds-jim</a>, <a href="https://github.com/eitsupi" target="_blank" rel="noopener">@eitsupi</a>, <a href="https://github.com/EmilHvitfeldt" target="_blank" rel="noopener">@EmilHvitfeldt</a>, <a href="https://github.com/etiennebacher" target="_blank" rel="noopener">@etiennebacher</a>, <a href="https://github.com/eutwt" target="_blank" rel="noopener">@eutwt</a>, <a href="https://github.com/EvertonTLima" target="_blank" rel="noopener">@EvertonTLima</a>, <a href="https://github.com/ferreirafm" target="_blank" rel="noopener">@ferreirafm</a>, <a href="https://github.com/gaborcsardi" target="_blank" rel="noopener">@gaborcsardi</a>, <a href="https://github.com/GabryS3" target="_blank" rel="noopener">@GabryS3</a>, <a href="https://github.com/Gastonia02" target="_blank" rel="noopener">@Gastonia02</a>, <a href="https://github.com/GBarnsley" target="_blank" rel="noopener">@GBarnsley</a>, <a href="https://github.com/gevro" target="_blank" rel="noopener">@gevro</a>, <a href="https://github.com/ggrothendieck" target="_blank" rel="noopener">@ggrothendieck</a>, <a href="https://github.com/GischD" target="_blank" rel="noopener">@GischD</a>, <a href="https://github.com/gks281263" target="_blank" rel="noopener">@gks281263</a>, <a href="https://github.com/gracehartley" target="_blank" rel="noopener">@gracehartley</a>, <a href="https://github.com/graphdr" target="_blank" rel="noopener">@graphdr</a>, <a href="https://github.com/hadley" target="_blank" rel="noopener">@hadley</a>, <a href="https://github.com/heliconone" target="_blank" rel="noopener">@heliconone</a>, <a href="https://github.com/Hzanib" target="_blank" rel="noopener">@Hzanib</a>, <a href="https://github.com/ilovemane" target="_blank" rel="noopener">@ilovemane</a>, <a href="https://github.com/ja-ortiz-uniandes" target="_blank" rel="noopener">@ja-ortiz-uniandes</a>, <a href="https://github.com/jack-davison" target="_blank" rel="noopener">@jack-davison</a>, <a href="https://github.com/james-kilgour" target="_blank" rel="noopener">@james-kilgour</a>, <a href="https://github.com/JamesHWade" target="_blank" rel="noopener">@JamesHWade</a>, <a href="https://github.com/jaymicro" target="_blank" rel="noopener">@jaymicro</a>, <a href="https://github.com/JBrandenburg02" target="_blank" rel="noopener">@JBrandenburg02</a>, <a href="https://github.com/jc-usda" target="_blank" rel="noopener">@jc-usda</a>, <a href="https://github.com/jennybc" target="_blank" rel="noopener">@jennybc</a>, <a href="https://github.com/jeroenjanssens" target="_blank" rel="noopener">@jeroenjanssens</a>, <a href="https://github.com/jestover" target="_blank" rel="noopener">@jestover</a>, <a href="https://github.com/jl5000" target="_blank" rel="noopener">@jl5000</a>, <a href="https://github.com/jmbarbone" target="_blank" rel="noopener">@jmbarbone</a>, <a href="https://github.com/john-b-edwards" target="_blank" rel="noopener">@john-b-edwards</a>, <a href="https://github.com/jordanmross" target="_blank" rel="noopener">@jordanmross</a>, <a href="https://github.com/joshua-theisen" target="_blank" rel="noopener">@joshua-theisen</a>, <a href="https://github.com/jrwinget" target="_blank" rel="noopener">@jrwinget</a>, <a href="https://github.com/juliaapolonio" target="_blank" rel="noopener">@juliaapolonio</a>, <a href="https://github.com/jxu" target="_blank" rel="noopener">@jxu</a>, <a href="https://github.com/KaiAragaki" target="_blank" rel="noopener">@KaiAragaki</a>, <a href="https://github.com/kiki830621" target="_blank" rel="noopener">@kiki830621</a>, <a href="https://github.com/KittJonathan" target="_blank" rel="noopener">@KittJonathan</a>, <a href="https://github.com/kleinerChemiker" target="_blank" rel="noopener">@kleinerChemiker</a>, <a href="https://github.com/kletts" target="_blank" rel="noopener">@kletts</a>, <a href="https://github.com/krlmlr" target="_blank" rel="noopener">@krlmlr</a>, <a href="https://github.com/ks8997" target="_blank" rel="noopener">@ks8997</a>, <a href="https://github.com/kylebutts" target="_blank" rel="noopener">@kylebutts</a>, <a href="https://github.com/larsentom" target="_blank" rel="noopener">@larsentom</a>, <a href="https://github.com/latot" target="_blank" rel="noopener">@latot</a>, <a href="https://github.com/lboller-pwbm" target="_blank" rel="noopener">@lboller-pwbm</a>, <a href="https://github.com/lionel-" target="_blank" rel="noopener">@lionel-</a>, <a href="https://github.com/Longfei2" target="_blank" rel="noopener">@Longfei2</a>, <a href="https://github.com/lschneiderbauer" target="_blank" rel="noopener">@lschneiderbauer</a>, <a href="https://github.com/LukasTang" target="_blank" rel="noopener">@LukasTang</a>, <a href="https://github.com/lukebandy" target="_blank" rel="noopener">@lukebandy</a>, <a href="https://github.com/maciekbanas" target="_blank" rel="noopener">@maciekbanas</a>, <a href="https://github.com/maelle" target="_blank" rel="noopener">@maelle</a>, <a href="https://github.com/marcuslehr" target="_blank" rel="noopener">@marcuslehr</a>, <a href="https://github.com/Mark-AP" target="_blank" rel="noopener">@Mark-AP</a>, <a href="https://github.com/markwestcott34" target="_blank" rel="noopener">@markwestcott34</a>, <a href="https://github.com/maskegger" target="_blank" rel="noopener">@maskegger</a>, <a href="https://github.com/matiasandina" target="_blank" rel="noopener">@matiasandina</a>, <a href="https://github.com/matthewjnield" target="_blank" rel="noopener">@matthewjnield</a>, <a href="https://github.com/mbcann01" target="_blank" rel="noopener">@mbcann01</a>, <a href="https://github.com/Meghansaha" target="_blank" rel="noopener">@Meghansaha</a>, <a href="https://github.com/metanoid" target="_blank" rel="noopener">@metanoid</a>, <a href="https://github.com/MichaelChirico" target="_blank" rel="noopener">@MichaelChirico</a>, <a href="https://github.com/MikeJohnPage" target="_blank" rel="noopener">@MikeJohnPage</a>, <a href="https://github.com/MilesMcBain" target="_blank" rel="noopener">@MilesMcBain</a>, <a href="https://github.com/mine-cetinkaya-rundel" target="_blank" rel="noopener">@mine-cetinkaya-rundel</a>, <a href="https://github.com/MohsenSoltanifar" target="_blank" rel="noopener">@MohsenSoltanifar</a>, <a href="https://github.com/moodymudskipper" target="_blank" rel="noopener">@moodymudskipper</a>, <a href="https://github.com/Moohan" target="_blank" rel="noopener">@Moohan</a>, <a href="https://github.com/mp8" target="_blank" rel="noopener">@mp8</a>, <a href="https://github.com/mpsturbo" target="_blank" rel="noopener">@mpsturbo</a>, <a href="https://github.com/mr-c" target="_blank" rel="noopener">@mr-c</a>, <a href="https://github.com/muschellij2" target="_blank" rel="noopener">@muschellij2</a>, <a href="https://github.com/musvaage" target="_blank" rel="noopener">@musvaage</a>, <a href="https://github.com/Mzhuk7" target="_blank" rel="noopener">@Mzhuk7</a>, <a href="https://github.com/nalimilan" target="_blank" rel="noopener">@nalimilan</a>, <a href="https://github.com/nathanhaigh" target="_blank" rel="noopener">@nathanhaigh</a>, <a href="https://github.com/nirguk" target="_blank" rel="noopener">@nirguk</a>, <a href="https://github.com/nmercadeb" target="_blank" rel="noopener">@nmercadeb</a>, <a href="https://github.com/olivermagnanimous" target="_blank" rel="noopener">@olivermagnanimous</a>, <a href="https://github.com/olivroy" target="_blank" rel="noopener">@olivroy</a>, <a href="https://github.com/orgadish" target="_blank" rel="noopener">@orgadish</a>, <a href="https://github.com/pangchaoran" target="_blank" rel="noopener">@pangchaoran</a>, <a href="https://github.com/paschatz" target="_blank" rel="noopener">@paschatz</a>, <a href="https://github.com/prubin73" target="_blank" rel="noopener">@prubin73</a>, <a href="https://github.com/PStaus" target="_blank" rel="noopener">@PStaus</a>, <a href="https://github.com/psychelzh" target="_blank" rel="noopener">@psychelzh</a>, <a href="https://github.com/py9mrg" target="_blank" rel="noopener">@py9mrg</a>, <a href="https://github.com/Raesu" target="_blank" rel="noopener">@Raesu</a>, <a href="https://github.com/randyzwitch" target="_blank" rel="noopener">@randyzwitch</a>, <a href="https://github.com/Raoul-Kima" target="_blank" rel="noopener">@Raoul-Kima</a>, <a href="https://github.com/ReedMerrill" target="_blank" rel="noopener">@ReedMerrill</a>, <a href="https://github.com/RodDalBen" target="_blank" rel="noopener">@RodDalBen</a>, <a href="https://github.com/RodrigoZepeda" target="_blank" rel="noopener">@RodrigoZepeda</a>, <a href="https://github.com/rossholmberg" target="_blank" rel="noopener">@rossholmberg</a>, <a href="https://github.com/RoyalTS" target="_blank" rel="noopener">@RoyalTS</a>, <a href="https://github.com/ryandward" target="_blank" rel="noopener">@ryandward</a>, <a href="https://github.com/sbanville-delfi" target="_blank" rel="noopener">@sbanville-delfi</a>, <a href="https://github.com/ScientiaFelis" target="_blank" rel="noopener">@ScientiaFelis</a>, <a href="https://github.com/shirdekel" target="_blank" rel="noopener">@shirdekel</a>, <a href="https://github.com/slager" target="_blank" rel="noopener">@slager</a>, <a href="https://github.com/sschooler" target="_blank" rel="noopener">@sschooler</a>, <a href="https://github.com/steffen-stell" target="_blank" rel="noopener">@steffen-stell</a>, <a href="https://github.com/szimmer" target="_blank" rel="noopener">@szimmer</a>, <a href="https://github.com/TheClownBongo" target="_blank" rel="noopener">@TheClownBongo</a>, <a href="https://github.com/thomasjwood" target="_blank" rel="noopener">@thomasjwood</a>, <a href="https://github.com/TimTaylor" target="_blank" rel="noopener">@TimTaylor</a>, <a href="https://github.com/tlyons253" target="_blank" rel="noopener">@tlyons253</a>, <a href="https://github.com/tomalrussell" target="_blank" rel="noopener">@tomalrussell</a>, <a href="https://github.com/tomwagstaff-opml" target="_blank" rel="noopener">@tomwagstaff-opml</a>, <a href="https://github.com/torfason" target="_blank" rel="noopener">@torfason</a>, <a href="https://github.com/Tyrrx" target="_blank" rel="noopener">@Tyrrx</a>, <a href="https://github.com/Unaimend" target="_blank" rel="noopener">@Unaimend</a>, <a href="https://github.com/VisruthSK" target="_blank" rel="noopener">@VisruthSK</a>, <a href="https://github.com/vorpalvorpal" target="_blank" rel="noopener">@vorpalvorpal</a>, <a href="https://github.com/walkerjameschris" target="_blank" rel="noopener">@walkerjameschris</a>, <a href="https://github.com/wbvguo" target="_blank" rel="noopener">@wbvguo</a>, <a href="https://github.com/wbzyl" target="_blank" rel="noopener">@wbzyl</a>, <a href="https://github.com/wkumler" target="_blank" rel="noopener">@wkumler</a>, <a href="https://github.com/yaboody" target="_blank" rel="noopener">@yaboody</a>, <a href="https://github.com/yjunechoe" target="_blank" rel="noopener">@yjunechoe</a>, <a href="https://github.com/ynsec37" target="_blank" rel="noopener">@ynsec37</a>, <a href="https://github.com/ywhcuhk" target="_blank" rel="noopener">@ywhcuhk</a>, <a href="https://github.com/ZHBHSMILE" target="_blank" rel="noopener">@ZHBHSMILE</a>, <a href="https://github.com/zhjx19" target="_blank" rel="noopener">@zhjx19</a>, and <a href="https://github.com/ZIBOWANGKANGYU" target="_blank" rel="noopener">@ZIBOWANGKANGYU</a>.</p>
]]></description>
      <enclosure url="https://opensource.posit.co/blog/2026-02-04_dplyr-1-2-0/thumbnail-wd.jpg" length="338917" type="image/jpeg" />
    </item>
    <item>
      <title>purrr 1.2.0</title>
      <link>https://opensource.posit.co/blog/2025-11-04_purrr-1-2-0/</link>
      <pubDate>Tue, 04 Nov 2025 00:00:00 +0000</pubDate>
      <guid>https://opensource.posit.co/blog/2025-11-04_purrr-1-2-0/</guid>
      <dc:creator>Hadley Wickham</dc:creator><description><![CDATA[<!--
TODO:
* [x] Look over / edit the post's title in the yaml
* [x] Edit (or delete) the description; note this appears in the Twitter card
* [x] Pick category and tags (see existing with [`hugodown::tidy_show_meta()`](https://rdrr.io/pkg/hugodown/man/use_tidy_post.html))
* [x] Find photo & update yaml metadata
* [x] Create `thumbnail-sq.jpg`; height and width should be equal
* [x] Create `thumbnail-wd.jpg`; width should be >5x height
* [x] [`hugodown::use_tidy_thumbnails()`](https://rdrr.io/pkg/hugodown/man/use_tidy_post.html)
* [x] Add intro sentence, e.g. the standard tagline for the package
* [ ] [`usethis::use_tidy_thanks()`](https://usethis.r-lib.org/reference/use_tidy_thanks.html)
-->
<p>We&rsquo;re thrilled to announce the release of purrr 1.2.0! purrr enhances R&rsquo;s functional programming toolkit with a complete and consistent set of tools for working with functions and vectors.</p>
<p>You can install it from CRAN with:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nf'><a href='https://rdrr.io/r/utils/install.packages.html'>install.packages</a></span><span class='o'>(</span><span class='s'>"purrr"</span><span class='o'>)</span></span></code></pre>
</div>
<p>Overall, this is a pretty unexciting release since it primarily focuses on removing long-deprecated functions. It does, however, include a couple of small performance improvements to predicate functions and a brand new getting started vignette. We also require a newer version of the carrier package for <a href="https://purrr.tidyverse.org/reference/in_parallel.html" target="_blank" rel="noopener"><code>in_parallel()</code></a> so that it&rsquo;s easier to use. You can see a full list of changes in the <a href="https://github.com/tidyverse/purrr/releases/tag/v1.2.0" target="_blank" rel="noopener">release notes</a>.</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='kr'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='o'>(</span><span class='nv'><a href='https://purrr.tidyverse.org/'>purrr</a></span><span class='o'>)</span></span></code></pre>
</div>
<h2 id="lifecycle-changes">Lifecycle changes
</h2>
<ul>
<li>
<p>All functions and arguments that were deprecated in purrr 0.3.0 have now been removed after being deprecated for over 5 years. These include:</p>
<ul>
<li><code>%@%</code></li>
<li><code>accumulate_right()</code></li>
<li><code>at_depth()</code></li>
<li><code>cross_d()</code></li>
<li><code>cross_n()</code></li>
<li><code>reduce2_right()</code></li>
<li><code>reduce_right()</code></li>
</ul>
</li>
<li>
<p>All functions that were soft-deprecated in purrr 1.0.0 are now fully deprecated. They will continue to work but will generate a deprecation warning, and will be removed in a future release. This includes:</p>
<ul>
<li><code>invoke_*()</code> functions</li>
<li><code>lift_*()</code> functions</li>
<li><code>cross*()</code> functions (use <a href="https://tidyr.tidyverse.org/reference/expand_grid.html" target="_blank" rel="noopener"><code>tidyr::expand_grid()</code></a> instead)</li>
<li><a href="https://purrr.tidyverse.org/reference/prepend.html" target="_blank" rel="noopener"><code>prepend()</code></a></li>
<li><code>splice()</code></li>
<li><a href="https://purrr.tidyverse.org/reference/rbernoulli.html" target="_blank" rel="noopener"><code>rbernoulli()</code></a></li>
<li><a href="https://purrr.tidyverse.org/reference/rdunif.html" target="_blank" rel="noopener"><code>rdunif()</code></a></li>
<li><a href="https://purrr.tidyverse.org/reference/when.html" target="_blank" rel="noopener"><code>when()</code></a></li>
<li><a href="https://purrr.tidyverse.org/reference/update_list.html" target="_blank" rel="noopener"><code>update_list()</code></a></li>
<li><code>*_raw()</code> functions</li>
<li><a href="https://purrr.tidyverse.org/reference/pluck_depth.html" target="_blank" rel="noopener"><code>vec_depth()</code></a></li>
</ul>
<p>These deprecations help keep purrr focused on its core purpose: facilitating functional programming in R.</p>
</li>
<li>
<p><a href="https://purrr.tidyverse.org/reference/map.html" target="_blank" rel="noopener"><code>map_chr()</code></a> no longer automatically coerces logical, integer, or double values to strings. Previously, this coercion happened silently, which could mask bugs in your code. Of the four CRAN packages that required fixes due to this change, two of them (50%) were bugs.</p>
</li>
<li>
<p>The predicate functions <a href="https://purrr.tidyverse.org/reference/every.html" target="_blank" rel="noopener"><code>every()</code></a>, <a href="https://purrr.tidyverse.org/reference/every.html" target="_blank" rel="noopener"><code>some()</code></a>, and <a href="https://purrr.tidyverse.org/reference/every.html" target="_blank" rel="noopener"><code>none()</code></a> now require that the predicate function <code>.p</code> returns a logical scalar: <code>TRUE</code>, <code>FALSE</code>, or <code>NA</code>. Previously, <code>NA</code> values of other types (like <code>NA_integer_</code> or <code>NA_character_</code>) were allowed.</p>
</li>
</ul>
<h2 id="minor-improvements">Minor improvements
</h2>
<p>Apart from all the breaking changes, there were a couple of small improvements:</p>
<ul>
<li>
<p><a href="https://purrr.tidyverse.org/reference/every.html" target="_blank" rel="noopener"><code>every()</code></a>, <a href="https://purrr.tidyverse.org/reference/every.html" target="_blank" rel="noopener"><code>some()</code></a>, and <a href="https://purrr.tidyverse.org/reference/every.html" target="_blank" rel="noopener"><code>none()</code></a> have been optimized and are now significantly faster. They&rsquo;re now as fast as or faster than the equivalent <code>any(map_lgl())</code> or <code>all(map_lgl())</code> calls, making them the preferred choice for checking predicates across lists.</p>
</li>
<li>
<p>purrr (finally) has a &ldquo;getting started&rdquo; vignette at <code>vignette(&quot;purrr&quot;)</code>.</p>
</li>
</ul>
<h2 id="easier-in_parallel">Easier <code>in_parallel()</code>
</h2>
<p>In purrr 1.1.0, we introduced <a href="https://purrr.tidyverse.org/reference/in_parallel.html" target="_blank" rel="noopener"><code>in_parallel()</code></a> for <a href="https://opensource.posit.co/blog/2025-07-10_purrr-1-1-0-parallel/">parallel processing</a> and we&rsquo;ve had great feedback from the community so far. But it was clear that we hadn&rsquo;t made it easy enough to include helper functions or other variables required by your map functions. We&rsquo;ve updated this behaviour in carrier 0.3.0, which is now required by purrr. Now the following (in your global environment) will work as you expect:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>fn</span> <span class='o'>&lt;-</span> <span class='kr'>function</span><span class='o'>(</span><span class='nv'>x</span><span class='o'>)</span> <span class='nf'>helper_fn</span><span class='o'>(</span><span class='nv'>x</span><span class='o'>)</span> <span class='o'>*</span> <span class='m'>2</span></span>
<span><span class='nv'>helper_fn</span> <span class='o'>&lt;-</span> <span class='kr'>function</span><span class='o'>(</span><span class='nv'>x</span><span class='o'>)</span> <span class='nv'>x</span> <span class='o'>+</span> <span class='m'>1</span></span>
<span><span class='m'>1</span><span class='o'>:</span><span class='m'>5</span> <span class='o'>|&gt;</span> <span class='nf'><a href='https://purrr.tidyverse.org/reference/map.html'>map</a></span><span class='o'>(</span><span class='nf'><a href='https://purrr.tidyverse.org/reference/in_parallel.html'>in_parallel</a></span><span class='o'>(</span>\<span class='o'>(</span><span class='nv'>x</span><span class='o'>)</span> <span class='nf'>fn</span><span class='o'>(</span><span class='nv'>x</span><span class='o'>)</span>, fn <span class='o'>=</span> <span class='nv'>fn</span>, helper_fn <span class='o'>=</span> <span class='nv'>helper_fn</span><span class='o'>)</span><span class='o'>)</span></span></code></pre>
</div>
<p>Whereas previously, <code>fn()</code> would have been unable to find <code>helper_fn()</code>, this is solved by all functions passed to <a href="https://purrr.tidyverse.org/reference/in_parallel.html" target="_blank" rel="noopener"><code>in_parallel()</code></a> now sharing the same environment.</p>
<h2 id="acknowledgements">Acknowledgements
</h2>
<p>We&rsquo;d like to thank everyone who contributed to this release by filing issues and submitting pull requests. Your feedback and contributions help make purrr better for everyone! <a href="https://github.com/feinleib" target="_blank" rel="noopener">@feinleib</a>, <a href="https://github.com/filipemsc" target="_blank" rel="noopener">@filipemsc</a>, <a href="https://github.com/fwimp" target="_blank" rel="noopener">@fwimp</a>, <a href="https://github.com/hadley" target="_blank" rel="noopener">@hadley</a>, <a href="https://github.com/its-gazza" target="_blank" rel="noopener">@its-gazza</a>, <a href="https://github.com/jcolt45" target="_blank" rel="noopener">@jcolt45</a>, <a href="https://github.com/jeroenjanssens" target="_blank" rel="noopener">@jeroenjanssens</a>, <a href="https://github.com/jrwinget" target="_blank" rel="noopener">@jrwinget</a>, <a href="https://github.com/khusmann" target="_blank" rel="noopener">@khusmann</a>, <a href="https://github.com/luisDVA" target="_blank" rel="noopener">@luisDVA</a>, <a href="https://github.com/MarkPaulin" target="_blank" rel="noopener">@MarkPaulin</a>, <a href="https://github.com/Meghansaha" target="_blank" rel="noopener">@Meghansaha</a>, <a href="https://github.com/mtcarsalot" target="_blank" rel="noopener">@mtcarsalot</a>, <a href="https://github.com/og2293" target="_blank" rel="noopener">@og2293</a>, <a href="https://github.com/padpadpadpad" target="_blank" rel="noopener">@padpadpadpad</a>, <a href="https://github.com/PMassicotte" target="_blank" rel="noopener">@PMassicotte</a>, <a href="https://github.com/shikokuchuo" target="_blank" rel="noopener">@shikokuchuo</a>, <a href="https://github.com/steffen-stell" target="_blank" rel="noopener">@steffen-stell</a>, and <a href="https://github.com/wahalulu" target="_blank" rel="noopener">@wahalulu</a>.</p>
]]></description>
      <enclosure url="https://opensource.posit.co/blog/2025-11-04_purrr-1-2-0/thumbnail-wd.jpg" length="256333" type="image/jpeg" />
    </item>
    <item>
      <title>stringr 1.6.0</title>
      <link>https://opensource.posit.co/blog/2025-11-04_stringr-1-6-0/</link>
      <pubDate>Tue, 04 Nov 2025 00:00:00 +0000</pubDate>
      <guid>https://opensource.posit.co/blog/2025-11-04_stringr-1-6-0/</guid>
      <dc:creator>Hadley Wickham</dc:creator><description><![CDATA[<!--
TODO:
* [x] Look over / edit the post's title in the yaml
* [x] Edit (or delete) the description; note this appears in the Twitter card
* [x] Pick category and tags (see existing with [`hugodown::tidy_show_meta()`](https://rdrr.io/pkg/hugodown/man/use_tidy_post.html))
* [x] Find photo & update yaml metadata
* [x] Create `thumbnail-sq.jpg`; height and width should be equal
* [x] Create `thumbnail-wd.jpg`; width should be >5x height
* [x] [`hugodown::use_tidy_thumbnails()`](https://rdrr.io/pkg/hugodown/man/use_tidy_post.html)
* [x] Add intro sentence, e.g. the standard tagline for the package
* [ ] [`usethis::use_tidy_thanks()`](https://usethis.r-lib.org/reference/use_tidy_thanks.html)
-->
<p>We&rsquo;re delighted to announce the release of stringr 1.6.0! stringr provides a cohesive set of functions designed to make working with strings as easy as possible. You can install it from CRAN with:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nf'><a href='https://rdrr.io/r/utils/install.packages.html'>install.packages</a></span><span class='o'>(</span><span class='s'>"stringr"</span><span class='o'>)</span></span></code></pre>
</div>
<p>This release includes some lifecycle changes, improvements to <code>sql_like()</code>/<code>sql_ilike()</code>, and a handful of other useful features. You can see a full list of changes in the <a href="https://github.com/tidyverse/stringr/releases/tag/v1.6.0" target="_blank" rel="noopener">release notes</a>.</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='kr'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='o'>(</span><span class='nv'><a href='https://stringr.tidyverse.org'>stringr</a></span><span class='o'>)</span></span></code></pre>
</div>
<h2 id="lifecycle-changes">Lifecycle changes
</h2>
<p>This release includes two lifecycle changes that may affect existing code.</p>
<p>First, the <code>ignore_case</code> argument to <a href="https://stringr.tidyverse.org/reference/str_like.html" target="_blank" rel="noopener"><code>str_like()</code></a> is now deprecated. Previously, it defaulted to <code>ignore_case = TRUE</code>. This was a mistake because it doesn&rsquo;t align with the conventions of the SQL <code>LIKE</code> operator, which is always case sensitive. Going forward, <a href="https://stringr.tidyverse.org/reference/str_like.html" target="_blank" rel="noopener"><code>str_like()</code></a> will always be case sensitive, so if you need case-insensitive matching, use the new <a href="https://stringr.tidyverse.org/reference/str_like.html" target="_blank" rel="noopener"><code>str_ilike()</code></a> function.</p>
<p>Second, if you use <a href="https://stringr.tidyverse.org/reference/str_replace.html" target="_blank" rel="noopener"><code>str_replace_all()</code></a> with a function for the <code>replacement</code> argument, that function now receives all values in a single character vector instead of being called once for each individual string. This change dramatically improves performance, so I decided it was worth it despite its impact on existing code. It shouldn&rsquo;t affect too much existing code in the wild, and it only broke 11 of the 2,381 CRAN packages that use stringr (which I fixed via PR). If you haven&rsquo;t used this functionality before, it&rsquo;s pretty cool, because it allows you to supply a function that can transform matches in any way you can imagine. For example, this code replaces color names with their corresponding hex values:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>colours</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://stringr.tidyverse.org/reference/str_c.html'>str_c</a></span><span class='o'>(</span><span class='s'>"\\b"</span>, <span class='nf'><a href='https://rdrr.io/r/grDevices/colors.html'>colors</a></span><span class='o'>(</span><span class='o'>)</span>, <span class='s'>"\\b"</span>, collapse <span class='o'>=</span> <span class='s'>"|"</span><span class='o'>)</span></span>
<span><span class='nv'>col2hex</span> <span class='o'>&lt;-</span> <span class='kr'>function</span><span class='o'>(</span><span class='nv'>col</span><span class='o'>)</span> <span class='o'>&#123;</span></span>
<span>  <span class='nv'>rgb</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/grDevices/col2rgb.html'>col2rgb</a></span><span class='o'>(</span><span class='nv'>col</span><span class='o'>)</span></span>
<span>  <span class='nf'><a href='https://rdrr.io/r/grDevices/rgb.html'>rgb</a></span><span class='o'>(</span><span class='nv'>rgb</span><span class='o'>[</span><span class='s'>"red"</span>, <span class='o'>]</span>, <span class='nv'>rgb</span><span class='o'>[</span><span class='s'>"green"</span>, <span class='o'>]</span>, <span class='nv'>rgb</span><span class='o'>[</span><span class='s'>"blue"</span>, <span class='o'>]</span>, maxColorValue <span class='o'>=</span> <span class='m'>255</span><span class='o'>)</span></span>
<span><span class='o'>&#125;</span></span>
<span></span>
<span><span class='c'># by Claude Code</span></span>
<span><span class='nv'>poem</span> <span class='o'>&lt;-</span> <span class='s'>"Azure skies meet honeydew light,</span></span>
<span><span class='s'>While coral blooms kiss morning's face.</span></span>
<span><span class='s'>Gold spills across the wheat-field bright,</span></span>
<span><span class='s'>As lavender shadows lose their place.</span></span>
<span><span class='s'>Turquoise waters catch the sun,</span></span>
<span><span class='s'>Where salmon leap through chartreuse streams.</span></span>
<span><span class='s'>Orchid petals, one by one,</span></span>
<span><span class='s'>Fall like plum-soft summer dreams.</span></span>
<span><span class='s'>"</span></span>
<span><span class='nf'><a href='https://rdrr.io/r/base/cat.html'>cat</a></span><span class='o'>(</span><span class='nf'><a href='https://stringr.tidyverse.org/reference/str_replace.html'>str_replace_all</a></span><span class='o'>(</span><span class='nv'>poem</span>, <span class='nf'><a href='https://stringr.tidyverse.org/reference/modifiers.html'>regex</a></span><span class='o'>(</span><span class='nv'>colours</span>, ignore_case <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span>, <span class='nv'>col2hex</span><span class='o'>)</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; #F0FFFF skies meet #F0FFF0 light,</span></span>
<span><span class='c'>#&gt; While #FF7F50 blooms kiss morning's face.</span></span>
<span><span class='c'>#&gt; #FFD700 spills across the #F5DEB3-field bright,</span></span>
<span><span class='c'>#&gt; As #E6E6FA shadows lose their place.</span></span>
<span><span class='c'>#&gt; #40E0D0 waters catch the sun,</span></span>
<span><span class='c'>#&gt; Where #FA8072 leap through #7FFF00 streams.</span></span>
<span><span class='c'>#&gt; #DA70D6 petals, one by one,</span></span>
<span><span class='c'>#&gt; Fall like #DDA0DD-soft summer dreams.</span></span>
<span></span></code></pre>
</div>
<p>Which version do you think is catchier? 🤣</p>
<h2 id="other-improvements">Other improvements
</h2>
<p>This release includes several other useful enhancements:</p>
<ul>
<li>
<p>Three new functions make it easy to convert between different programming case conventions:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>x</span> <span class='o'>&lt;-</span> <span class='s'>"quick brown fox"</span></span>
<span></span>
<span><span class='nf'><a href='https://stringr.tidyverse.org/reference/str_to_camel.html'>str_to_camel</a></span><span class='o'>(</span><span class='nv'>x</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; [1] "quickBrownFox"</span></span>
<span></span><span><span class='nf'><a href='https://stringr.tidyverse.org/reference/str_to_camel.html'>str_to_camel</a></span><span class='o'>(</span><span class='nv'>x</span>, first_upper <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; [1] "QuickBrownFox"</span></span>
<span></span><span><span class='nf'><a href='https://stringr.tidyverse.org/reference/str_to_camel.html'>str_to_snake</a></span><span class='o'>(</span><span class='nv'>x</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; [1] "quick_brown_fox"</span></span>
<span></span><span><span class='nf'><a href='https://stringr.tidyverse.org/reference/str_to_camel.html'>str_to_kebab</a></span><span class='o'>(</span><span class='nv'>x</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; [1] "quick-brown-fox"</span></span>
<span></span></code></pre>
</div>
</li>
<li>
<p>All relevant stringr functions now preserve names. This means if your input vector has names, those names will be preserved in the output:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>x</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span>first <span class='o'>=</span> <span class='s'>"apple"</span>, second <span class='o'>=</span> <span class='s'>"banana"</span><span class='o'>)</span></span>
<span><span class='nf'><a href='https://stringr.tidyverse.org/reference/case.html'>str_to_upper</a></span><span class='o'>(</span><span class='nv'>x</span><span class='o'>)</span></span>
<span><span class='c'>#&gt;    first   second </span></span>
<span><span class='c'>#&gt;  "APPLE" "BANANA"</span></span>
<span></span><span><span class='nf'><a href='https://stringr.tidyverse.org/reference/str_detect.html'>str_detect</a></span><span class='o'>(</span><span class='nv'>x</span>, <span class='s'>"b"</span><span class='o'>)</span></span>
<span><span class='c'>#&gt;  first second </span></span>
<span><span class='c'>#&gt;  FALSE   TRUE</span></span>
<span></span></code></pre>
</div>
</li>
<li>
<p>A new <code>vignette(&quot;locale-sensitive&quot;)</code> provides detailed information about locale-sensitive functions in stringr, helping you understand how different locales affect string operations like sorting and case conversion.</p>
</li>
</ul>
<h2 id="acknowledgements">Acknowledgements
</h2>
<p>A big thank you to everyone who contributed to this release! <a href="https://github.com/alexanderbeatson" target="_blank" rel="noopener">@alexanderbeatson</a>, <a href="https://github.com/allenbaron" target="_blank" rel="noopener">@allenbaron</a>, <a href="https://github.com/Anaherasm" target="_blank" rel="noopener">@Anaherasm</a>, <a href="https://github.com/arnaudgallou" target="_blank" rel="noopener">@arnaudgallou</a>, <a href="https://github.com/AustinFournierKL" target="_blank" rel="noopener">@AustinFournierKL</a>, <a href="https://github.com/brownj31" target="_blank" rel="noopener">@brownj31</a>, <a href="https://github.com/ChristelSwift" target="_blank" rel="noopener">@ChristelSwift</a>, <a href="https://github.com/DanChaltiel" target="_blank" rel="noopener">@DanChaltiel</a>, <a href="https://github.com/davidciani" target="_blank" rel="noopener">@davidciani</a>, <a href="https://github.com/davidhodge931" target="_blank" rel="noopener">@davidhodge931</a>, <a href="https://github.com/Edgar-Zamora" target="_blank" rel="noopener">@Edgar-Zamora</a>, <a href="https://github.com/edward-burn" target="_blank" rel="noopener">@edward-burn</a>, <a href="https://github.com/gaborcsardi" target="_blank" rel="noopener">@gaborcsardi</a>, <a href="https://github.com/hadley" target="_blank" rel="noopener">@hadley</a>, <a href="https://github.com/jack-davison" target="_blank" rel="noopener">@jack-davison</a>, <a href="https://github.com/jdonland" target="_blank" rel="noopener">@jdonland</a>, <a href="https://github.com/jeroenjanssens" target="_blank" rel="noopener">@jeroenjanssens</a>, <a href="https://github.com/JFormoso" target="_blank" rel="noopener">@JFormoso</a>, <a href="https://github.com/jonovik" target="_blank" rel="noopener">@jonovik</a>, <a href="https://github.com/KimLopezGuell" target="_blank" rel="noopener">@KimLopezGuell</a>, <a href="https://github.com/krlmlr" target="_blank" rel="noopener">@krlmlr</a>, <a href="https://github.com/kylieainslie" target="_blank" rel="noopener">@kylieainslie</a>, <a href="https://github.com/librill" target="_blank" rel="noopener">@librill</a>, <a href="https://github.com/Longfei2" target="_blank" rel="noopener">@Longfei2</a>, <a href="https://github.com/LouisMPenrod" target="_blank" rel="noopener">@LouisMPenrod</a>, <a href="https://github.com/mararva" target="_blank" rel="noopener">@mararva</a>, <a href="https://github.com/mgacc0" target="_blank" rel="noopener">@mgacc0</a>, <a href="https://github.com/MiguelCos" target="_blank" rel="noopener">@MiguelCos</a>, <a href="https://github.com/nash-delcamp-slp" target="_blank" rel="noopener">@nash-delcamp-slp</a>, <a href="https://github.com/ning-y" target="_blank" rel="noopener">@ning-y</a>, <a href="https://github.com/Rekyt" target="_blank" rel="noopener">@Rekyt</a>, <a href="https://github.com/salim-b" target="_blank" rel="noopener">@salim-b</a>, <a href="https://github.com/shaggycamel" target="_blank" rel="noopener">@shaggycamel</a>, <a href="https://github.com/SoyAndrea" target="_blank" rel="noopener">@SoyAndrea</a>, <a href="https://github.com/tamimart" target="_blank" rel="noopener">@tamimart</a>, <a href="https://github.com/tvedebrink" target="_blank" rel="noopener">@tvedebrink</a>, <a href="https://github.com/VisruthSK" target="_blank" rel="noopener">@VisruthSK</a>, <a href="https://github.com/warnes" target="_blank" rel="noopener">@warnes</a>, and <a href="https://github.com/wright13" target="_blank" rel="noopener">@wright13</a>.</p>
]]></description>
      <enclosure url="https://opensource.posit.co/blog/2025-11-04_stringr-1-6-0/thumbnail-wd.jpg" length="148495" type="image/jpeg" />
    </item>
    <item>
      <title>httr2 1.2.0</title>
      <link>https://opensource.posit.co/blog/2025-07-14_httr2-1-2-0/</link>
      <pubDate>Mon, 14 Jul 2025 00:00:00 +0000</pubDate>
      <guid>https://opensource.posit.co/blog/2025-07-14_httr2-1-2-0/</guid>
      <dc:creator>Hadley Wickham</dc:creator><description><![CDATA[<!--
TODO:
* [x] Look over / edit the post's title in the yaml
* [x] Edit (or delete) the description; note this appears in the Twitter card
* [x] Pick category and tags (see existing with [`hugodown::tidy_show_meta()`](https://rdrr.io/pkg/hugodown/man/use_tidy_post.html))
* [x] Find photo & update yaml metadata
* [x] Create `thumbnail-sq.jpg`; height and width should be equal
* [x] Create `thumbnail-wd.jpg`; width should be >5x height
* [x] [`hugodown::use_tidy_thumbnails()`](https://rdrr.io/pkg/hugodown/man/use_tidy_post.html)
* [x] Add intro sentence, e.g. the standard tagline for the package
* [x] [`usethis::use_tidy_thanks()`](https://usethis.r-lib.org/reference/use_tidy_thanks.html)
-->
<h1 id="httr2-120">httr2 1.2.0
</h1>
<p>We&rsquo;re delighted to announce the release of httr2 1.2.0! httr2 (pronounced &ldquo;hitter2&rdquo;) is a comprehensive HTTP client that provides a modern, pipeable API for working with web APIs. It builds on top of {curl} to provide features like explicit request objects, built-in rate limiting &amp; retry tooling, comprehensive OAuth support, and secure handling of secrets and credentials.</p>
<p>You can install it from CRAN with:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">install.packages</span><span class="p">(</span><span class="s">&#34;httr2&#34;</span><span class="p">)</span></span></span></code></pre></div></div>
<p>This blog post will walk you through the most important changes in 1.2.0: lifecycle updates, improved security for redacted headers, URL handling improvements, improved debugging tools, and a handful of other quality of life improvements. You can see a full list of changes in the <a href="https://github.com/r-lib/httr2/releases/tag/v1.2.0" target="_blank" rel="noopener">release notes</a></p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='kr'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='o'>(</span><span class='nv'><a href='https://httr2.r-lib.org'>httr2</a></span><span class='o'>)</span></span></code></pre>
</div>
<h2 id="lifecycle-changes">Lifecycle changes
</h2>
<p>Part of httr2&rsquo;s continued evolution is phasing out features that we now believe were mistakes. In this release:</p>
<ul>
<li>
<p><a href="https://httr2.r-lib.org/reference/req_perform_stream.html" target="_blank" rel="noopener"><code>req_perform_stream()</code></a> has been soft deprecated (not just superseded) in favour of <a href="https://httr2.r-lib.org/reference/req_perform_connection.html" target="_blank" rel="noopener"><code>req_perform_connection()</code></a>.</p>
</li>
<li>
<p>Deprecated functions <code>multi_req_perform()</code>, <code>req_stream()</code>, <code>with_mock()</code>, and <code>local_mock()</code> have now been removed. Please use their modern replacements, <a href="https://httr2.r-lib.org/reference/req_perform_parallel.html" target="_blank" rel="noopener"><code>req_perform_parallel()</code></a>, <a href="https://httr2.r-lib.org/reference/req_perform_stream.html" target="_blank" rel="noopener"><code>req_perform_stream()</code></a>, <a href="https://httr2.r-lib.org/reference/with_mocked_responses.html" target="_blank" rel="noopener"><code>with_mocked_responses()</code></a>, and <a href="https://httr2.r-lib.org/reference/with_mocked_responses.html" target="_blank" rel="noopener"><code>local_mocked_responses()</code></a>, instead.</p>
</li>
<li>
<p>Deprecated arguments <code>req_perform_parallel(pool)</code>, <code>req_oauth_auth_code(host_name, host_ip, port)</code>, and <code>oauth_flow_auth_code(host_name, host_ip, port)</code> have been removed. Please use <code>req_perform_parallel(max_active)</code> and <code>req_oauth_auth_code(redirect_url)</code>/ <code>oauth_flow_auth_code(redirect_url)</code> instead.</p>
</li>
</ul>
<h2 id="enhanced-security-for-redacted-headers">Enhanced security for redacted headers
</h2>
<p>One of the most important improvements in this release improves the security of redacted headers. Redacted headers are used to conceal secrets, like API keys or passwords, that you don&rsquo;t want to accidentally reveal. For a long time, httr2 has automatically hidden these headers when you <a href="https://rdrr.io/r/base/print.html" target="_blank" rel="noopener"><code>print()</code></a> or <a href="https://rdrr.io/r/utils/str.html" target="_blank" rel="noopener"><code>str()</code></a> them, ensuring that they don&rsquo;t accidentally end up in log files. You can see this in action with the <code>Authorization</code> header, which httr2 now automatically redacts:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>req</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://httr2.r-lib.org/reference/request.html'>request</a></span><span class='o'>(</span><span class='s'>"http://example.com"</span><span class='o'>)</span> <span class='o'>|&gt;</span></span>
<span>  <span class='nf'><a href='https://httr2.r-lib.org/reference/req_auth_basic.html'>req_auth_basic</a></span><span class='o'>(</span><span class='s'>"username"</span>, <span class='s'>"password"</span><span class='o'>)</span></span>
<span></span>
<span><span class='nv'>req</span></span>
<span><span class='c'>#&gt; <span style='color: #0000BB;'>&lt;httr2_request&gt;</span></span></span>
<span><span class='c'>#&gt; <span style='font-weight: bold;'>GET</span> http://example.com</span></span>
<span><span class='c'>#&gt; <span style='font-weight: bold;'>Headers:</span></span></span>
<span><span class='c'>#&gt; * <span style='color: #00BB00;'>Authorization</span>: <span style='color: #555555;'>&lt;REDACTED&gt;</span></span></span>
<span><span class='c'>#&gt; <span style='font-weight: bold;'>Body</span>: empty</span></span>
<span></span><span><span class='nf'><a href='https://rdrr.io/r/utils/str.html'>str</a></span><span class='o'>(</span><span class='nv'>req</span><span class='o'>$</span><span class='nv'>headers</span><span class='o'>)</span></span>
<span><span class='c'>#&gt;  &lt;httr2_headers&gt;</span></span>
<span><span class='c'>#&gt;  $ Authorization: <span style='color: #555555;'>&lt;REDACTED&gt;</span></span></span>
<span></span><span><span class='nv'>req</span> <span class='o'>|&gt;</span> <span class='nf'><a href='https://httr2.r-lib.org/reference/req_dry_run.html'>req_dry_run</a></span><span class='o'>(</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; GET / HTTP/1.1</span></span>
<span><span class='c'>#&gt; <span style='font-weight: bold;'>accept</span>: */*</span></span>
<span><span class='c'>#&gt; <span style='font-weight: bold;'>accept-encoding</span>: deflate, gzip</span></span>
<span><span class='c'>#&gt; <span style='font-weight: bold;'>authorization</span>: <span style='color: #555555;'>&lt;REDACTED&gt;</span></span></span>
<span><span class='c'>#&gt; <span style='font-weight: bold;'>host</span>: example.com</span></span>
<span><span class='c'>#&gt; <span style='font-weight: bold;'>user-agent</span>: httr2/1.2.0 r-curl/6.4.0 libcurl/8.14.1</span></span>
<span></span></code></pre>
</div>
<p>(If for you do really need to see the redacted values you can get with a bit of extra effort: call the new <a href="https://httr2.r-lib.org/reference/req_get_headers.html" target="_blank" rel="noopener"><code>req_get_headers()</code></a> function with <code>redacted = &quot;reveal&quot;</code>.)</p>
<p>In httr2 1.2.0, we&rsquo;ve gone one step further, and prevented redacted headers from being saved to disk. Now if you save and reload a request, you&rsquo;ll notice that the redacted headers are no longer present:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>path</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/tempfile.html'>tempfile</a></span><span class='o'>(</span><span class='o'>)</span></span>
<span><span class='nf'><a href='https://rdrr.io/r/base/readRDS.html'>saveRDS</a></span><span class='o'>(</span><span class='nv'>req</span>, <span class='nv'>path</span><span class='o'>)</span></span>
<span></span>
<span><span class='nv'>req2</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://rdrr.io/r/base/readRDS.html'>readRDS</a></span><span class='o'>(</span><span class='nv'>path</span><span class='o'>)</span></span>
<span><span class='nv'>req2</span> <span class='o'>|&gt;</span> <span class='nf'><a href='https://httr2.r-lib.org/reference/req_dry_run.html'>req_dry_run</a></span><span class='o'>(</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; GET / HTTP/1.1</span></span>
<span><span class='c'>#&gt; <span style='font-weight: bold;'>accept</span>: */*</span></span>
<span><span class='c'>#&gt; <span style='font-weight: bold;'>accept-encoding</span>: deflate, gzip</span></span>
<span><span class='c'>#&gt; <span style='font-weight: bold;'>host</span>: example.com</span></span>
<span><span class='c'>#&gt; <span style='font-weight: bold;'>user-agent</span>: httr2/1.2.0 r-curl/6.4.0 libcurl/8.14.1</span></span>
<span></span></code></pre>
</div>
<p>This protects you from accidentally revealing your credentials if you save a request to disk. This is easier to do than you might expect because httr2 includes the request object in every response (since this makes debugging much easier). That means if you&rsquo;re caching a slow response, it&rsquo;s very easy to accidentally store a secret, potentially leaking secure values. (Don&rsquo;t ask me how I discovered this!)</p>
<h2 id="url-handling-improvements">URL handling improvements
</h2>
<p>URL construction is now powered by <a href="https://jeroen.r-universe.dev/curl/reference/curl_parse_url.html" target="_blank" rel="noopener"><code>curl::curl_modify_url()</code></a>, which correctly escapes the path component:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>req</span> <span class='o'>&lt;-</span> <span class='nf'><a href='https://httr2.r-lib.org/reference/request.html'>request</a></span><span class='o'>(</span><span class='s'>"https://api.example.com"</span><span class='o'>)</span></span>
<span><span class='nv'>req</span> <span class='o'>|&gt;</span> <span class='nf'><a href='https://httr2.r-lib.org/reference/req_url.html'>req_url_path</a></span><span class='o'>(</span><span class='s'>"/users/john doe/profile"</span><span class='o'>)</span> <span class='o'>|&gt;</span> <span class='nf'><a href='https://httr2.r-lib.org/reference/req_get_url.html'>req_get_url</a></span><span class='o'>(</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; [1] "https://api.example.com/users/john%20doe/profile"</span></span>
<span></span></code></pre>
</div>
<p>This means that <a href="https://httr2.r-lib.org/reference/req_url.html" target="_blank" rel="noopener"><code>req_url_path()</code></a> can now only affect the path component of the URL, not the query parameters. If you previously relied on this behaviour, you&rsquo;ll need to switch to <a href="https://httr2.r-lib.org/reference/req_url.html" target="_blank" rel="noopener"><code>req_url_query()</code></a>:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='c'># won't work any more:</span></span>
<span><span class='nv'>req</span> <span class='o'>|&gt;</span> </span>
<span>  <span class='nf'><a href='https://httr2.r-lib.org/reference/req_url.html'>req_url_path</a></span><span class='o'>(</span><span class='s'>"/users?name=john-doe"</span><span class='o'>)</span> <span class='o'>|&gt;</span> </span>
<span>  <span class='nf'><a href='https://httr2.r-lib.org/reference/req_get_url.html'>req_get_url</a></span><span class='o'>(</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; [1] "https://api.example.com/users%3Fname%3Djohn-doe"</span></span>
<span></span><span><span class='c'># so now do this:</span></span>
<span><span class='nv'>req</span> <span class='o'>|&gt;</span> </span>
<span>  <span class='nf'><a href='https://httr2.r-lib.org/reference/req_url.html'>req_url_path</a></span><span class='o'>(</span><span class='s'>"/users"</span><span class='o'>)</span> <span class='o'>|&gt;</span> </span>
<span>  <span class='nf'><a href='https://httr2.r-lib.org/reference/req_url.html'>req_url_query</a></span><span class='o'>(</span>name <span class='o'>=</span> <span class='s'>"john-doe"</span><span class='o'>)</span> <span class='o'>|&gt;</span> </span>
<span>  <span class='nf'><a href='https://httr2.r-lib.org/reference/req_get_url.html'>req_get_url</a></span><span class='o'>(</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; [1] "https://api.example.com/users?name=john-doe"</span></span>
<span></span></code></pre>
</div>
<h2 id="improved-debugging-tools">Improved debugging tools
</h2>
<p>The vast majority of modern APIs use JSON, so httr2 now includes a few features to make debugging those APIs a little easier:</p>
<ul>
<li><a href="https://httr2.r-lib.org/reference/last_response.html" target="_blank" rel="noopener"><code>last_request()</code></a> and <a href="https://httr2.r-lib.org/reference/last_response.html" target="_blank" rel="noopener"><code>last_response()</code></a> are now paired with <a href="https://httr2.r-lib.org/reference/last_response.html" target="_blank" rel="noopener"><code>last_request_json()</code></a> and <a href="https://httr2.r-lib.org/reference/last_response.html" target="_blank" rel="noopener"><code>last_response_json()</code></a> which pretty-print the JSON bodies of the last request and response.</li>
<li><a href="https://httr2.r-lib.org/reference/req_dry_run.html" target="_blank" rel="noopener"><code>req_dry_run()</code></a> and <a href="https://httr2.r-lib.org/reference/req_verbose.html" target="_blank" rel="noopener"><code>req_verbose()</code></a> automatically pretty print JSON bodies (turn this off by setting <code>options(httr2_pretty_json = FALSE)</code>).</li>
</ul>
<p>We&rsquo;ve also included a few general tools to make it easier to control httr2&rsquo;s default verbosity. You can now control the default via the <code>HTTR2_VERBOSITY</code> environment variable and there&rsquo;s a new <a href="https://httr2.r-lib.org/reference/with_verbosity.html" target="_blank" rel="noopener"><code>local_verbosity()</code></a> function to match the existing <a href="https://httr2.r-lib.org/reference/with_verbosity.html" target="_blank" rel="noopener"><code>with_verbosity()</code></a>.</p>
<h2 id="quality-of-life-improvements">Quality of life improvements
</h2>
<p>This release also includes a bunch of few smaller quality of life improvements:</p>
<ul>
<li>
<p><a href="https://httr2.r-lib.org/reference/req_perform_parallel.html" target="_blank" rel="noopener"><code>req_perform_parallel()</code></a> now lifts many of its restrictions. It now supports simplified versions of <a href="https://httr2.r-lib.org/reference/req_throttle.html" target="_blank" rel="noopener"><code>req_throttle()</code></a> and <a href="https://httr2.r-lib.org/reference/req_retry.html" target="_blank" rel="noopener"><code>req_retry()</code></a>, it can refresh OAuth tokens, and it checks the cache before each request.</p>
</li>
<li>
<p><a href="https://httr2.r-lib.org/reference/req_get_url.html" target="_blank" rel="noopener"><code>req_get_url()</code></a>, <a href="https://httr2.r-lib.org/reference/req_get_method.html" target="_blank" rel="noopener"><code>req_get_method()</code></a>, <a href="https://httr2.r-lib.org/reference/req_get_headers.html" target="_blank" rel="noopener"><code>req_get_headers()</code></a>, <code>req_body_get_type()</code>, and <a href="https://httr2.r-lib.org/reference/req_get_body_type.html" target="_blank" rel="noopener"><code>req_get_body()</code></a> allow you to introspect request objects.</p>
</li>
<li>
<p><a href="https://httr2.r-lib.org/reference/req_throttle.html" target="_blank" rel="noopener"><code>req_throttle()</code></a> now uses a &ldquo;<a href="https://en.wikipedia.org/wiki/Leaky_bucket" target="_blank" rel="noopener">leaky bucket</a>&rdquo;. This maintains the same average rate limit as before, while allowing bursts of higher rates.</p>
</li>
<li>
<p><a href="https://httr2.r-lib.org/reference/resp_timing.html" target="_blank" rel="noopener"><code>resp_timing()</code></a> exposes detailed timing information for a response.</p>
</li>
</ul>
<h2 id="acknowledgements">Acknowledgements
</h2>
<p>A big thanks to everyone who contributed to this release through issues, pull requests, and discussions on GitHub: <a href="https://github.com/Aariq" target="_blank" rel="noopener">@Aariq</a>, <a href="https://github.com/annalena13" target="_blank" rel="noopener">@annalena13</a>, <a href="https://github.com/apsteinmetz" target="_blank" rel="noopener">@apsteinmetz</a>, <a href="https://github.com/arcresu" target="_blank" rel="noopener">@arcresu</a>, <a href="https://github.com/arnaudgallou" target="_blank" rel="noopener">@arnaudgallou</a>, <a href="https://github.com/atheriel" target="_blank" rel="noopener">@atheriel</a>, <a href="https://github.com/DavidRLovell" target="_blank" rel="noopener">@DavidRLovell</a>, <a href="https://github.com/dfalbel" target="_blank" rel="noopener">@dfalbel</a>, <a href="https://github.com/Eli-Berkow" target="_blank" rel="noopener">@Eli-Berkow</a>, <a href="https://github.com/fwimp" target="_blank" rel="noopener">@fwimp</a>, <a href="https://github.com/hadley" target="_blank" rel="noopener">@hadley</a>, <a href="https://github.com/jansim" target="_blank" rel="noopener">@jansim</a>, <a href="https://github.com/jcheng5" target="_blank" rel="noopener">@jcheng5</a>, <a href="https://github.com/jeffreyzuber" target="_blank" rel="noopener">@jeffreyzuber</a>, <a href="https://github.com/jjesusfilho" target="_blank" rel="noopener">@jjesusfilho</a>, <a href="https://github.com/jonthegeek" target="_blank" rel="noopener">@jonthegeek</a>, <a href="https://github.com/Kevanness" target="_blank" rel="noopener">@Kevanness</a>, <a href="https://github.com/m-muecke" target="_blank" rel="noopener">@m-muecke</a>, <a href="https://github.com/maelle" target="_blank" rel="noopener">@maelle</a>, <a href="https://github.com/mayeulk" target="_blank" rel="noopener">@mayeulk</a>, <a href="https://github.com/mdsumner" target="_blank" rel="noopener">@mdsumner</a>, <a href="https://github.com/noamross" target="_blank" rel="noopener">@noamross</a>, <a href="https://github.com/omuelle" target="_blank" rel="noopener">@omuelle</a>, <a href="https://github.com/pedrobtz" target="_blank" rel="noopener">@pedrobtz</a>, <a href="https://github.com/plietar" target="_blank" rel="noopener">@plietar</a>, <a href="https://github.com/ramiromagno" target="_blank" rel="noopener">@ramiromagno</a>, <a href="https://github.com/salim-b" target="_blank" rel="noopener">@salim-b</a>, <a href="https://github.com/sckott" target="_blank" rel="noopener">@sckott</a>, <a href="https://github.com/shikokuchuo" target="_blank" rel="noopener">@shikokuchuo</a>, <a href="https://github.com/vibalre" target="_blank" rel="noopener">@vibalre</a>, <a href="https://github.com/vladimirobucina" target="_blank" rel="noopener">@vladimirobucina</a>, and <a href="https://github.com/ZheFrench" target="_blank" rel="noopener">@ZheFrench</a>.</p>
]]></description>
      <enclosure url="https://opensource.posit.co/blog/2025-07-14_httr2-1-2-0/thumbnail-wd.jpg" length="36992" type="image/jpeg" />
    </item>
    <item>
      <title>Parallel processing in purrr 1.1.0</title>
      <link>https://opensource.posit.co/blog/2025-07-10_purrr-1-1-0-parallel/</link>
      <pubDate>Thu, 10 Jul 2025 00:00:00 +0000</pubDate>
      <guid>https://opensource.posit.co/blog/2025-07-10_purrr-1-1-0-parallel/</guid>
      <dc:creator>Charlie Gao</dc:creator>
      <dc:creator>Hadley Wickham</dc:creator>
      <dc:creator>Davis Vaughan</dc:creator>
      <dc:creator>Lionel Henry</dc:creator><description><![CDATA[<!--
TODO:
* [x] Look over / edit the post's title in the yaml
* [x] Edit (or delete) the description; note this appears in the Twitter card
* [x] Pick category and tags (see existing with [`hugodown::tidy_show_meta()`](https://rdrr.io/pkg/hugodown/man/use_tidy_post.html))
* [x] Find photo & update yaml metadata
* [x] Create `thumbnail-sq.jpg`; height and width should be equal
* [x] Create `thumbnail-wd.jpg`; width should be >5x height
* [x] [`hugodown::use_tidy_thumbnails()`](https://rdrr.io/pkg/hugodown/man/use_tidy_post.html)
* [x] Add intro sentence, e.g. the standard tagline for the package
* [x] [`usethis::use_tidy_thanks()`](https://usethis.r-lib.org/reference/use_tidy_thanks.html)
-->
<p>We&rsquo;re thrilled to announce the release of <a href="https://purrr.tidyverse.org" target="_blank" rel="noopener">purrr</a> 1.1.0, bringing a game-changing feature to this cornerstone of the tidyverse: <strong>parallel processing</strong>.</p>
<p>For the first time in purrr&rsquo;s history, you can now scale your <code>map()</code> operations across multiple cores and even distributed systems, all while maintaining the elegant, functional programming style you know and love.</p>
<p>This milestone represents more than just a performance boost&mdash;it&rsquo;s a fundamental shift that makes purrr suitable for production-scale data processing tasks without sacrificing the clarity and composability that make it such a joy to use.</p>
<p>Get started by installing purrr 1.1.0 today:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">install.packages</span><span class="p">(</span><span class="s">&#34;purrr&#34;</span><span class="p">)</span></span></span></code></pre></div></div>
<p>The parallel processing functionality requires the mirai and carrier packages. You will be prompted to install them when you first call <code>in_parallel()</code>.</p>
<p>Ready to supercharge your functional programming workflows? Parallel purrr is here, and it&rsquo;s remarkably simple to use.</p>
<h2 id="the-power-of-in_parallel">The power of <code>in_parallel()</code>
</h2>
<p>The magic happens through a shiny new function: <code>in_parallel()</code>. This purrr adverb wraps your functions to signal that they should run in parallel, powered by the venerable <a href="https://mirai.r-lib.org/" target="_blank" rel="noopener">mirai</a> package.</p>
<p>Here&rsquo;s how simple it is to transform your sequential operations:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">library</span><span class="p">(</span><span class="n">purrr</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nf">library</span><span class="p">(</span><span class="n">mirai</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Set up parallel processing (6 background processes)</span>
</span></span><span class="line"><span class="cl"><span class="nf">daemons</span><span class="p">(</span><span class="m">6</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Sequential version</span>
</span></span><span class="line"><span class="cl"><span class="n">mtcars</span> <span class="o">|&gt;</span> <span class="nf">map_dbl</span><span class="p">(</span><span class="nf">\</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="nf">mean</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt;    mpg    cyl   disp     hp   drat     wt   qsec     vs     am   gear   carb </span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt;  20.09   6.19 230.72 146.69   3.60   3.22  17.85   0.44   0.41   3.69   2.81</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Parallel version - just wrap your function with in_parallel()</span>
</span></span><span class="line"><span class="cl"><span class="n">mtcars</span> <span class="o">|&gt;</span> <span class="nf">map_dbl</span><span class="p">(</span><span class="nf">in_parallel</span><span class="p">(</span><span class="nf">\</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="nf">mean</span><span class="p">(</span><span class="n">x</span><span class="p">)))</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt;    mpg    cyl   disp     hp   drat     wt   qsec     vs     am   gear   carb </span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt;  20.09   6.19 230.72 146.69   3.60   3.22  17.85   0.44   0.41   3.69   2.81</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Don&#39;t forget to clean up when done</span>
</span></span><span class="line"><span class="cl"><span class="nf">daemons</span><span class="p">(</span><span class="m">0</span><span class="p">)</span></span></span></code></pre></div></div>
<p>The results are identical, but the second version distributes the work across multiple CPU cores. For computationally intensive tasks, the performance gains can be dramatic.</p>
<p>The beauty of using an adverb is that <code>in_parallel()</code> works not just with <code>map()</code>, but across the entire purrr ecosystem:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">daemons</span><span class="p">(</span><span class="m">6</span><span class="p">,</span> <span class="n">output</span> <span class="o">=</span> <span class="kc">TRUE</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Works with all map variants</span>
</span></span><span class="line"><span class="cl"><span class="m">1</span><span class="o">:</span><span class="m">4</span> <span class="o">|&gt;</span> <span class="nf">map_int</span><span class="p">(</span><span class="nf">in_parallel</span><span class="p">(</span><span class="nf">\</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="n">x^2</span><span class="p">))</span>
</span></span><span class="line"><span class="cl"><span class="m">1</span><span class="o">:</span><span class="m">4</span> <span class="o">|&gt;</span> <span class="nf">map_chr</span><span class="p">(</span><span class="nf">in_parallel</span><span class="p">(</span><span class="nf">\</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="nf">paste</span><span class="p">(</span><span class="s">&#34;Number&#34;</span><span class="p">,</span> <span class="n">x</span><span class="p">)))</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Works with map2 and pmap</span>
</span></span><span class="line"><span class="cl"><span class="nf">map2_dbl</span><span class="p">(</span><span class="m">1</span><span class="o">:</span><span class="m">3</span><span class="p">,</span> <span class="m">4</span><span class="o">:</span><span class="m">6</span><span class="p">,</span> <span class="nf">in_parallel</span><span class="p">(</span><span class="nf">\</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span> <span class="n">x</span> <span class="o">+</span> <span class="n">y</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nf">list</span><span class="p">(</span><span class="n">a</span> <span class="o">=</span> <span class="m">1</span><span class="o">:</span><span class="m">3</span><span class="p">,</span> <span class="n">b</span> <span class="o">=</span> <span class="m">4</span><span class="o">:</span><span class="m">6</span><span class="p">,</span> <span class="n">c</span> <span class="o">=</span> <span class="m">7</span><span class="o">:</span><span class="m">9</span><span class="p">)</span> <span class="o">|&gt;</span>
</span></span><span class="line"><span class="cl">  <span class="nf">pmap_dbl</span><span class="p">(</span><span class="nf">in_parallel</span><span class="p">(</span><span class="nf">\</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">c</span><span class="p">)</span> <span class="nf">mean</span><span class="p">(</span><span class="nf">c</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">c</span><span class="p">))))</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Even works with walk for side effects</span>
</span></span><span class="line"><span class="cl"><span class="m">1</span><span class="o">:</span><span class="m">3</span> <span class="o">|&gt;</span> <span class="nf">walk</span><span class="p">(</span><span class="nf">in_parallel</span><span class="p">(</span><span class="nf">\</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="nf">cat</span><span class="p">(</span><span class="s">&#34;Processing&#34;</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="s">&#34;\n&#34;</span><span class="p">)))</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nf">daemons</span><span class="p">(</span><span class="m">0</span><span class="p">)</span></span></span></code></pre></div></div>
<p>If you use <code>in_parallel()</code> but don&rsquo;t set <code>daemons()</code>, then the map will just proceed sequentially, so you don&rsquo;t need to worry about having two separate code paths for parallel vs non-parallel execution.</p>
<h2 id="real-world-example-parallel-model-fitting">Real-world example: parallel model fitting
</h2>
<p>Let&rsquo;s look at a more realistic scenario where parallel processing truly shines&mdash;fitting multiple models:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">library</span><span class="p">(</span><span class="n">purrr</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nf">library</span><span class="p">(</span><span class="n">mirai</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Set up 4 parallel processes</span>
</span></span><span class="line"><span class="cl"><span class="nf">daemons</span><span class="p">(</span><span class="m">4</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Define a slow model fitting function</span>
</span></span><span class="line"><span class="cl"><span class="n">slow_lm</span> <span class="o">&lt;-</span> <span class="kr">function</span><span class="p">(</span><span class="n">formula</span><span class="p">,</span> <span class="n">data</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">  <span class="nf">Sys.sleep</span><span class="p">(</span><span class="m">0.1</span><span class="p">)</span>  <span class="c1"># Simulate computational complexity</span>
</span></span><span class="line"><span class="cl">  <span class="nf">lm</span><span class="p">(</span><span class="n">formula</span><span class="p">,</span> <span class="n">data</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Fit models to different subsets of data in parallel</span>
</span></span><span class="line"><span class="cl"><span class="n">models</span> <span class="o">&lt;-</span> <span class="n">mtcars</span> <span class="o">|&gt;</span>
</span></span><span class="line"><span class="cl">  <span class="nf">split</span><span class="p">(</span><span class="n">mtcars</span><span class="o">$</span><span class="n">cyl</span><span class="p">)</span> <span class="o">|&gt;</span>
</span></span><span class="line"><span class="cl">  <span class="nf">map</span><span class="p">(</span><span class="nf">in_parallel</span><span class="p">(</span><span class="nf">\</span><span class="p">(</span><span class="n">df</span><span class="p">)</span> <span class="nf">slow_lm</span><span class="p">(</span><span class="n">mpg</span> <span class="o">~</span> <span class="n">wt</span> <span class="o">+</span> <span class="n">hp</span><span class="p">,</span> <span class="n">data</span> <span class="o">=</span> <span class="n">df</span><span class="p">),</span> <span class="n">slow_lm</span> <span class="o">=</span> <span class="n">slow_lm</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Extract R-squared values</span>
</span></span><span class="line"><span class="cl"><span class="n">models</span> <span class="o">|&gt;</span> 
</span></span><span class="line"><span class="cl">  <span class="nf">map</span><span class="p">(</span><span class="n">summary</span><span class="p">)</span> <span class="o">|&gt;</span> 
</span></span><span class="line"><span class="cl">  <span class="nf">map_dbl</span><span class="p">(</span><span class="s">&#34;r.squared&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt;         4         6         8 </span>
</span></span><span class="line"><span class="cl"><span class="c1">#&gt; 0.6807065 0.5889239 0.4970692</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nf">daemons</span><span class="p">(</span><span class="m">0</span><span class="p">)</span></span></span></code></pre></div></div>
<p>Notice how we pass the <code>slow_lm</code> function as an argument to <code>in_parallel()</code>&mdash;this ensures our custom function is available in the parallel processes.</p>
<h2 id="production-ready-with-mirai">Production-ready with mirai
</h2>
<p>The choice of <a href="https://mirai.r-lib.org" target="_blank" rel="noopener">mirai</a> as the parallel backend wasn&rsquo;t arbitrary. <a href="https://mirai.r-lib.org" target="_blank" rel="noopener">mirai</a> is a production-grade async evaluation framework that brings several key advantages:</p>
<ul>
<li><strong>Minimal overhead</strong>: Built on modern networking and concurrency principles</li>
<li><strong>Reliable scheduling</strong>: Leveraging fast inter-process communications locally</li>
<li><strong>Scalable architecture</strong>: From multi-process to distributed computing on HPC clusters</li>
<li><strong>Security</strong>: Offers zero-configuration TLS over TCP for additional assurance</li>
</ul>
<p>This means your parallel purrr code isn&rsquo;t just fast&mdash;it&rsquo;s production-ready.</p>
<p>Compared to the <a href="https://furrr.futureverse.org" target="_blank" rel="noopener">furrr</a> package:</p>
<ul>
<li>Much lower overhead means you can get a performance boost even for relatively fast functions</li>
<li>More linear scaling means you get the same benefits whether you&rsquo;re running on 2 or 200 cores</li>
</ul>
<p>We&rsquo;ve learned a lot from our work on furrr, and from <a href="https://github.com/henrikbengtsson" target="_blank" rel="noopener">Henrik Bengtsson</a>&rsquo;s excellent work on the <a href="https://github.com/futureverse" target="_blank" rel="noopener">futureverse</a> ecosystem. purrr doesn&rsquo;t use future as the underlying engine for parallelism because we&rsquo;ve made some design decisions that differ at a fundamental level, but Henrik&rsquo;s entire ecosystem deserves credit for pushing the boundaries of parallelism in R farther than many thought possible.</p>
<h2 id="creating-self-contained-functions">Creating self-contained functions
</h2>
<p>One of the key concepts when using <code>in_parallel()</code> is creating self-contained functions. Since your function gets serialized and sent to parallel processes, it needs to be completely standalone:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="c1"># ❌ This won&#39;t work - external dependencies not declared</span>
</span></span><span class="line"><span class="cl"><span class="n">my_data</span> <span class="o">&lt;-</span> <span class="nf">c</span><span class="p">(</span><span class="m">1</span><span class="p">,</span> <span class="m">2</span><span class="p">,</span> <span class="m">3</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nf">map</span><span class="p">(</span><span class="m">1</span><span class="o">:</span><span class="m">3</span><span class="p">,</span> <span class="nf">in_parallel</span><span class="p">(</span><span class="nf">\</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="nf">mean</span><span class="p">(</span><span class="n">my_data</span><span class="p">)))</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># ✅ This works - dependencies explicitly provided</span>
</span></span><span class="line"><span class="cl"><span class="n">my_data</span> <span class="o">&lt;-</span> <span class="nf">c</span><span class="p">(</span><span class="m">1</span><span class="p">,</span> <span class="m">2</span><span class="p">,</span> <span class="m">3</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nf">map</span><span class="p">(</span><span class="m">1</span><span class="o">:</span><span class="m">3</span><span class="p">,</span> <span class="nf">in_parallel</span><span class="p">(</span><span class="nf">\</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="nf">mean</span><span class="p">(</span><span class="n">my_data</span><span class="p">),</span> <span class="n">my_data</span> <span class="o">=</span> <span class="n">my_data</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># ✅ Package functions need explicit namespacing</span>
</span></span><span class="line"><span class="cl"><span class="nf">map</span><span class="p">(</span><span class="m">1</span><span class="o">:</span><span class="m">3</span><span class="p">,</span> <span class="nf">in_parallel</span><span class="p">(</span><span class="nf">\</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="n">vctrs</span><span class="o">::</span><span class="nf">vec_init</span><span class="p">(</span><span class="nf">integer</span><span class="p">(),</span> <span class="n">x</span><span class="p">)))</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># ✅ Or load packages within the function</span>
</span></span><span class="line"><span class="cl"><span class="nf">map</span><span class="p">(</span><span class="m">1</span><span class="o">:</span><span class="m">3</span><span class="p">,</span> <span class="nf">in_parallel</span><span class="p">(</span><span class="nf">\</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">  <span class="nf">library</span><span class="p">(</span><span class="n">vctrs</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">  <span class="nf">vec_init</span><span class="p">(</span><span class="nf">integer</span><span class="p">(),</span> <span class="n">x</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">}))</span></span></span></code></pre></div></div>
<p>This explicit dependency management might seem verbose, but it ensures your parallel code is reliable and predictable&mdash;crucial for production environments.</p>
<p>It also removes the danger of accidentally shipping large objects to parallel processes&mdash;often a source of performance degradation.</p>
<h2 id="when-to-use-parallel-processing">When to use parallel processing
</h2>
<p>Not every <code>map()</code> operation benefits from parallelization. The overhead of setting up parallel tasks and communicating between processes can outweigh the benefits for simple operations. As a rule of thumb, consider parallel processing when:</p>
<ul>
<li>Each iteration takes at least 100 microseconds to 1 millisecond</li>
<li>You&rsquo;re performing CPU-intensive computations</li>
<li>You&rsquo;re working with I/O-bound operations that can benefit from concurrency</li>
<li>The data being passed between processes isn&rsquo;t excessively large</li>
</ul>
<p>For quick operations like simple arithmetic, sequential processing will often be faster.</p>
<p>If you&rsquo;re a package developer, use <code>in_parallel()</code> where you see fit, but please be mindful not to call <code>daemons()</code> within your package code. How to set mirai daemons should be always be for the end user to decide.</p>
<h2 id="distributed-computing-made-simple">Distributed computing made simple
</h2>
<p>Want to scale beyond your local machine? mirai&rsquo;s networking capabilities make distributed computing surprisingly straightforward:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-r" data-lang="r"><span class="line"><span class="cl"><span class="nf">library</span><span class="p">(</span><span class="n">mirai</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Set up remote daemons on a Slurm HPC cluster</span>
</span></span><span class="line"><span class="cl"><span class="nf">daemons</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">  <span class="n">n</span> <span class="o">=</span> <span class="m">100</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="n">url</span> <span class="o">=</span> <span class="nf">host_url</span><span class="p">(),</span>
</span></span><span class="line"><span class="cl">  <span class="n">remote</span> <span class="o">=</span> <span class="nf">cluster_config</span><span class="p">(</span><span class="n">command</span> <span class="o">=</span> <span class="s">&#34;sbatch&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Your purrr code remains exactly the same!</span>
</span></span><span class="line"><span class="cl"><span class="n">results</span> <span class="o">&lt;-</span> <span class="n">big_dataset</span> <span class="o">|&gt;</span>
</span></span><span class="line"><span class="cl">  <span class="nf">split</span><span class="p">(</span><span class="n">big_dataset</span><span class="o">$</span><span class="n">group</span><span class="p">)</span> <span class="o">|&gt;</span>
</span></span><span class="line"><span class="cl">  <span class="nf">map</span><span class="p">(</span><span class="nf">in_parallel</span><span class="p">(</span><span class="nf">\</span><span class="p">(</span><span class="n">df</span><span class="p">)</span> <span class="nf">complex_analysis</span><span class="p">(</span><span class="n">df</span><span class="p">),</span> <span class="n">complex_analysis</span> <span class="o">=</span> <span class="n">complex_analysis</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nf">daemons</span><span class="p">(</span><span class="m">0</span><span class="p">)</span></span></span></code></pre></div></div>
<p>The same <code>in_parallel()</code> syntax that works locally scales seamlessly to distributed systems.</p>
<p>Please refer to the mirai documentation on <a href="https://mirai.r-lib.org/articles/mirai.html#remote-daemons" target="_blank" rel="noopener">remote daemons</a> and <a href="https://mirai.r-lib.org/articles/mirai.html#launching-remote-daemons" target="_blank" rel="noopener">launching remote daemons</a> for more details. This <a href="https://shikokuchuo.net/posts/27-mirai-240/" target="_blank" rel="noopener">mirai blog post</a> will also be useful if you&rsquo;re working with High-Performance Computing (HPC) clusters.</p>
<h2 id="looking-forward">Looking forward
</h2>
<p>The addition of parallel processing to purrr 1.1.0 represents a significant evolution in the package&rsquo;s capabilities. It maintains purrr&rsquo;s core philosophy of functional programming while opening doors to high-performance computing scenarios that were previously challenging to achieve with such clean, readable code.</p>
<p>This feature is currently marked as experimental as we gather feedback from the community, but the underlying mirai infrastructure is production-proven and battle-tested. We encourage you to try it out and let us know about your experiences.</p>
<p>Whether you&rsquo;re processing large datasets, fitting complex models, or running simulations, purrr 1.1.0&rsquo;s parallel processing capabilities can help you scale your R workflows without sacrificing code clarity or reliability.</p>
<h2 id="acknowledgements">Acknowledgements
</h2>
<p>A big thanks to all those who posted issues and contributed PRs since our last release! <a href="https://github.com/ar-puuk" target="_blank" rel="noopener">@ar-puuk</a>, <a href="https://github.com/DanChaltiel" target="_blank" rel="noopener">@DanChaltiel</a>, <a href="https://github.com/davidrsch" target="_blank" rel="noopener">@davidrsch</a>, <a href="https://github.com/ErdaradunGaztea" target="_blank" rel="noopener">@ErdaradunGaztea</a>, <a href="https://github.com/h-a-graham" target="_blank" rel="noopener">@h-a-graham</a>, <a href="https://github.com/hadley" target="_blank" rel="noopener">@hadley</a>, <a href="https://github.com/HenningLorenzen-ext-bayer" target="_blank" rel="noopener">@HenningLorenzen-ext-bayer</a>, <a href="https://github.com/krivit" target="_blank" rel="noopener">@krivit</a>, <a href="https://github.com/MarceloRTonon" target="_blank" rel="noopener">@MarceloRTonon</a>, <a href="https://github.com/MarkPaulin" target="_blank" rel="noopener">@MarkPaulin</a>, <a href="https://github.com/salim-b" target="_blank" rel="noopener">@salim-b</a>, <a href="https://github.com/ScientiaFelis" target="_blank" rel="noopener">@ScientiaFelis</a>, <a href="https://github.com/shikokuchuo" target="_blank" rel="noopener">@shikokuchuo</a>, and <a href="https://github.com/sierrajohnson" target="_blank" rel="noopener">@sierrajohnson</a>.</p>
]]></description>
      <enclosure url="https://opensource.posit.co/blog/2025-07-10_purrr-1-1-0-parallel/thumbnail-wd.jpg" length="499574" type="image/jpeg" />
    </item>
    <item>
      <title>duckplyr fully joins the tidyverse!</title>
      <link>https://opensource.posit.co/blog/2025-06-19_duckplyr-1-1-0/</link>
      <pubDate>Thu, 19 Jun 2025 00:00:00 +0000</pubDate>
      <guid>https://opensource.posit.co/blog/2025-06-19_duckplyr-1-1-0/</guid>
      <dc:creator>Kirill Müller</dc:creator>
      <dc:creator>Maëlle Salmon</dc:creator><description><![CDATA[<p>We&rsquo;re well chuffed to announce the release of <a href="https://duckplyr.tidyverse.org" target="_blank" rel="noopener">duckplyr</a> 1.1.0. This is a dplyr backend powered by <a href="https://duckdb.org/" target="_blank" rel="noopener">DuckDB</a>, a fast in-memory analytical database system<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>. duckplyr uses the power of DuckDB for impressive performance where it can, and seemlessly falls back to R where it can&rsquo;t. You can install it from CRAN with:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nf'><a href='https://rdrr.io/r/utils/install.packages.html'>install.packages</a></span><span class='o'>(</span><span class='s'>"duckplyr"</span><span class='o'>)</span></span></code></pre>
</div>
<p>This article shows how duckplyr can be used instead of dplyr, explain how you can help improve the package, and share a selection of further resources.</p>
<h2 id="a-drop-in-replacement-for-dplyr">A drop-in replacement for dplyr
</h2>
<p>Imagine you have to wrangle a huge dataset, like this one from the <a href="https://duckdb.org/2024/04/02/duckplyr.html#benchmark-tpc-h-q1" target="_blank" rel="noopener">TPC-H benchmark</a>, a famous database benchmarking dataset.</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>lineitem_tbl</span> <span class='o'>&lt;-</span> <span class='nf'>duckdb</span><span class='nf'>:::</span><span class='nf'>sql</span><span class='o'>(</span><span class='s'>"INSTALL tpch; LOAD tpch; CALL dbgen(sf=1); FROM lineitem;"</span><span class='o'>)</span></span>
<span><span class='nv'>lineitem_tbl</span> <span class='o'>&lt;-</span> <span class='nf'>tibble</span><span class='nf'>::</span><span class='nf'><a href='https://tibble.tidyverse.org/reference/as_tibble.html'>as_tibble</a></span><span class='o'>(</span><span class='nv'>lineitem_tbl</span><span class='o'>)</span></span>
<span><span class='nf'>dplyr</span><span class='nf'>::</span><span class='nf'><a href='https://pillar.r-lib.org/reference/glimpse.html'>glimpse</a></span><span class='o'>(</span><span class='nv'>lineitem_tbl</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; Rows: 6,001,215</span></span>
<span><span class='c'>#&gt; Columns: 16</span></span>
<span><span class='c'>#&gt; $ <span style='font-weight: bold;'>l_orderkey     </span> <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span> 1<span style='color: #555555;'>, </span>1<span style='color: #555555;'>, </span>1<span style='color: #555555;'>, </span>1<span style='color: #555555;'>, </span>1<span style='color: #555555;'>, </span>1<span style='color: #555555;'>, </span>2<span style='color: #555555;'>, </span>3<span style='color: #555555;'>, </span>3<span style='color: #555555;'>, </span>3<span style='color: #555555;'>, </span>3<span style='color: #555555;'>, </span>3<span style='color: #555555;'>, </span>3<span style='color: #555555;'>, </span>4<span style='color: #555555;'>, </span>5<span style='color: #555555;'>, </span>5<span style='color: #555555;'>, </span>5<span style='color: #555555;'>, </span>6<span style='color: #555555;'>, </span>…</span></span>
<span><span class='c'>#&gt; $ <span style='font-weight: bold;'>l_partkey      </span> <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span> 155190<span style='color: #555555;'>, </span>67310<span style='color: #555555;'>, </span>63700<span style='color: #555555;'>, </span>2132<span style='color: #555555;'>, </span>24027<span style='color: #555555;'>, </span>15635<span style='color: #555555;'>, </span>106170<span style='color: #555555;'>, </span>4297…</span></span>
<span><span class='c'>#&gt; $ <span style='font-weight: bold;'>l_suppkey      </span> <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span> 7706<span style='color: #555555;'>, </span>7311<span style='color: #555555;'>, </span>3701<span style='color: #555555;'>, </span>4633<span style='color: #555555;'>, </span>1534<span style='color: #555555;'>, </span>638<span style='color: #555555;'>, </span>1191<span style='color: #555555;'>, </span>1798<span style='color: #555555;'>, </span>6540<span style='color: #555555;'>, </span>3…</span></span>
<span><span class='c'>#&gt; $ <span style='font-weight: bold;'>l_linenumber   </span> <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span> 1<span style='color: #555555;'>, </span>2<span style='color: #555555;'>, </span>3<span style='color: #555555;'>, </span>4<span style='color: #555555;'>, </span>5<span style='color: #555555;'>, </span>6<span style='color: #555555;'>, </span>1<span style='color: #555555;'>, </span>1<span style='color: #555555;'>, </span>2<span style='color: #555555;'>, </span>3<span style='color: #555555;'>, </span>4<span style='color: #555555;'>, </span>5<span style='color: #555555;'>, </span>6<span style='color: #555555;'>, </span>1<span style='color: #555555;'>, </span>1<span style='color: #555555;'>, </span>2<span style='color: #555555;'>, </span>3<span style='color: #555555;'>, </span>1<span style='color: #555555;'>, </span>…</span></span>
<span><span class='c'>#&gt; $ <span style='font-weight: bold;'>l_quantity     </span> <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span> 17<span style='color: #555555;'>, </span>36<span style='color: #555555;'>, </span>8<span style='color: #555555;'>, </span>28<span style='color: #555555;'>, </span>24<span style='color: #555555;'>, </span>32<span style='color: #555555;'>, </span>38<span style='color: #555555;'>, </span>45<span style='color: #555555;'>, </span>49<span style='color: #555555;'>, </span>27<span style='color: #555555;'>, </span>2<span style='color: #555555;'>, </span>28<span style='color: #555555;'>, </span>26<span style='color: #555555;'>, </span>30<span style='color: #555555;'>, </span>…</span></span>
<span><span class='c'>#&gt; $ <span style='font-weight: bold;'>l_extendedprice</span> <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span> 21168.23<span style='color: #555555;'>, </span>45983.16<span style='color: #555555;'>, </span>13309.60<span style='color: #555555;'>, </span>28955.64<span style='color: #555555;'>, </span>22824.48<span style='color: #555555;'>, </span>4962…</span></span>
<span><span class='c'>#&gt; $ <span style='font-weight: bold;'>l_discount     </span> <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span> 0.04<span style='color: #555555;'>, </span>0.09<span style='color: #555555;'>, </span>0.10<span style='color: #555555;'>, </span>0.09<span style='color: #555555;'>, </span>0.10<span style='color: #555555;'>, </span>0.07<span style='color: #555555;'>, </span>0.00<span style='color: #555555;'>, </span>0.06<span style='color: #555555;'>, </span>0.10<span style='color: #555555;'>, </span>…</span></span>
<span><span class='c'>#&gt; $ <span style='font-weight: bold;'>l_tax          </span> <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span> 0.02<span style='color: #555555;'>, </span>0.06<span style='color: #555555;'>, </span>0.02<span style='color: #555555;'>, </span>0.06<span style='color: #555555;'>, </span>0.04<span style='color: #555555;'>, </span>0.02<span style='color: #555555;'>, </span>0.05<span style='color: #555555;'>, </span>0.00<span style='color: #555555;'>, </span>0.00<span style='color: #555555;'>, </span>…</span></span>
<span><span class='c'>#&gt; $ <span style='font-weight: bold;'>l_returnflag   </span> <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span> "N"<span style='color: #555555;'>, </span>"N"<span style='color: #555555;'>, </span>"N"<span style='color: #555555;'>, </span>"N"<span style='color: #555555;'>, </span>"N"<span style='color: #555555;'>, </span>"N"<span style='color: #555555;'>, </span>"N"<span style='color: #555555;'>, </span>"R"<span style='color: #555555;'>, </span>"R"<span style='color: #555555;'>, </span>"A"<span style='color: #555555;'>, </span>"A"<span style='color: #555555;'>,</span>…</span></span>
<span><span class='c'>#&gt; $ <span style='font-weight: bold;'>l_linestatus   </span> <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span> "O"<span style='color: #555555;'>, </span>"O"<span style='color: #555555;'>, </span>"O"<span style='color: #555555;'>, </span>"O"<span style='color: #555555;'>, </span>"O"<span style='color: #555555;'>, </span>"O"<span style='color: #555555;'>, </span>"O"<span style='color: #555555;'>, </span>"F"<span style='color: #555555;'>, </span>"F"<span style='color: #555555;'>, </span>"F"<span style='color: #555555;'>, </span>"F"<span style='color: #555555;'>,</span>…</span></span>
<span><span class='c'>#&gt; $ <span style='font-weight: bold;'>l_shipdate     </span> <span style='color: #555555; font-style: italic;'>&lt;date&gt;</span> 1996-03-13<span style='color: #555555;'>, </span>1996-04-12<span style='color: #555555;'>, </span>1996-01-29<span style='color: #555555;'>, </span>1996-04-21<span style='color: #555555;'>, </span>1996-…</span></span>
<span><span class='c'>#&gt; $ <span style='font-weight: bold;'>l_commitdate   </span> <span style='color: #555555; font-style: italic;'>&lt;date&gt;</span> 1996-02-12<span style='color: #555555;'>, </span>1996-02-28<span style='color: #555555;'>, </span>1996-03-05<span style='color: #555555;'>, </span>1996-03-30<span style='color: #555555;'>, </span>1996-…</span></span>
<span><span class='c'>#&gt; $ <span style='font-weight: bold;'>l_receiptdate  </span> <span style='color: #555555; font-style: italic;'>&lt;date&gt;</span> 1996-03-22<span style='color: #555555;'>, </span>1996-04-20<span style='color: #555555;'>, </span>1996-01-31<span style='color: #555555;'>, </span>1996-05-16<span style='color: #555555;'>, </span>1996-…</span></span>
<span><span class='c'>#&gt; $ <span style='font-weight: bold;'>l_shipinstruct </span> <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span> "DELIVER IN PERSON"<span style='color: #555555;'>, </span>"TAKE BACK RETURN"<span style='color: #555555;'>, </span>"TAKE BACK RE…</span></span>
<span><span class='c'>#&gt; $ <span style='font-weight: bold;'>l_shipmode     </span> <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span> "TRUCK"<span style='color: #555555;'>, </span>"MAIL"<span style='color: #555555;'>, </span>"REG AIR"<span style='color: #555555;'>, </span>"AIR"<span style='color: #555555;'>, </span>"FOB"<span style='color: #555555;'>, </span>"MAIL"<span style='color: #555555;'>, </span>"RAI…</span></span>
<span><span class='c'>#&gt; $ <span style='font-weight: bold;'>l_comment      </span> <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span> "to beans x-ray carefull"<span style='color: #555555;'>, </span>" according to the final fo…</span></span>
<span></span></code></pre>
</div>
<p>To work with this in duckplyr instead of dplyr, all you need to do is load duckplyr:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='kr'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='o'>(</span><span class='nv'><a href='https://duckplyr.tidyverse.org'>duckplyr</a></span><span class='o'>)</span></span>
<span><span class='c'>#&gt; Loading required package: dplyr</span></span>
<span></span><span><span class='c'>#&gt; The <span style='color: #0000BB;'>duckplyr</span> package is configured to fall back to <span style='color: #0000BB;'>dplyr</span> when it encounters an incompatibility.</span></span>
<span><span class='c'>#&gt; Fallback events can be collected and uploaded for analysis to guide future development. By</span></span>
<span><span class='c'>#&gt; default, data will be collected but no data will be uploaded.</span></span>
<span><span class='c'>#&gt; <span style='color: #00BBBB;'>ℹ</span> Automatic fallback uploading is not controlled and therefore disabled, see</span></span>
<span><span class='c'>#&gt;   `?duckplyr::fallback()`.</span></span>
<span><span class='c'>#&gt; <span style='color: #00BB00;'>✔</span> Number of reports ready for upload: <span style='font-weight: bold;'>4</span>.</span></span>
<span><span class='c'>#&gt; → Review with `duckplyr::fallback_review()`, upload with `duckplyr::fallback_upload()`.</span></span>
<span><span class='c'>#&gt; <span style='color: #00BBBB;'>ℹ</span> <span style='color: #555555;'>Configure automatic uploading with `duckplyr::fallback_config()`.</span></span></span>
<span></span><span><span class='c'>#&gt; <span style='color: #00BB00;'>✔</span> Overwriting <span style='color: #0000BB;'>dplyr</span> methods with <span style='color: #0000BB;'>duckplyr</span> methods.</span></span>
<span><span class='c'>#&gt; <span style='color: #00BBBB;'>ℹ</span> Turn off with `duckplyr::methods_restore()`.</span></span>
<span></span></code></pre>
</div>
<p>Now we can express the well-known (at least in the database community!) &ldquo;TPC-H benchmark query 1&rdquo; in dplyr syntax and execute it in DuckDB via duckplyr.</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>tpch_dplyr</span> <span class='o'>&lt;-</span> <span class='kr'>function</span><span class='o'>(</span><span class='nv'>lineitem</span><span class='o'>)</span> <span class='o'>&#123;</span></span>
<span>  <span class='nv'>lineitem</span> <span class='o'>|&gt;</span></span>
<span>    <span class='nf'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span><span class='o'>(</span><span class='nv'>l_shipdate</span> <span class='o'>&lt;=</span> <span class='o'>!</span><span class='o'>!</span><span class='nf'><a href='https://rdrr.io/r/base/as.Date.html'>as.Date</a></span><span class='o'>(</span><span class='s'>"1998-09-02"</span><span class='o'>)</span><span class='o'>)</span> <span class='o'>|&gt;</span></span>
<span>    <span class='nf'><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></span><span class='o'>(</span></span>
<span>      sum_qty <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/sum.html'>sum</a></span><span class='o'>(</span><span class='nv'>l_quantity</span><span class='o'>)</span>,</span>
<span>      sum_base_price <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/sum.html'>sum</a></span><span class='o'>(</span><span class='nv'>l_extendedprice</span><span class='o'>)</span>,</span>
<span>      sum_disc_price <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/sum.html'>sum</a></span><span class='o'>(</span><span class='nv'>l_extendedprice</span> <span class='o'>*</span> <span class='o'>(</span><span class='m'>1</span> <span class='o'>-</span> <span class='nv'>l_discount</span><span class='o'>)</span><span class='o'>)</span>,</span>
<span>      sum_charge <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/sum.html'>sum</a></span><span class='o'>(</span><span class='nv'>l_extendedprice</span> <span class='o'>*</span> <span class='o'>(</span><span class='m'>1</span> <span class='o'>-</span> <span class='nv'>l_discount</span><span class='o'>)</span> <span class='o'>*</span> <span class='o'>(</span><span class='m'>1</span> <span class='o'>+</span> <span class='nv'>l_tax</span><span class='o'>)</span><span class='o'>)</span>,</span>
<span>      avg_qty <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/mean.html'>mean</a></span><span class='o'>(</span><span class='nv'>l_quantity</span><span class='o'>)</span>,</span>
<span>      avg_price <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/mean.html'>mean</a></span><span class='o'>(</span><span class='nv'>l_extendedprice</span><span class='o'>)</span>,</span>
<span>      avg_disc <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/mean.html'>mean</a></span><span class='o'>(</span><span class='nv'>l_discount</span><span class='o'>)</span>,</span>
<span>      count_order <span class='o'>=</span> <span class='nf'><a href='https://dplyr.tidyverse.org/reference/context.html'>n</a></span><span class='o'>(</span><span class='o'>)</span>,</span>
<span>      .by <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='nv'>l_returnflag</span>, <span class='nv'>l_linestatus</span><span class='o'>)</span></span>
<span>    <span class='o'>)</span> <span class='o'>|&gt;</span></span>
<span>    <span class='nf'><a href='https://dplyr.tidyverse.org/reference/arrange.html'>arrange</a></span><span class='o'>(</span><span class='nv'>l_returnflag</span>, <span class='nv'>l_linestatus</span><span class='o'>)</span></span>
<span><span class='o'>&#125;</span></span>
<span></span>
<span><span class='nf'>tpch_dplyr</span><span class='o'>(</span><span class='nv'>lineitem_tbl</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># A tibble: 4 × 10</span></span></span>
<span><span class='c'>#&gt;   <span style='font-weight: bold;'>l_returnflag</span> <span style='font-weight: bold;'>l_linestatus</span>  <span style='font-weight: bold;'>sum_qty</span> <span style='font-weight: bold;'>sum_base_price</span> <span style='font-weight: bold;'>sum_disc_price</span>    <span style='font-weight: bold;'>sum_charge</span></span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span>        <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span>           <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span>          <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span>          <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span>         <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span> A            F            37<span style='text-decoration: underline;'>734</span>107   <span style='text-decoration: underline;'>56</span>586<span style='text-decoration: underline;'>554</span>401.   <span style='text-decoration: underline;'>53</span>758<span style='text-decoration: underline;'>257</span>135.  <span style='text-decoration: underline;'>55</span>909<span style='text-decoration: underline;'>065</span>223.</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>2</span> N            F              <span style='text-decoration: underline;'>991</span>417    <span style='text-decoration: underline;'>1</span>487<span style='text-decoration: underline;'>504</span>710.    <span style='text-decoration: underline;'>1</span>413<span style='text-decoration: underline;'>082</span>168.   <span style='text-decoration: underline;'>1</span>469<span style='text-decoration: underline;'>649</span>223.</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>3</span> N            O            74<span style='text-decoration: underline;'>476</span>040  <span style='text-decoration: underline;'>111</span>701<span style='text-decoration: underline;'>729</span>698.  <span style='text-decoration: underline;'>106</span>118<span style='text-decoration: underline;'>230</span>308. <span style='text-decoration: underline;'>110</span>367<span style='text-decoration: underline;'>043</span>872.</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>4</span> R            F            37<span style='text-decoration: underline;'>719</span>753   <span style='text-decoration: underline;'>56</span>568<span style='text-decoration: underline;'>041</span>381.   <span style='text-decoration: underline;'>53</span>741<span style='text-decoration: underline;'>292</span>685.  <span style='text-decoration: underline;'>55</span>889<span style='text-decoration: underline;'>619</span>120.</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># ℹ 4 more variables: </span><span style='color: #555555; font-weight: bold;'>avg_qty</span><span style='color: #555555;'> &lt;dbl&gt;, </span><span style='color: #555555; font-weight: bold;'>avg_price</span><span style='color: #555555;'> &lt;dbl&gt;, </span><span style='color: #555555; font-weight: bold;'>avg_disc</span><span style='color: #555555;'> &lt;dbl&gt;,</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>#   </span><span style='color: #555555; font-weight: bold;'>count_order</span><span style='color: #555555;'> &lt;int&gt;</span></span></span>
<span></span></code></pre>
</div>
<p>Like other dplyr backends such as dtplyr and dbplyr, duckplyr gives you higher performance without learning a different syntax. Unlike other dplyr backends, duckplyr does not require you to change existing code or learn specific idiosyncrasies. Not only is the syntax the same, the semantics are too! If an operation cannot be carried out with DuckDB, it is automatically outsourced to dplyr. Over time, we expect fewer and fewer fallbacks to dplyr to be needed.</p>
<h2 id="how-to-use-duckplyr">How to use duckplyr
</h2>
<p>There are two ways to use duckplyr:</p>
<ul>
<li>
<p>As above, you can <a href="https://duckplyr.tidyverse.org" target="_blank" rel="noopener"><code>library(duckplyr)</code></a>, and replace all existing dplyr methods. This is safe because duckplyr is guaranteed to give the exactly same the results as dplyr, unlike other backends.</p>
</li>
<li>
<p>Create individual &ldquo;duck frames&rdquo; using <em>conversion functions</em> like <code>duckdplyr::duckdb_tibble()</code> or <code>duckdplyr::as_duckdb_tibble()</code>, or <em>ingestion functions</em> like <code>duckdplyr::read_csv_duckdb()</code>.</p>
</li>
</ul>
<p>Here&rsquo;s an example of the second form:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>out</span> <span class='o'>&lt;-</span> <span class='nv'>lineitem_tbl</span> <span class='o'>|&gt;</span></span>
<span>  <span class='nf'>duckplyr</span><span class='nf'>::</span><span class='nf'><a href='https://duckplyr.tidyverse.org/reference/duckdb_tibble.html'>as_duckdb_tibble</a></span><span class='o'>(</span><span class='o'>)</span> <span class='o'>|&gt;</span></span>
<span>  <span class='nf'>tpch_dplyr</span><span class='o'>(</span><span class='o'>)</span></span>
<span></span>
<span><span class='nv'>out</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># A duckplyr data frame: 10 variables</span></span></span>
<span><span class='c'>#&gt;   <span style='font-weight: bold;'>l_returnflag</span> <span style='font-weight: bold;'>l_linestatus</span>  <span style='font-weight: bold;'>sum_qty</span> <span style='font-weight: bold;'>sum_base_price</span> <span style='font-weight: bold;'>sum_disc_price</span>    <span style='font-weight: bold;'>sum_charge</span></span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span>        <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span>           <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span>          <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span>          <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span>         <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span> A            F            37<span style='text-decoration: underline;'>734</span>107   <span style='text-decoration: underline;'>56</span>586<span style='text-decoration: underline;'>554</span>401.   <span style='text-decoration: underline;'>53</span>758<span style='text-decoration: underline;'>257</span>135.  <span style='text-decoration: underline;'>55</span>909<span style='text-decoration: underline;'>065</span>223.</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>2</span> N            F              <span style='text-decoration: underline;'>991</span>417    <span style='text-decoration: underline;'>1</span>487<span style='text-decoration: underline;'>504</span>710.    <span style='text-decoration: underline;'>1</span>413<span style='text-decoration: underline;'>082</span>168.   <span style='text-decoration: underline;'>1</span>469<span style='text-decoration: underline;'>649</span>223.</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>3</span> N            O            74<span style='text-decoration: underline;'>476</span>040  <span style='text-decoration: underline;'>111</span>701<span style='text-decoration: underline;'>729</span>698.  <span style='text-decoration: underline;'>106</span>118<span style='text-decoration: underline;'>230</span>308. <span style='text-decoration: underline;'>110</span>367<span style='text-decoration: underline;'>043</span>872.</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>4</span> R            F            37<span style='text-decoration: underline;'>719</span>753   <span style='text-decoration: underline;'>56</span>568<span style='text-decoration: underline;'>041</span>381.   <span style='text-decoration: underline;'>53</span>741<span style='text-decoration: underline;'>292</span>685.  <span style='text-decoration: underline;'>55</span>889<span style='text-decoration: underline;'>619</span>120.</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># ℹ 4 more variables: </span><span style='color: #555555; font-weight: bold;'>avg_qty</span><span style='color: #555555;'> &lt;dbl&gt;, </span><span style='color: #555555; font-weight: bold;'>avg_price</span><span style='color: #555555;'> &lt;dbl&gt;, </span><span style='color: #555555; font-weight: bold;'>avg_disc</span><span style='color: #555555;'> &lt;dbl&gt;,</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>#   </span><span style='color: #555555; font-weight: bold;'>count_order</span><span style='color: #555555;'> &lt;int&gt;</span></span></span>
<span></span></code></pre>
</div>
<p>Note that the resulting object is indistinguishable from a regular tibble, except for the additional class.</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nf'><a href='https://rdrr.io/r/base/typeof.html'>typeof</a></span><span class='o'>(</span><span class='nv'>out</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; [1] "list"</span></span>
<span></span><span><span class='nf'><a href='https://rdrr.io/r/base/class.html'>class</a></span><span class='o'>(</span><span class='nv'>out</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; [1] "duckplyr_df" "tbl_df"      "tbl"         "data.frame"</span></span>
<span></span><span><span class='nv'>out</span><span class='o'>$</span><span class='nv'>count_order</span></span>
<span><span class='c'>#&gt; [1] 1478493   38854 2920374 1478870</span></span>
<span></span></code></pre>
</div>
<p>Operations not yet supported by duckplyr are automatically outsourced to dplyr. For instance, filtering on grouped data is not supported, but it still works thanks to the fallback mechanism. By default, the fallback is silent, but you can make it visible by setting an environment variable. This is useful if you want to better understanding what&rsquo;s making your code slow.</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nf'><a href='https://rdrr.io/r/base/Sys.setenv.html'>Sys.setenv</a></span><span class='o'>(</span>DUCKPLYR_FALLBACK_INFO <span class='o'>=</span> <span class='kc'>TRUE</span><span class='o'>)</span></span>
<span></span>
<span><span class='nv'>lineitem_tbl</span> <span class='o'>|&gt;</span></span>
<span>  <span class='nf'>duckplyr</span><span class='nf'>::</span><span class='nf'><a href='https://duckplyr.tidyverse.org/reference/duckdb_tibble.html'>as_duckdb_tibble</a></span><span class='o'>(</span><span class='o'>)</span> <span class='o'>|&gt;</span></span>
<span>  <span class='nf'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span><span class='o'>(</span><span class='nv'>l_quantity</span> <span class='o'>==</span> <span class='nf'><a href='https://rdrr.io/r/base/Extremes.html'>max</a></span><span class='o'>(</span><span class='nv'>l_quantity</span><span class='o'>)</span>, .by <span class='o'>=</span> <span class='nf'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='o'>(</span><span class='nv'>l_returnflag</span>, <span class='nv'>l_linestatus</span><span class='o'>)</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; Cannot process duckplyr query with DuckDB, falling back to dplyr.</span></span>
<span><span class='c'>#&gt; <span style='color: #0000BB;'>ℹ</span> `filter(.by = ...)` not implemented, try `mutate(.by = ...)` followed by a simple `filter()`.</span></span>
<span></span><span><span class='c'>#&gt; <span style='color: #555555;'># A duckplyr data frame: 16 variables</span></span></span>
<span><span class='c'>#&gt;    <span style='font-weight: bold;'>l_orderkey</span> <span style='font-weight: bold;'>l_partkey</span> <span style='font-weight: bold;'>l_suppkey</span> <span style='font-weight: bold;'>l_linenumber</span> <span style='font-weight: bold;'>l_quantity</span> <span style='font-weight: bold;'>l_extendedprice</span></span></span>
<span><span class='c'>#&gt;         <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span>     <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span>     <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span>        <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span>      <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span>           <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'> 1</span>          5     <span style='text-decoration: underline;'>37</span>531        35            3         50          <span style='text-decoration: underline;'>73</span>426.</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'> 2</span>        131     <span style='text-decoration: underline;'>44</span>255      <span style='text-decoration: underline;'>9</span>264            2         50          <span style='text-decoration: underline;'>59</span>962.</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'> 3</span>        199    <span style='text-decoration: underline;'>132</span>072      <span style='text-decoration: underline;'>9</span>612            1         50          <span style='text-decoration: underline;'>55</span>204.</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'> 4</span>        231    <span style='text-decoration: underline;'>198</span>124       644            3         50          <span style='text-decoration: underline;'>61</span>106 </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'> 5</span>        260    <span style='text-decoration: underline;'>155</span>887      <span style='text-decoration: underline;'>5</span>888            1         50          <span style='text-decoration: underline;'>97</span>144 </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'> 6</span>        263    <span style='text-decoration: underline;'>142</span>891       434            3         50          <span style='text-decoration: underline;'>96</span>694.</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'> 7</span>        323    <span style='text-decoration: underline;'>163</span>628      <span style='text-decoration: underline;'>1</span>177            1         50          <span style='text-decoration: underline;'>84</span>581 </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'> 8</span>        354     <span style='text-decoration: underline;'>58</span>125      <span style='text-decoration: underline;'>8</span>126            3         50          <span style='text-decoration: underline;'>54</span>156 </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'> 9</span>        484    <span style='text-decoration: underline;'>183</span>351      <span style='text-decoration: underline;'>5</span>870            3         50          <span style='text-decoration: underline;'>71</span>718.</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>10</span>        485    <span style='text-decoration: underline;'>149</span>523      <span style='text-decoration: underline;'>9</span>524            1         50          <span style='text-decoration: underline;'>78</span>626 </span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># ℹ more rows</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># ℹ 10 more variables: </span><span style='color: #555555; font-weight: bold;'>l_discount</span><span style='color: #555555;'> &lt;dbl&gt;, </span><span style='color: #555555; font-weight: bold;'>l_tax</span><span style='color: #555555;'> &lt;dbl&gt;, </span><span style='color: #555555; font-weight: bold;'>l_returnflag</span><span style='color: #555555;'> &lt;chr&gt;,</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>#   </span><span style='color: #555555; font-weight: bold;'>l_linestatus</span><span style='color: #555555;'> &lt;chr&gt;, </span><span style='color: #555555; font-weight: bold;'>l_shipdate</span><span style='color: #555555;'> &lt;date&gt;, </span><span style='color: #555555; font-weight: bold;'>l_commitdate</span><span style='color: #555555;'> &lt;date&gt;,</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>#   </span><span style='color: #555555; font-weight: bold;'>l_receiptdate</span><span style='color: #555555;'> &lt;date&gt;, </span><span style='color: #555555; font-weight: bold;'>l_shipinstruct</span><span style='color: #555555;'> &lt;chr&gt;, </span><span style='color: #555555; font-weight: bold;'>l_shipmode</span><span style='color: #555555;'> &lt;chr&gt;,</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>#   </span><span style='color: #555555; font-weight: bold;'>l_comment</span><span style='color: #555555;'> &lt;chr&gt;</span></span></span>
<span></span></code></pre>
</div>
<p>You can also directly use DuckDB functions with the <code>dd$</code> qualifier. Functions with this prefix will not be translated at all and passed through directly to DuckDB. For example, the following code uses DuckDB&rsquo;s internal implementation of <a href="https://duckdb.org/docs/stable/sql/functions/text.html#editdist3s1-s2" target="_blank" rel="noopener">Levenstein distance</a>:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nf'><a href='https://tibble.tidyverse.org/reference/tibble.html'>tibble</a></span><span class='o'>(</span>a <span class='o'>=</span> <span class='s'>"dbplyr"</span>, b <span class='o'>=</span> <span class='s'>"duckplyr"</span><span class='o'>)</span> <span class='o'><a href='https://magrittr.tidyverse.org/reference/pipe.html'>%&gt;%</a></span></span>
<span>  <span class='nf'><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate</a></span><span class='o'>(</span>c <span class='o'>=</span> <span class='nv'>dd</span><span class='o'>$</span><span class='nf'>levenshtein</span><span class='o'>(</span><span class='nv'>a</span>, <span class='nv'>b</span><span class='o'>)</span><span class='o'>)</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'># A tibble: 1 × 3</span></span></span>
<span><span class='c'>#&gt;   <span style='font-weight: bold;'>a</span>      <span style='font-weight: bold;'>b</span>            <span style='font-weight: bold;'>c</span></span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span>  <span style='color: #555555; font-style: italic;'>&lt;chr&gt;</span>    <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span> dbplyr duckplyr     3</span></span>
<span></span></code></pre>
</div>
<p>See <a href="https://duckplyr.tidyverse.org/articles/duckdb.html" target="_blank" rel="noopener"><code>vignette(&quot;duckdb&quot;)</code></a> for more information on these features.</p>
<p>If you&rsquo;re working with dbplyr too, you can use <a href="https://duckplyr.tidyverse.org/reference/as_tbl.html" target="_blank" rel="noopener"><code>as_tbl()</code></a> you to convert a duckplyr tibble to a dbplyr lazy table. This allows you to seamlessly interact with existing code that might use inline SQL or other dbplyr functionality. With <a href="https://duckplyr.tidyverse.org/reference/duckdb_tibble.html" target="_blank" rel="noopener"><code>as_duckdb_tibble()</code></a>, you can convert a dbplyr lazy table to a duckplyr tibble. Both operations work without intermediate materialization.</p>
<h2 id="benchmark">Benchmark
</h2>
<p>duckplyr is often much faster than dplyr. The comparison below is done in a fresh R session where dplyr is attached but duckplyr is not.</p>
<p>We use <code>tpch_dplyr()</code> as defined above to run the query with dplyr. The function that runs it with duckplyr only wraps the input data in a duck frame and forwards it to the dplyr function. The <a href="https://dplyr.tidyverse.org/reference/compute.html" target="_blank" rel="noopener"><code>collect()</code></a> at the end is required only for this benchmark to ensure fairness.<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup></p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nv'>tpch_duckplyr</span> <span class='o'>&lt;-</span> <span class='kr'>function</span><span class='o'>(</span><span class='nv'>lineitem</span><span class='o'>)</span> <span class='o'>&#123;</span></span>
<span>  <span class='nv'>lineitem</span> <span class='o'>|&gt;</span></span>
<span>    <span class='nf'>duckplyr</span><span class='nf'>::</span><span class='nf'><a href='https://duckplyr.tidyverse.org/reference/duckdb_tibble.html'>as_duckdb_tibble</a></span><span class='o'>(</span><span class='o'>)</span> <span class='o'>|&gt;</span></span>
<span>    <span class='nf'>tpch_dplyr</span><span class='o'>(</span><span class='o'>)</span> <span class='o'>|&gt;</span></span>
<span>    <span class='nf'><a href='https://dplyr.tidyverse.org/reference/compute.html'>collect</a></span><span class='o'>(</span><span class='o'>)</span></span>
<span><span class='o'>&#125;</span></span></code></pre>
</div>
<p>And now we compare the two:</p>
<div class="highlight">
<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='nf'>bench</span><span class='nf'>::</span><span class='nf'><a href='https://bench.r-lib.org/reference/mark.html'>mark</a></span><span class='o'>(</span></span>
<span>  <span class='nf'>tpch_dplyr</span><span class='o'>(</span><span class='nv'>lineitem_tbl</span><span class='o'>)</span>,</span>
<span>  <span class='nf'>tpch_duckplyr</span><span class='o'>(</span><span class='nv'>lineitem_tbl</span><span class='o'>)</span>,</span>
<span>  check <span class='o'>=</span> <span class='o'>~</span> <span class='nf'><a href='https://rdrr.io/r/base/all.equal.html'>all.equal</a></span><span class='o'>(</span><span class='nv'>.x</span>, <span class='nv'>.y</span>, tolerance <span class='o'>=</span> <span class='m'>1e-10</span><span class='o'>)</span></span>
<span><span class='o'>)</span></span>
<span><span class='c'>#&gt; Warning: Some expressions had a GC in every iteration; so filtering is disabled.</span></span>
<span></span><span><span class='c'>#&gt; <span style='color: #555555;'># A tibble: 2 × 6</span></span></span>
<span><span class='c'>#&gt;   <span style='font-weight: bold;'>expression</span>                       <span style='font-weight: bold;'>min</span>   <span style='font-weight: bold;'>median</span> <span style='font-weight: bold;'>`itr/sec`</span> <span style='font-weight: bold;'>mem_alloc</span> <span style='font-weight: bold;'>`gc/sec`</span></span></span>
<span><span class='c'>#&gt;   <span style='color: #555555; font-style: italic;'>&lt;bch:expr&gt;</span>                  <span style='color: #555555; font-style: italic;'>&lt;bch:tm&gt;</span> <span style='color: #555555; font-style: italic;'>&lt;bch:tm&gt;</span>     <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span> <span style='color: #555555; font-style: italic;'>&lt;bch:byt&gt;</span>    <span style='color: #555555; font-style: italic;'>&lt;dbl&gt;</span></span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>1</span> tpch_dplyr(lineitem_tbl)     611.6ms  611.6ms      1.64    1.25GB     1.64</span></span>
<span><span class='c'>#&gt; <span style='color: #555555;'>2</span> tpch_duckplyr(lineitem_tbl)   71.4ms   72.3ms     13.8   314.38KB     0</span></span>
<span></span></code></pre>
</div>
<p>In this example, duckplyr is a lot faster than dplyr. It also appears to use much less memory, but this is misleading: DuckDB manages the memory, not R, so the memory usage is not visible to <a href="https://bench.r-lib.org/reference/mark.html" target="_blank" rel="noopener"><code>bench::mark()</code></a>.</p>
<h2 id="out-of-memory-data">Out-of-memory data
</h2>
<p>As well as improved speed with in-memory datasets, duckplyr makes it easy to work with datasets that are too big to fit in memory. In this case, you want:</p>
<ol>
<li>To work with data stored in modern formats designed for large data (e.g. Parquet).</li>
<li>To be able to store large intermediate results on disk, keeping them out of memory.</li>
<li>Fast computation!</li>
</ol>
<p>duckdplyr provides each of these features:</p>
<ol>
<li>You can read data from disk with functions like <a href="https://duckplyr.tidyverse.org/reference/read_parquet_duckdb.html" target="_blank" rel="noopener"><code>read_parquet_duckdb()</code></a>.</li>
<li>You can save intermediate results to disk with <a href="https://duckplyr.tidyverse.org/reference/compute_parquet.html" target="_blank" rel="noopener"><code>compute_parquet()</code></a> and <a href="https://duckplyr.tidyverse.org/reference/compute_csv.html" target="_blank" rel="noopener"><code>compute_csv()</code></a>.</li>
<li>duckdplyr takes advantage of DuckDB&rsquo;s query planner which considers your entire pipeline holistically to figure out the most efficient way to get the data you need.</li>
</ol>
<p>See <a href="https://duckplyr.tidyverse.org/articles/large.html" target="_blank" rel="noopener"><code>vignette(&quot;large&quot;)</code></a> for a walkthrough and more details.</p>
<h2 id="help-us-improve-duckplyr">Help us improve duckplyr!
</h2>
<p>Our goals for future development of duckplyr include:</p>
<ul>
<li>Enabling users to provide <a href="https://github.com/tidyverse/duckplyr/issues/158" target="_blank" rel="noopener">custom translations</a> of dplyr functionality;</li>
<li>Making it easier to contribute code to duckplyr;</li>
<li>Supporting more dplyr and tidyr functionality natively in DuckDB.</li>
</ul>
<p>You can help!</p>
<ul>
<li>Please report any issues, especially regarding unknown incompabilities. See <a href="https://duckplyr.tidyverse.org/articles/limits.html" target="_blank" rel="noopener"><code>vignette(&quot;limits&quot;)</code></a>.</li>
<li>Contribute to the codebase after reading duckplyr&rsquo;s <a href="https://duckplyr.tidyverse.org/CONTRIBUTING.html" target="_blank" rel="noopener">contributing guide</a>.</li>
<li>Turn on telemetry to help us hear about the most frequent fallbacks so we can prioritize working on the corresponding missing dplyr translation. See <a href="https://duckplyr.tidyverse.org/articles/telemetry.html" target="_blank" rel="noopener"><code>vignette(&quot;telemetry&quot;)</code></a> and <a href="https://duckplyr.tidyverse.org/reference/fallback.html" target="_blank" rel="noopener"><code>duckplyr::fallback_sitrep()</code></a>.</li>
</ul>
<h2 id="additional-resources">Additional resources
</h2>
<p>Eager to learn more about duckplyr &ndash; beside by trying it out yourself? The duckplyr website features several <a href="https://duckplyr.tidyverse.org/articles/" target="_blank" rel="noopener">articles</a>. Furthermore, the blog post <a href="https://duckdb.org/2024/04/02/duckplyr.html" target="_blank" rel="noopener">&ldquo;duckplyr: dplyr Powered by DuckDB&rdquo;</a> by Hannes Mühleisen provides some context on duckplyr including its inner workings, as also seen in a <a href="https://blog.r-hub.io/2025/02/13/lazy-meanings/#duckplyr-lazy-evaluation-and-prudence" target="_blank" rel="noopener">section</a> of the R-hub blog post <a href="https://blog.r-hub.io/2025/02/13/lazy-meanings/" target="_blank" rel="noopener">&ldquo;Lazy introduction to laziness in R&rdquo;</a> by Maëlle Salmon, Athanasia Mo Mowinckel and Hannah Frick.</p>
<h2 id="acknowledgements">Acknowledgements
</h2>
<p>A big thanks to all folks who filed issues, created PRs and generally helped to improve duckplyr and its workhorse <a href="https://r.duckdb.org/" target="_blank" rel="noopener">duckdb</a>!</p>
<p><a href="https://github.com/adamschwing" target="_blank" rel="noopener">@adamschwing</a>, <a href="https://github.com/alejandrohagan" target="_blank" rel="noopener">@alejandrohagan</a>, <a href="https://github.com/andreranza" target="_blank" rel="noopener">@andreranza</a>, <a href="https://github.com/apalacio9502" target="_blank" rel="noopener">@apalacio9502</a>, <a href="https://github.com/apsteinmetz" target="_blank" rel="noopener">@apsteinmetz</a>, <a href="https://github.com/barracuda156" target="_blank" rel="noopener">@barracuda156</a>, <a href="https://github.com/beniaminogreen" target="_blank" rel="noopener">@beniaminogreen</a>, <a href="https://github.com/bob-rietveld" target="_blank" rel="noopener">@bob-rietveld</a>, <a href="https://github.com/brichards920" target="_blank" rel="noopener">@brichards920</a>, <a href="https://github.com/cboettig" target="_blank" rel="noopener">@cboettig</a>, <a href="https://github.com/davidjayjackson" target="_blank" rel="noopener">@davidjayjackson</a>, <a href="https://github.com/DavisVaughan" target="_blank" rel="noopener">@DavisVaughan</a>, <a href="https://github.com/Ed2uiz" target="_blank" rel="noopener">@Ed2uiz</a>, <a href="https://github.com/eitsupi" target="_blank" rel="noopener">@eitsupi</a>, <a href="https://github.com/era127" target="_blank" rel="noopener">@era127</a>, <a href="https://github.com/etiennebacher" target="_blank" rel="noopener">@etiennebacher</a>, <a href="https://github.com/eutwt" target="_blank" rel="noopener">@eutwt</a>, <a href="https://github.com/fmichonneau" target="_blank" rel="noopener">@fmichonneau</a>, <a href="https://github.com/hadley" target="_blank" rel="noopener">@hadley</a>, <a href="https://github.com/hannes" target="_blank" rel="noopener">@hannes</a>, <a href="https://github.com/hawkfish" target="_blank" rel="noopener">@hawkfish</a>, <a href="https://github.com/IndrajeetPatil" target="_blank" rel="noopener">@IndrajeetPatil</a>, <a href="https://github.com/JanSulavik" target="_blank" rel="noopener">@JanSulavik</a>, <a href="https://github.com/JavOrraca" target="_blank" rel="noopener">@JavOrraca</a>, <a href="https://github.com/jeroen" target="_blank" rel="noopener">@jeroen</a>, <a href="https://github.com/jhk0530" target="_blank" rel="noopener">@jhk0530</a>, <a href="https://github.com/joakimlinde" target="_blank" rel="noopener">@joakimlinde</a>, <a href="https://github.com/JosiahParry" target="_blank" rel="noopener">@JosiahParry</a>, <a href="https://github.com/kevbaer" target="_blank" rel="noopener">@kevbaer</a>, <a href="https://github.com/larry77" target="_blank" rel="noopener">@larry77</a>, <a href="https://github.com/lnkuiper" target="_blank" rel="noopener">@lnkuiper</a>, <a href="https://github.com/lorenzwalthert" target="_blank" rel="noopener">@lorenzwalthert</a>, <a href="https://github.com/lschneiderbauer" target="_blank" rel="noopener">@lschneiderbauer</a>, <a href="https://github.com/luisDVA" target="_blank" rel="noopener">@luisDVA</a>, <a href="https://github.com/math-mcshane" target="_blank" rel="noopener">@math-mcshane</a>, <a href="https://github.com/meersel" target="_blank" rel="noopener">@meersel</a>, <a href="https://github.com/multimeric" target="_blank" rel="noopener">@multimeric</a>, <a href="https://github.com/mytarmail" target="_blank" rel="noopener">@mytarmail</a>, <a href="https://github.com/nicki-dese" target="_blank" rel="noopener">@nicki-dese</a>, <a href="https://github.com/PMassicotte" target="_blank" rel="noopener">@PMassicotte</a>, <a href="https://github.com/prasundutta87" target="_blank" rel="noopener">@prasundutta87</a>, <a href="https://github.com/rafapereirabr" target="_blank" rel="noopener">@rafapereirabr</a>, <a href="https://github.com/Robinlovelace" target="_blank" rel="noopener">@Robinlovelace</a>, <a href="https://github.com/romainfrancois" target="_blank" rel="noopener">@romainfrancois</a>, <a href="https://github.com/sparrow925" target="_blank" rel="noopener">@sparrow925</a>, <a href="https://github.com/stefanlinner" target="_blank" rel="noopener">@stefanlinner</a>, <a href="https://github.com/szarnyasg" target="_blank" rel="noopener">@szarnyasg</a>, <a href="https://github.com/thomasp85" target="_blank" rel="noopener">@thomasp85</a>, <a href="https://github.com/TimTaylor" target="_blank" rel="noopener">@TimTaylor</a>, <a href="https://github.com/Tmonster" target="_blank" rel="noopener">@Tmonster</a>, <a href="https://github.com/toppyy" target="_blank" rel="noopener">@toppyy</a>, <a href="https://github.com/wibeasley" target="_blank" rel="noopener">@wibeasley</a>, <a href="https://github.com/yjunechoe" target="_blank" rel="noopener">@yjunechoe</a>, <a href="https://github.com/ywhcuhk" target="_blank" rel="noopener">@ywhcuhk</a>, <a href="https://github.com/zhjx19" target="_blank" rel="noopener">@zhjx19</a>, <a href="https://github.com/ablack3" target="_blank" rel="noopener">@ablack3</a>, <a href="https://github.com/actuarial-lonewolf" target="_blank" rel="noopener">@actuarial-lonewolf</a>, <a href="https://github.com/ajdamico" target="_blank" rel="noopener">@ajdamico</a>, <a href="https://github.com/amirmazmi" target="_blank" rel="noopener">@amirmazmi</a>, <a href="https://github.com/anderson461123" target="_blank" rel="noopener">@anderson461123</a>, <a href="https://github.com/andrewGhazi" target="_blank" rel="noopener">@andrewGhazi</a>, <a href="https://github.com/Antonov548" target="_blank" rel="noopener">@Antonov548</a>, <a href="https://github.com/appiehappie999" target="_blank" rel="noopener">@appiehappie999</a>, <a href="https://github.com/ArthurAndrews" target="_blank" rel="noopener">@ArthurAndrews</a>, <a href="https://github.com/arthurgailes" target="_blank" rel="noopener">@arthurgailes</a>, <a href="https://github.com/babaknaimi" target="_blank" rel="noopener">@babaknaimi</a>, <a href="https://github.com/bcaradima" target="_blank" rel="noopener">@bcaradima</a>, <a href="https://github.com/bdforbes" target="_blank" rel="noopener">@bdforbes</a>, <a href="https://github.com/bergest" target="_blank" rel="noopener">@bergest</a>, <a href="https://github.com/bill-ash" target="_blank" rel="noopener">@bill-ash</a>, <a href="https://github.com/BorgeJorge" target="_blank" rel="noopener">@BorgeJorge</a>, <a href="https://github.com/brianmsm" target="_blank" rel="noopener">@brianmsm</a>, <a href="https://github.com/chainsawriot" target="_blank" rel="noopener">@chainsawriot</a>, <a href="https://github.com/ckarnes" target="_blank" rel="noopener">@ckarnes</a>, <a href="https://github.com/clementlefevre" target="_blank" rel="noopener">@clementlefevre</a>, <a href="https://github.com/cregouby" target="_blank" rel="noopener">@cregouby</a>, <a href="https://github.com/cy-james-lee" target="_blank" rel="noopener">@cy-james-lee</a>, <a href="https://github.com/daranzolin" target="_blank" rel="noopener">@daranzolin</a>, <a href="https://github.com/david-cortes" target="_blank" rel="noopener">@david-cortes</a>, <a href="https://github.com/DavZim" target="_blank" rel="noopener">@DavZim</a>, <a href="https://github.com/denis-or" target="_blank" rel="noopener">@denis-or</a>, <a href="https://github.com/developertest1234" target="_blank" rel="noopener">@developertest1234</a>, <a href="https://github.com/dicorynia" target="_blank" rel="noopener">@dicorynia</a>, <a href="https://github.com/dsolito" target="_blank" rel="noopener">@dsolito</a>, <a href="https://github.com/e-kotov" target="_blank" rel="noopener">@e-kotov</a>, <a href="https://github.com/EAVWing" target="_blank" rel="noopener">@EAVWing</a>, <a href="https://github.com/eddelbuettel" target="_blank" rel="noopener">@eddelbuettel</a>, <a href="https://github.com/edward-burn" target="_blank" rel="noopener">@edward-burn</a>, <a href="https://github.com/elefeint" target="_blank" rel="noopener">@elefeint</a>, <a href="https://github.com/eli-daniels" target="_blank" rel="noopener">@eli-daniels</a>, <a href="https://github.com/elysabethpc" target="_blank" rel="noopener">@elysabethpc</a>, <a href="https://github.com/erikvona" target="_blank" rel="noopener">@erikvona</a>, <a href="https://github.com/florisvdh" target="_blank" rel="noopener">@florisvdh</a>, <a href="https://github.com/gaborcsardi" target="_blank" rel="noopener">@gaborcsardi</a>, <a href="https://github.com/ggrothendieck" target="_blank" rel="noopener">@ggrothendieck</a>, <a href="https://github.com/hdmm3" target="_blank" rel="noopener">@hdmm3</a>, <a href="https://github.com/hope-data-science" target="_blank" rel="noopener">@hope-data-science</a>, <a href="https://github.com/IoannaNika" target="_blank" rel="noopener">@IoannaNika</a>, <a href="https://github.com/jabrown-aepenergy" target="_blank" rel="noopener">@jabrown-aepenergy</a>, <a href="https://github.com/JamesLMacAulay" target="_blank" rel="noopener">@JamesLMacAulay</a>, <a href="https://github.com/jangorecki" target="_blank" rel="noopener">@jangorecki</a>, <a href="https://github.com/javierlenzi" target="_blank" rel="noopener">@javierlenzi</a>, <a href="https://github.com/Joe-Heffer-Shef" target="_blank" rel="noopener">@Joe-Heffer-Shef</a>, <a href="https://github.com/kalibera" target="_blank" rel="noopener">@kalibera</a>, <a href="https://github.com/lboller-pwbm" target="_blank" rel="noopener">@lboller-pwbm</a>, <a href="https://github.com/lgaborini" target="_blank" rel="noopener">@lgaborini</a>, <a href="https://github.com/m-muecke" target="_blank" rel="noopener">@m-muecke</a>, <a href="https://github.com/meztez" target="_blank" rel="noopener">@meztez</a>, <a href="https://github.com/mgirlich" target="_blank" rel="noopener">@mgirlich</a>, <a href="https://github.com/mtmorgan" target="_blank" rel="noopener">@mtmorgan</a>, <a href="https://github.com/nassuphis" target="_blank" rel="noopener">@nassuphis</a>, <a href="https://github.com/nbc" target="_blank" rel="noopener">@nbc</a>, <a href="https://github.com/olivroy" target="_blank" rel="noopener">@olivroy</a>, <a href="https://github.com/pdet" target="_blank" rel="noopener">@pdet</a>, <a href="https://github.com/phdjsep" target="_blank" rel="noopener">@phdjsep</a>, <a href="https://github.com/pierre-lamarche" target="_blank" rel="noopener">@pierre-lamarche</a>, <a href="https://github.com/r2evans" target="_blank" rel="noopener">@r2evans</a>, <a href="https://github.com/ran-codes" target="_blank" rel="noopener">@ran-codes</a>, <a href="https://github.com/rplsmn" target="_blank" rel="noopener">@rplsmn</a>, <a href="https://github.com/Saarialho" target="_blank" rel="noopener">@Saarialho</a>, <a href="https://github.com/SimonCoulombe" target="_blank" rel="noopener">@SimonCoulombe</a>, <a href="https://github.com/tau31" target="_blank" rel="noopener">@tau31</a>, <a href="https://github.com/thohan88" target="_blank" rel="noopener">@thohan88</a>, <a href="https://github.com/ThomasSoeiro" target="_blank" rel="noopener">@ThomasSoeiro</a>, <a href="https://github.com/timothygmitchell" target="_blank" rel="noopener">@timothygmitchell</a>, <a href="https://github.com/vincentarelbundock" target="_blank" rel="noopener">@vincentarelbundock</a>, <a href="https://github.com/VincentGuyader" target="_blank" rel="noopener">@VincentGuyader</a>, <a href="https://github.com/wlangera" target="_blank" rel="noopener">@wlangera</a>, <a href="https://github.com/xbasics" target="_blank" rel="noopener">@xbasics</a>, <a href="https://github.com/xiaodaigh" target="_blank" rel="noopener">@xiaodaigh</a>, <a href="https://github.com/xtimbeau" target="_blank" rel="noopener">@xtimbeau</a>, <a href="https://github.com/yng-me" target="_blank" rel="noopener">@yng-me</a>, <a href="https://github.com/Yousuf28" target="_blank" rel="noopener">@Yousuf28</a>, <a href="https://github.com/yutannihilation" target="_blank" rel="noopener">@yutannihilation</a>, and <a href="https://github.com/zcatav" target="_blank" rel="noopener">@zcatav</a></p>
<p>Special thanks to Joe Thorley (<a href="https://github.com/joethorley" target="_blank" rel="noopener">@joethorley</a>) for help with choosing the right words.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>If you haven&rsquo;t heard of it yet, watch <a href="https://www.youtube.com/watch?v=GELhdezYmP0&amp;feature=youtu.be" target="_blank" rel="noopener">Hannes Mühleisen&rsquo;s keynote at posit::conf(2024)</a>.&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p>If omitted, the results would be unchanged but the measurements would be wrong. The computation would then be triggered by the check. See <a href="https://duckplyr.tidyverse.org/articles/prudence.html" target="_blank" rel="noopener"><code>vignette(&quot;prudence&quot;)</code></a> for details.&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></description>
      <enclosure url="https://opensource.posit.co/blog/2025-06-19_duckplyr-1-1-0/thumbnail-wd.jpg" length="60990" type="image/jpeg" />
    </item>
    <item>
      <title>Data Validation Libraries for Polars (2025 Edition)</title>
      <link>https://opensource.posit.co/blog/2025-06-04_validation-libs-2025/</link>
      <pubDate>Wed, 04 Jun 2025 00:00:00 +0000</pubDate>
      <guid>https://opensource.posit.co/blog/2025-06-04_validation-libs-2025/</guid>
      <dc:creator>Rich Iannone</dc:creator><description><![CDATA[<script src="https://cdn.jsdelivr.net/npm/requirejs@2.3.6/require.min.js" integrity="sha384-c9c+LnTbwQ3aujuU7ULEPVvgLs+Fn6fJUvIGTsuu1ZcCf11fiEubah0ttpca4ntM sha384-6V1/AdqZRWk1KAlWbKBlGhN7VG4iE/yAZcO6NZPMF8od0vukrvr0tg4qY6NSrItx" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js" integrity="sha384-ZvpUoO/+PpLXR1lu4jmpXWu80pZlYUAfxl5NsBMWOEPSjUn/6Z/hRTt8+pR6L4N2" crossorigin="anonymous" data-relocate-top="true"></script>
<script type="application/javascript">define('jquery', [],function() {return window.jQuery;})</script>
<p>Data validation is a very important part of any data pipeline. And with Polars gaining popularity as
a superfast and feature-packed DataFrame library, developers need validation tools that work
seamlessly with it. But here&rsquo;s the thing: not all validation libraries are created equal, and
choosing the wrong one can lead to frustration, technical debt, or validation gaps that could bite
you later.</p>
<p>In this survey (conducted halfway through 2025) we&rsquo;ll explore five Python validation libraries that
support Polars DataFrames, each bringing distinct strengths to different validation challenges.</p>
<div class="callout callout-note" role="note" aria-label="Note">
<div class="callout-header">
<span class="callout-title">Note</span>
</div>
<div class="callout-body">
<p>Great Expectations, while being one of the most established data validation frameworks in the Python
ecosystem, is not included in this survey as it doesn&rsquo;t yet offer native Polars support. See <a href="https://github.com/great-expectations/great_expectations/issues/10702" target="_blank" rel="noopener">this
issue</a> and
<a href="https://github.com/great-expectations/great_expectations/discussions/10144" target="_blank" rel="noopener">this discussion</a> for
the inside baseball.</p>
</div>
</div>
<h2 id="recommendations">Recommendations
</h2>
<p>Here are the unique strengths for each library:</p>
<div id="yjwgihloul" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
<style>
#yjwgihloul table {
          font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }
#yjwgihloul thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#yjwgihloul p { margin: 0; padding: 0; }
 #yjwgihloul .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }
 #yjwgihloul .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #yjwgihloul .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
 #yjwgihloul .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-top-color: #FFFFFF; border-top-width: 0; }
 #yjwgihloul .gt_heading { background-color: #FFFFFF; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #yjwgihloul .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #yjwgihloul .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #yjwgihloul .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; overflow-x: hidden; }
 #yjwgihloul .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
 #yjwgihloul .gt_column_spanner_outer:first-child { padding-left: 0; }
 #yjwgihloul .gt_column_spanner_outer:last-child { padding-right: 0; }
 #yjwgihloul .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
 #yjwgihloul .gt_spanner_row { border-bottom-style: hidden; }
 #yjwgihloul .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }
 #yjwgihloul .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }
 #yjwgihloul .gt_from_md> :first-child { margin-top: 0; }
 #yjwgihloul .gt_from_md> :last-child { margin-bottom: 0; }
 #yjwgihloul .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }
 #yjwgihloul .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; }
 #yjwgihloul .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; vertical-align: top; }
 #yjwgihloul .gt_row_group_first td { border-top-width: 2px; }
 #yjwgihloul .gt_row_group_first th { border-top-width: 2px; }
 #yjwgihloul .gt_striped { color: #333333; background-color: #F4F4F4; }
 #yjwgihloul .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #yjwgihloul .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #yjwgihloul .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #yjwgihloul .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #yjwgihloul .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #yjwgihloul .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; text-align: left; }
 #yjwgihloul .gt_left { text-align: left; }
 #yjwgihloul .gt_center { text-align: center; }
 #yjwgihloul .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #yjwgihloul .gt_font_normal { font-weight: normal; }
 #yjwgihloul .gt_font_bold { font-weight: bold; }
 #yjwgihloul .gt_font_italic { font-style: italic; }
 #yjwgihloul .gt_super { font-size: 65%; }
 #yjwgihloul .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #yjwgihloul .gt_asterisk { font-size: 100%; vertical-align: 0; }
</style>
<table>
  <thead>
      <tr>
          <th>Library</th>
          <th>⭐</th>
          <th>Best Features</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><a href="https://github.com/unionai-oss/pandera" style="color: #333333; text-underline-offset: 3px;">Pandera</a></td>
          <td>3,838</td>
          <td>Statistical testing, schema-centric validation, mypy integration</td>
      </tr>
      <tr>
          <td><a href="https://github.com/JakobGM/patito" style="color: #333333; text-underline-offset: 3px;">Patito</a></td>
          <td>468</td>
          <td>Pydantic integration, model-based validation, row-level objects</td>
      </tr>
      <tr>
          <td><a href="https://github.com/posit-dev/pointblank" style="color: #333333; text-underline-offset: 3px;">Pointblank</a></td>
          <td>173</td>
          <td>Interactive reports, threshold management, stakeholder communication</td>
      </tr>
      <tr>
          <td><a href="https://github.com/akmalsoliev/Validoopsie" style="color: #333333; text-underline-offset: 3px;">Validoopsie</a></td>
          <td>63</td>
          <td>Built-in logging, composable validation, impact levels, lightweight Great Expectations alternative</td>
      </tr>
      <tr>
          <td><a href="https://github.com/Quantco/dataframely" style="color: #333333; text-underline-offset: 3px;">Dataframely</a></td>
          <td>319</td>
          <td>Collection validation, advanced type safety, failure analysis</td>
      </tr>
  </tbody>
</table>
</div>
<p>Based on these strengths, here are my recommendations for which libraries to use according to use case:</p>
<div id="gmfutgpugr" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
<style>
#gmfutgpugr table {
          font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }
#gmfutgpugr thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#gmfutgpugr p { margin: 0; padding: 0; }
 #gmfutgpugr .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }
 #gmfutgpugr .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #gmfutgpugr .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
 #gmfutgpugr .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-top-color: #FFFFFF; border-top-width: 0; }
 #gmfutgpugr .gt_heading { background-color: #FFFFFF; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #gmfutgpugr .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #gmfutgpugr .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #gmfutgpugr .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; overflow-x: hidden; }
 #gmfutgpugr .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
 #gmfutgpugr .gt_column_spanner_outer:first-child { padding-left: 0; }
 #gmfutgpugr .gt_column_spanner_outer:last-child { padding-right: 0; }
 #gmfutgpugr .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
 #gmfutgpugr .gt_spanner_row { border-bottom-style: hidden; }
 #gmfutgpugr .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }
 #gmfutgpugr .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }
 #gmfutgpugr .gt_from_md> :first-child { margin-top: 0; }
 #gmfutgpugr .gt_from_md> :last-child { margin-bottom: 0; }
 #gmfutgpugr .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }
 #gmfutgpugr .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; }
 #gmfutgpugr .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; vertical-align: top; }
 #gmfutgpugr .gt_row_group_first td { border-top-width: 2px; }
 #gmfutgpugr .gt_row_group_first th { border-top-width: 2px; }
 #gmfutgpugr .gt_striped { color: #333333; background-color: #F4F4F4; }
 #gmfutgpugr .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #gmfutgpugr .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #gmfutgpugr .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #gmfutgpugr .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #gmfutgpugr .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #gmfutgpugr .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; text-align: left; }
 #gmfutgpugr .gt_left { text-align: left; }
 #gmfutgpugr .gt_center { text-align: center; }
 #gmfutgpugr .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #gmfutgpugr .gt_font_normal { font-weight: normal; }
 #gmfutgpugr .gt_font_bold { font-weight: bold; }
 #gmfutgpugr .gt_font_italic { font-style: italic; }
 #gmfutgpugr .gt_super { font-size: 65%; }
 #gmfutgpugr .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #gmfutgpugr .gt_asterisk { font-size: 100%; vertical-align: 0; }
</style>
<table>
  <thead>
      <tr>
          <th>Use Case</th>
          <th>Best Libraries</th>
          <th>Description</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Type-safe pipelines</td>
          <td>Pandera, Dataframely, Patito</td>
          <td>Static type checking and compile-time validation</td>
      </tr>
      <tr>
          <td>Stakeholder reporting</td>
          <td>Pointblank</td>
          <td>Sharing validation results with non-technical teams</td>
      </tr>
      <tr>
          <td>Row-level object modeling</td>
          <td>Patito</td>
          <td>Converting DataFrame rows to Python objects with business logic</td>
      </tr>
      <tr>
          <td>Statistical validation</td>
          <td>Pandera</td>
          <td>Testing data distributions and statistical properties</td>
      </tr>
      <tr>
          <td>Data quality improvement</td>
          <td>Pointblank, Validoopsie</td>
          <td>Gradual quality improvement with threshold tracking</td>
      </tr>
  </tbody>
</table>
</div>
<h2 id="setup">Setup
</h2>
<p>We are going to run through examples with <strong>Pandera</strong>, <strong>Patito</strong>, <strong>Pointblank</strong>, <strong>Validoopsie</strong>,
and <strong>Dataframely</strong>, using this Polars DataFrame as our test case:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">polars</span> <span class="k">as</span> <span class="nn">pl</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Standard dataset for all validation examples</span>
</span></span><span class="line"><span class="cl"><span class="n">user_data</span> <span class="o">=</span> <span class="n">pl</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">({</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;user_id&#34;</span><span class="p">:</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">],</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;age&#34;</span><span class="p">:</span> <span class="p">[</span><span class="mi">25</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="mi">22</span><span class="p">,</span> <span class="mi">45</span><span class="p">,</span> <span class="mi">95</span><span class="p">],</span>  <span class="c1"># &lt;- includes a very high age</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;email&#34;</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl">        <span class="s2">&#34;user1@example.com&#34;</span><span class="p">,</span> <span class="s2">&#34;user2@example.com&#34;</span><span class="p">,</span> <span class="s2">&#34;invalid-email&#34;</span><span class="p">,</span>  <span class="c1"># &lt;- has an invalid email</span>
</span></span><span class="line"><span class="cl">        <span class="s2">&#34;user4@example.com&#34;</span><span class="p">,</span> <span class="s2">&#34;user5@example.com&#34;</span>
</span></span><span class="line"><span class="cl">    <span class="p">],</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;score&#34;</span><span class="p">:</span> <span class="p">[</span><span class="mf">85.5</span><span class="p">,</span> <span class="mf">92.0</span><span class="p">,</span> <span class="mf">78.3</span><span class="p">,</span> <span class="mf">88.7</span><span class="p">,</span> <span class="mf">95.2</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="p">})</span></span></span></code></pre></div></div>
<p>We&rsquo;ll try to run the same data validation across the surveyed libraries, so we&rsquo;ll check:</p>
<ul>
<li>schema validation (correct column types)</li>
<li><code>user_id</code> values greater than <code>0</code></li>
<li><code>age</code> values between <code>18</code> and <code>80</code> (inclusive)</li>
<li><code>email</code> strings matching a basic email regex pattern</li>
<li><code>score</code> values between <code>0</code> and <code>100</code> (inclusive)</li>
</ul>
<p>Now let&rsquo;s dive into each library, starting with the statistically-focused Pandera.</p>
<h2 id="1-pandera-schema-first-validation-with-statistical-checks">1. Pandera: Schema-First Validation with Statistical Checks
</h2>
<p>Pandera is a statistical data validation toolkit designed to provide a flexible and expressive API
for performing data validation on dataframe-like objects. The library centers on schema-centric
validation, where you define the expected structure and constraints of your data upfront. You can
enable both runtime validation and static type checking integration. Pandera added Polars support in
version <code>0.19.0</code> (early 2024).</p>
<h3 id="example">Example
</h3>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pandera.polars</span> <span class="k">as</span> <span class="nn">pa</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Define schema using our standard dataset</span>
</span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="n">pa</span><span class="o">.</span><span class="n">DataFrameSchema</span><span class="p">({</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;user_id&#34;</span><span class="p">:</span> <span class="n">pa</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">pl</span><span class="o">.</span><span class="n">Int64</span><span class="p">,</span> <span class="n">checks</span><span class="o">=</span><span class="n">pa</span><span class="o">.</span><span class="n">Check</span><span class="o">.</span><span class="n">gt</span><span class="p">(</span><span class="mi">0</span><span class="p">)),</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;age&#34;</span><span class="p">:</span> <span class="n">pa</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">pl</span><span class="o">.</span><span class="n">Int64</span><span class="p">,</span> <span class="n">checks</span><span class="o">=</span><span class="p">[</span><span class="n">pa</span><span class="o">.</span><span class="n">Check</span><span class="o">.</span><span class="n">ge</span><span class="p">(</span><span class="mi">18</span><span class="p">),</span> <span class="n">pa</span><span class="o">.</span><span class="n">Check</span><span class="o">.</span><span class="n">le</span><span class="p">(</span><span class="mi">80</span><span class="p">)]),</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;email&#34;</span><span class="p">:</span> <span class="n">pa</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">pl</span><span class="o">.</span><span class="n">Utf8</span><span class="p">,</span> <span class="n">checks</span><span class="o">=</span><span class="n">pa</span><span class="o">.</span><span class="n">Check</span><span class="o">.</span><span class="n">str_matches</span><span class="p">(</span><span class="sa">r</span><span class="s2">&#34;^[^@]+@[^@]+\.[^@]+$&#34;</span><span class="p">)),</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;score&#34;</span><span class="p">:</span> <span class="n">pa</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">pl</span><span class="o">.</span><span class="n">Float64</span><span class="p">,</span> <span class="n">checks</span><span class="o">=</span><span class="n">pa</span><span class="o">.</span><span class="n">Check</span><span class="o">.</span><span class="n">in_range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">100</span><span class="p">))</span>
</span></span><span class="line"><span class="cl"><span class="p">})</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Validate the schema</span>
</span></span><span class="line"><span class="cl"><span class="k">try</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">    <span class="n">validated_data</span> <span class="o">=</span> <span class="n">schema</span><span class="o">.</span><span class="n">validate</span><span class="p">(</span><span class="n">user_data</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="nb">print</span><span class="p">(</span><span class="s2">&#34;Validation successful!&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="k">except</span> <span class="n">pa</span><span class="o">.</span><span class="n">errors</span><span class="o">.</span><span class="n">SchemaError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">    <span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&#34;Validation failed: </span><span class="si">{</span><span class="n">e</span><span class="si">}</span><span class="s2">&#34;</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code>Validation failed: Column 'age' failed validator number 1: &lt;Check less_than_or_equal_to: less_than_or_equal_to(80)&gt; failure case examples: [{'age': 95}]
</code></pre>
<p>This example demonstrates Pandera&rsquo;s declarative approach, where you define what your data should
look like rather than writing imperative validation logic. The schema acts as both documentation and
as a validation contract. Notice how multiple checks can be applied to a single column (here, the
<code>age</code> column receives two checks), and the validation either succeeds completely or provides
error information about what failed.</p>
<h3 id="comparisons">Comparisons
</h3>
<p>Both Pandera and Patito use declarative, schema-centric approaches, but differ in their design
philosophies:</p>
<ul>
<li>Pandera uses a dictionary-like schema structure with Column objects for defining validation rules</li>
<li>Patito uses Pydantic model classes with familiar Field syntax for validation constraints</li>
<li>Pandera focuses heavily on statistical validation capabilities like hypothesis testing</li>
<li>Patito emphasizes integration with existing Pydantic workflows and object modeling</li>
<li>a key behavioral difference: Patito reports all validation errors in a single pass, while Pandera
stops at the first failure</li>
</ul>
<p>The choice between them often comes down to whether you prefer Pandera&rsquo;s statistical focus or
Patito&rsquo;s Pydantic integration.</p>
<p>Unlike Pointblank&rsquo;s step-by-step validation reporting, Pandera validates the entire schema at once.
Compared to Patito&rsquo;s model-based approach, Pandera focuses more on statistical validation
capabilities. Unlike Validoopsie&rsquo;s and Pointblank&rsquo;s method chaining style, Pandera uses a more
declarative, schema-centric approach.</p>
<h3 id="unique-strengths-and-when-to-use">Unique Strengths and When to Use
</h3>
<p>Here are some of stand-out features that Pandera has:</p>
<ul>
<li>type-safe schema definitions with <code>mypy</code> integration</li>
<li>statistical hypothesis testing for data distributions: perform t-tests, chi-square tests, and
custom statistical tests directly in your validation schema</li>
<li>excellent integration with Pandas, Polars, and Arrow support</li>
<li>declarative schema syntax that serves as documentation</li>
<li>built-in support for data coercion and transformation</li>
</ul>
<p>This statistical validation capability goes beyond basic type and range checking to test actual data
relationships and distributional assumptions. For example, you can validate that the mean height of
group <code>&quot;M&quot;</code> is significantly greater than group <code>&quot;F&quot;</code> using a two-sample t-test, or test whether a
column follows a normal distribution. This makes Pandera uniquely powerful for data science
workflows where the statistical properties of your data are as important as individual data points
meeting basic constraints.</p>
<p>Data practitioners should choose Pandera when building type-safe data pipelines where schema
validation is critical, especially in data science workflows that require statistical validation.
It&rsquo;s ideal for users that value static type checking, need to validate statistical properties of
their data, or want schemas that double as documentation.</p>
<p>Pandera also excels in environments where data contracts between teams are important and where the
statistical properties of data matter as much as basic type checking.</p>
<h2 id="2-patito-pydantic-style-data-models-for-dataframes">2. Patito: Pydantic-Style Data Models for DataFrames
</h2>
<p>Patito brings Pydantic&rsquo;s well-received model-based validation approach to DataFrame validation,
creating a bridge between Pydantic-style data validation and DataFrame processing. The library&rsquo;s
primary goal is to provide a familiar, Pydantic-style interface for defining and validating
DataFrame schemas, making it particularly appealing to developers already using Pydantic in their
applications.</p>
<p>Patito launched with Polars support from the beginning (in late 2022). Native Polars integration is
touted as one of its core features, reflecting the growing adoption of Polars in the Python
ecosystem.</p>
<h3 id="example-1">Example
</h3>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">patito</span> <span class="k">as</span> <span class="nn">pt</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Annotated</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">class</span> <span class="nc">UserModel</span><span class="p">(</span><span class="n">pt</span><span class="o">.</span><span class="n">Model</span><span class="p">):</span>
</span></span><span class="line"><span class="cl">    <span class="n">user_id</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="n">pt</span><span class="o">.</span><span class="n">Field</span><span class="p">(</span><span class="n">gt</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="n">age</span><span class="p">:</span> <span class="n">Annotated</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="n">pt</span><span class="o">.</span><span class="n">Field</span><span class="p">(</span><span class="n">ge</span><span class="o">=</span><span class="mi">18</span><span class="p">,</span> <span class="n">le</span><span class="o">=</span><span class="mi">80</span><span class="p">)]</span>
</span></span><span class="line"><span class="cl">    <span class="n">email</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="n">pt</span><span class="o">.</span><span class="n">Field</span><span class="p">(</span><span class="n">pattern</span><span class="o">=</span><span class="sa">r</span><span class="s2">&#34;^[^@]+@[^@]+\.[^@]+$&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="n">score</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="n">pt</span><span class="o">.</span><span class="n">Field</span><span class="p">(</span><span class="n">ge</span><span class="o">=</span><span class="mf">0.0</span><span class="p">,</span> <span class="n">le</span><span class="o">=</span><span class="mf">100.0</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Validate using the model</span>
</span></span><span class="line"><span class="cl"><span class="k">try</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">    <span class="n">UserModel</span><span class="o">.</span><span class="n">validate</span><span class="p">(</span><span class="n">user_data</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="nb">print</span><span class="p">(</span><span class="s2">&#34;Validation successful!&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="k">except</span> <span class="n">pt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">DataFrameValidationError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">    <span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&#34;Validation failed: </span><span class="si">{</span><span class="n">e</span><span class="si">}</span><span class="s2">&#34;</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><code>Validation failed: 2 validation errors for UserModel
age
  1 row with out of bound values. (type=value_error.rowvalue)
email
  1 row with out of bound values. (type=value_error.rowvalue)
</code></pre>
<p>This example showcases Patito&rsquo;s model-centric approach where validation rules are embedded in class
definitions. The use of Python&rsquo;s type hints and Pydantic&rsquo;s Field syntax makes the validation rules
self-documenting. Notably, Patito reports all validation errors at once, providing a fairly
comprehensive view of data quality issues, whereas other libraries (e.g., Pandera) stop at the first
failure.</p>
<h3 id="column-validation-approaches-pandera-vs-patito">Column Validation Approaches: Pandera vs Patito
</h3>
<p><strong>Pandera offers a much more extensive and flexible system for column validation</strong> compared to
Patito&rsquo;s field-based approach. While Patito provides a solid set of built-in field constraints
(like <code>gt</code>, <code>le</code>, <code>regex</code>, <code>unique</code>, etc.) that cover common validation scenarios, Pandera&rsquo;s Check
system is designed for both simple and highly sophisticated validation logic.</p>
<p>The key architectural difference seems to lie in extensibility and complexity. Pandera&rsquo;s <code>Check</code>
objects accept arbitrary functions, allowing you to write custom validation logic that can be as
simple as <code>lambda s: s &gt; 0</code> or as complex as statistical hypothesis tests using scipy. You can
create vectorized checks that operate on entire Series objects for performance, element-wise checks
for atomic validation, and even grouped checks that validate subsets of data based on other columns.
Patito&rsquo;s <code>Field</code> constraints, while clean and declarative, are more limited to the predefined
validation types that Pydantic and Patito provide.</p>
<p>Pandera also supports advanced validation patterns that Patito doesn&rsquo;t directly offer, such as
wide-form data checks (validating relationships across multiple columns), grouped validation (where
checks are applied to subsets of data based on grouping columns), and the ability to raise warnings
instead of errors for non-critical validation failures. While Patito does support custom constraints
through Polars expressions via the <code>constraints</code> parameter, this requires knowledge of Polars
expression syntax and, depending on where you&rsquo;re coming from, could be less intuitive than Pandera&rsquo;s
function-based approach.</p>
<p>For most common validation scenarios, Patito&rsquo;s field-based validation is simpler and more readable,
especially for teams already familiar with Pydantic. However, for complex data validation
requirements, statistical validation, or when you need maximum flexibility in defining validation
logic, Pandera&rsquo;s Check system provides significantly more power and extensibility.</p>
<h3 id="unique-strengths-and-when-to-use-1">Unique Strengths and When to Use
</h3>
<ul>
<li>Pydantic-style model definitions with familiar syntax for Pydantic users</li>
<li>rich type system integration with Python&rsquo;s typing system</li>
<li>model inheritance and composition for complex data structures</li>
<li>seamless integration with existing Pydantic-based applications</li>
<li>row-level object modeling for converting DataFrame rows to Python objects with methods</li>
<li>mock data generation for testing with <code>.examples()</code> method</li>
</ul>
<p>People should choose Patito when they&rsquo;re already using Pydantic in their applications and want
consistent validation patterns across data processing and application logic. It&rsquo;s great when you
need to validate DataFrames and then work with individual rows as rich Python objects with embedded
business logic and methods (e.g., a <code>Product</code> row that has a <code>.url</code> property or
<code>.calculate_discount()</code> method). Patito is also good when you need to generate realistic test data
and want object-oriented interfaces for their data models.</p>
<h2 id="3-pointblank-comprehensive-validation-with-beautiful-reports">3. Pointblank: Comprehensive Validation with Beautiful Reports
</h2>
<p>Pointblank is a comprehensive data validation framework designed to make data quality assessment
both thorough and accessible to stakeholders. Originally inspired by the R package of the same name,
Pointblank&rsquo;s primary mission is to provide validation workflows that generate beautiful, interactive
reports that can be shared with both technical and non-technical team members.</p>
<p>Pointblank launched with Polars support as a core feature from its initial Python release in late
2024, built on top of the Narwhals and Ibis compatibility layers to provide consistent DataFrame
operations across multiple backends including Polars, Pandas, and database connections.</p>
<h3 id="example-2">Example
</h3>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pointblank</span> <span class="k">as</span> <span class="nn">pb</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="n">pb</span><span class="o">.</span><span class="n">Schema</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">columns</span><span class="o">=</span><span class="p">[(</span><span class="s2">&#34;user_id&#34;</span><span class="p">,</span> <span class="s2">&#34;Int64&#34;</span><span class="p">),</span> <span class="p">(</span><span class="s2">&#34;age&#34;</span><span class="p">,</span> <span class="s2">&#34;Int64&#34;</span><span class="p">),</span> <span class="p">(</span><span class="s2">&#34;email&#34;</span><span class="p">,</span> <span class="s2">&#34;String&#34;</span><span class="p">),</span> <span class="p">(</span><span class="s2">&#34;score&#34;</span><span class="p">,</span> <span class="s2">&#34;Float64&#34;</span><span class="p">)]</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">validation</span> <span class="o">=</span> <span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">pb</span><span class="o">.</span><span class="n">Validate</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">user_data</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s2">&#34;An example.&#34;</span><span class="p">,</span> <span class="n">tbl_name</span><span class="o">=</span><span class="s2">&#34;users&#34;</span><span class="p">,</span> <span class="n">thresholds</span><span class="o">=</span><span class="p">(</span><span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.3</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">col_vals_gt</span><span class="p">(</span><span class="n">columns</span><span class="o">=</span><span class="s2">&#34;user_id&#34;</span><span class="p">,</span> <span class="n">value</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">col_vals_between</span><span class="p">(</span><span class="n">columns</span><span class="o">=</span><span class="s2">&#34;age&#34;</span><span class="p">,</span> <span class="n">left</span><span class="o">=</span><span class="mi">18</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="mi">80</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">col_vals_regex</span><span class="p">(</span><span class="n">columns</span><span class="o">=</span><span class="s2">&#34;email&#34;</span><span class="p">,</span> <span class="n">pattern</span><span class="o">=</span><span class="sa">r</span><span class="s2">&#34;^[^@]+@[^@]+\.[^@]+$&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">col_vals_between</span><span class="p">(</span><span class="n">columns</span><span class="o">=</span><span class="s2">&#34;score&#34;</span><span class="p">,</span> <span class="n">left</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="mi">100</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">col_schema_match</span><span class="p">(</span><span class="n">schema</span><span class="o">=</span><span class="n">schema</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">interrogate</span><span class="p">()</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">validation</span></span></span></code></pre></div></div>
<div id="pb_tbl" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
<style>
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans&display=swap');
#pb_tbl table {
          font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }
#pb_tbl thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#pb_tbl p { margin: 0; padding: 0; }
 #pb_tbl .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 90%; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }
 #pb_tbl .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #pb_tbl .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
 #pb_tbl .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
 #pb_tbl .gt_heading { background-color: #FFFFFF; text-align: left; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #pb_tbl .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #pb_tbl .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #pb_tbl .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; overflow-x: hidden; }
 #pb_tbl .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
 #pb_tbl .gt_column_spanner_outer:first-child { padding-left: 0; }
 #pb_tbl .gt_column_spanner_outer:last-child { padding-right: 0; }
 #pb_tbl .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
 #pb_tbl .gt_spanner_row { border-bottom-style: hidden; }
 #pb_tbl .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }
 #pb_tbl .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }
 #pb_tbl .gt_from_md> :first-child { margin-top: 0; }
 #pb_tbl .gt_from_md> :last-child { margin-bottom: 0; }
 #pb_tbl .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }
 #pb_tbl .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; }
 #pb_tbl .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; vertical-align: top; }
 #pb_tbl .gt_row_group_first td { border-top-width: 2px; }
 #pb_tbl .gt_row_group_first th { border-top-width: 2px; }
 #pb_tbl .gt_striped { color: #333333; background-color: #F4F4F4; }
 #pb_tbl .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #pb_tbl .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #pb_tbl .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #pb_tbl .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #pb_tbl .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #pb_tbl .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #pb_tbl .gt_left { text-align: left; }
 #pb_tbl .gt_center { text-align: center; }
 #pb_tbl .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #pb_tbl .gt_font_normal { font-weight: normal; }
 #pb_tbl .gt_font_bold { font-weight: bold; }
 #pb_tbl .gt_font_italic { font-style: italic; }
 #pb_tbl .gt_super { font-size: 65%; }
 #pb_tbl .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #pb_tbl .gt_asterisk { font-size: 100%; vertical-align: 0; }
</style>
<table style="table-layout: fixed;; width: 0px" class="gt_table" data-quarto-disable-processing="true" data-quarto-bootstrap="false">
<colgroup>
  <col style="width:4px;"/>
  <col style="width:35px;"/>
  <col style="width:190px;"/>
  <col style="width:120px;"/>
  <col style="width:120px;"/>
  <col style="width:50px;"/>
  <col style="width:50px;"/>
  <col style="width:60px;"/>
  <col style="width:60px;"/>
  <col style="width:60px;"/>
  <col style="width:30px;"/>
  <col style="width:30px;"/>
  <col style="width:30px;"/>
  <col style="width:65px;"/>
</colgroup>
<thead>
  <tr class="gt_heading">
    <td colspan="14" class="gt_heading gt_title gt_font_normal" style="color: #444444;font-size: 28px;text-align: left;font-weight: bold; text-align: left;">Pointblank Validation</td>
  </tr>
  <tr class="gt_heading">
    <td colspan="14" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border" style="text-align: left;"><div><span style='text-decoration-style: solid; text-decoration-color: #ADD8E6; text-decoration-line: underline; text-underline-position: under; color: #333333; font-variant-numeric: tabular-nums; padding-left: 4px; margin-right: 5px; padding-right: 2px;'>An example.</span><div style="padding-top: 10px; padding-bottom: 5px;"><span style='background-color: #0075FF; color: #FFFFFF; padding: 0.5em 0.5em; position: inherit; text-transform: uppercase; margin: 5px 0px 5px 0px; border: solid 1px #0075FF; font-weight: bold; padding: 2px 15px 2px 15px; font-size: 10px;'>Polars</span><span style='background-color: none; color: #222222; padding: 0.5em 0.5em; position: inherit; margin: 5px 10px 5px -4px; border: solid 1px #0075FF; font-weight: bold; padding: 2px 15px 2px 15px; font-size: 10px;'>users</span><span><span style="background-color: #AAAAAA; color: white; padding: 0.5em 0.5em; position: inherit; text-transform: uppercase; margin: 5px 0px 5px 5px; border: solid 1px #AAAAAA; font-weight: bold; padding: 2px 15px 2px 15px; font-size: smaller;">WARNING</span><span style="background-color: none; color: #333333; padding: 0.5em 0.5em; position: inherit; margin: 5px 0px 5px -4px; font-weight: bold; border: solid 1px #AAAAAA; padding: 2px 15px 2px 15px; font-size: smaller; margin-right: 5px;">0.1</span><span style="background-color: #EBBC14; color: white; padding: 0.5em 0.5em; position: inherit; text-transform: uppercase; margin: 5px 0px 5px 1px; border: solid 1px #EBBC14; font-weight: bold; padding: 2px 15px 2px 15px; font-size: smaller;">ERROR</span><span style="background-color: none; color: #333333; padding: 0.5em 0.5em; position: inherit; margin: 5px 0px 5px -4px; font-weight: bold; border: solid 1px #EBBC14; padding: 2px 15px 2px 15px; font-size: smaller; margin-right: 5px;">0.2</span><span style="background-color: #FF3300; color: white; padding: 0.5em 0.5em; position: inherit; text-transform: uppercase; margin: 5px 0px 5px 1px; border: solid 1px #FF3300; font-weight: bold; padding: 2px 15px 2px 15px; font-size: smaller;">CRITICAL</span><span style="background-color: none; color: #333333; padding: 0.5em 0.5em; position: inherit; margin: 5px 0px 5px -4px; font-weight: bold; border: solid 1px #FF3300; padding: 2px 15px 2px 15px; font-size: smaller;">0.3</span></span></div></div></td>
  </tr>
<tr class="gt_col_headings">
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-status_color"></th>
  <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-i"></th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-type_upd">STEP</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-columns_upd">COLUMNS</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-values_upd">VALUES</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-tbl">TBL</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-eval">EVAL</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-test_units">UNITS</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-pass">PASS</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-fail">FAIL</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-w_upd">W</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-e_upd">E</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-c_upd">C</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" style="color: #666666;font-weight: bold;" scope="col" id="pb_tbl-extract_upd">EXT</th>
</tr>
</thead>
<tbody class="gt_table_body">
  <tr>
    <td style="height: 40px; background-color: #4CA64C; color: transparent;font-size: 0px;" class="gt_row gt_left">#4CA64C</td>
    <td style="height: 40px; color: #666666;font-size: 13px;font-weight: bold;" class="gt_row gt_right">1</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" class="gt_row gt_left">
        <div style="margin: 0; padding: 0; display: inline-block; height: 30px; vertical-align: middle; width: 16%;">
            <!--?xml version="1.0" encoding="UTF-8"?--><?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="30px" viewBox="0 0 67 67" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="background: #FFFFFF;">
    <title>col_vals_gt</title>
    <g id="Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="col_vals_gt" transform="translate(1.500000, 1.500000)" fill-rule="nonzero">
            <path d="M55,0 C57.4852813,0 59.7352813,1.00735931 61.363961,2.63603897 C62.9926407,4.26471863 64,6.51471863 64,9 L64,9 L64,64 L9,64 C6.51471862,64 4.26471862,62.9926407 2.63603897,61.363961 C1.00735931,59.7352814 0,57.4852814 0,55 L0,55 L0,9 C0,6.51471863 1.00735931,4.26471863 2.63603897,2.63603897 C4.26471862,1.00735931 6.51471862,0 9,0 L9,0 L55,0 Z" id="rectangle" stroke="#000000" stroke-width="2" fill="#FFFFFF"></path>
            <path d="M48.7619048,10 L15.2380953,10 C12.3466667,10 10,12.3466667 10,15.2380952 L10,48.7619048 C10,51.6533333 12.3466667,54 15.2380953,54 L48.7619048,54 C51.6533333,54 54,51.6533333 54,48.7619048 L54,15.2380952 C54,12.3466667 51.6533333,10 48.7619048,10 Z M25.2638095,44.3828571 L24.0695238,42.6647619 L39.5847619,32 L24.0695238,21.3352381 L25.2638095,19.6171429 L43.2828572,32 L25.2638095,44.3828571 Z" id="greater_than" fill="#000000"></path>
        </g>
    </g>
</svg>
        </div>
        <div style="font-family: 'IBM Plex Mono', monospace, courier; color: black; font-size: 11px; display: inline-block; vertical-align: middle;">
            <div>col_vals_gt()</div>
        </div>
        </td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">user_id</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">0</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" class="gt_row gt_center"><svg width="25px" height="25px" viewBox="0 0 25 25" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="vertical-align: middle;">
    <g id="unchanged" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="unchanged" transform="translate(0.500000, 0.570147)">
            <rect id="Rectangle" x="0.125132506" y="0" width="23.749735" height="23.7894737"></rect>
            <path d="M5.80375046,8.18194736 C3.77191832,8.18194736 2.11875046,9.83495328 2.11875046,11.8669474 C2.11875046,13.8989414 3.77191832,15.5519474 5.80375046,15.5519474 C7.8355826,15.5519474 9.48875046,13.8989414 9.48875046,11.8669474 C9.48875046,9.83495328 7.83552863,8.18194736 5.80375046,8.18194736 Z M5.80375046,14.814915 C4.17821997,14.814915 2.85578285,13.4924778 2.85578285,11.8669474 C2.85578285,10.2414169 4.17821997,8.91897975 5.80375046,8.91897975 C7.42928095,8.91897975 8.75171807,10.2414169 8.75171807,11.8669474 C8.75171807,13.4924778 7.42928095,14.814915 5.80375046,14.814915 Z" id="Shape" fill="#000000" fill-rule="nonzero"></path>
            <path d="M13.9638189,8.699335 C13.9364621,8.70430925 13.9091059,8.71176968 13.8842359,8.71923074 C13.7822704,8.73663967 13.6877654,8.77643115 13.6056956,8.83860518 L10.2433156,11.3852598 C10.0766886,11.5046343 9.97720993,11.6986181 9.97720993,11.9025491 C9.97720993,12.1064807 10.0766886,12.3004639 10.2433156,12.4198383 L13.6056956,14.966493 C13.891697,15.1803725 14.2970729,15.1231721 14.5109517,14.8371707 C14.7248313,14.5511692 14.6676309,14.145794 14.3816294,13.9319145 L12.5313257,12.5392127 L21.8812495,12.5392127 L21.8812495,11.2658854 L12.5313257,11.2658854 L14.3816294,9.87318364 C14.6377872,9.71650453 14.7497006,9.40066014 14.6477351,9.11714553 C14.5482564,8.83363156 14.262255,8.65954352 13.9638189,8.699335 Z" id="arrow" fill="#000000" transform="translate(15.929230, 11.894737) rotate(-180.000000) translate(-15.929230, -11.894737) "></path>
        </g>
    </g>
</svg></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" class="gt_row gt_center"><span style="color:#4CA64C;">&check;</span></td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" class="gt_row gt_right">5</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" class="gt_row gt_right">5<br />1.00</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" class="gt_row gt_right">0<br />0.00</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" class="gt_row gt_center"><span style="color: #AAAAAA;">&cir;</span></td>
    <td style="height: 40px; background-color: #FCFCFC;" class="gt_row gt_center"><span style="color: #EBBC14;">&cir;</span></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" class="gt_row gt_center"><span style="color: #FF3300;">&cir;</span></td>
    <td style="height: 40px;" class="gt_row gt_center">—</td>
  </tr>
  <tr>
    <td style="height: 40px; background-color: #EBBC14; color: transparent;font-size: 0px;" class="gt_row gt_left">#EBBC14</td>
    <td style="height: 40px; color: #666666;font-size: 13px;font-weight: bold;" class="gt_row gt_right">2</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" class="gt_row gt_left">
        <div style="margin: 0; padding: 0; display: inline-block; height: 30px; vertical-align: middle; width: 16%;">
            <!--?xml version="1.0" encoding="UTF-8"?--><?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="30px" viewBox="0 0 67 67" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>col_vals_between</title>
    <g id="Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="col_vals_between" transform="translate(0.000000, 0.206897)">
            <path d="M56.712234,1 C59.1975153,1 61.4475153,2.00735931 63.076195,3.63603897 C64.7048747,5.26471863 65.712234,7.51471863 65.712234,10 L65.712234,10 L65.712234,65 L10.712234,65 C8.22695259,65 5.97695259,63.9926407 4.34827294,62.363961 C2.71959328,60.7352814 1.71223397,58.4852814 1.71223397,56 L1.71223397,56 L1.71223397,10 C1.71223397,7.51471863 2.71959328,5.26471863 4.34827294,3.63603897 C5.97695259,2.00735931 8.22695259,1 10.712234,1 L10.712234,1 Z" id="rectangle" stroke="#000000" stroke-width="2" fill="#FFFFFF"></path>
            <path d="M11.993484,21.96875 C10.962234,22.082031 10.188797,22.964844 10.212234,24 L10.212234,42 C10.200515,42.722656 10.579422,43.390625 11.204422,43.753906 C11.825515,44.121094 12.598953,44.121094 13.220047,43.753906 C13.845047,43.390625 14.223953,42.722656 14.212234,42 L14.212234,24 C14.220047,23.457031 14.009109,22.9375 13.626297,22.554688 C13.243484,22.171875 12.723953,21.960938 12.180984,21.96875 C12.118484,21.964844 12.055984,21.964844 11.993484,21.96875 Z M55.993484,21.96875 C54.962234,22.082031 54.188797,22.964844 54.212234,24 L54.212234,42 C54.200515,42.722656 54.579422,43.390625 55.204422,43.753906 C55.825515,44.121094 56.598953,44.121094 57.220047,43.753906 C57.845047,43.390625 58.223953,42.722656 58.212234,42 L58.212234,24 C58.220047,23.457031 58.009109,22.9375 57.626297,22.554688 C57.243484,22.171875 56.723953,21.960938 56.180984,21.96875 C56.118484,21.964844 56.055984,21.964844 55.993484,21.96875 Z M16.212234,22 C15.661453,22 15.212234,22.449219 15.212234,23 C15.212234,23.550781 15.661453,24 16.212234,24 C16.763015,24 17.212234,23.550781 17.212234,23 C17.212234,22.449219 16.763015,22 16.212234,22 Z M20.212234,22 C19.661453,22 19.212234,22.449219 19.212234,23 C19.212234,23.550781 19.661453,24 20.212234,24 C20.763015,24 21.212234,23.550781 21.212234,23 C21.212234,22.449219 20.763015,22 20.212234,22 Z M24.212234,22 C23.661453,22 23.212234,22.449219 23.212234,23 C23.212234,23.550781 23.661453,24 24.212234,24 C24.763015,24 25.212234,23.550781 25.212234,23 C25.212234,22.449219 24.763015,22 24.212234,22 Z M28.212234,22 C27.661453,22 27.212234,22.449219 27.212234,23 C27.212234,23.550781 27.661453,24 28.212234,24 C28.763015,24 29.212234,23.550781 29.212234,23 C29.212234,22.449219 28.763015,22 28.212234,22 Z M32.212234,22 C31.661453,22 31.212234,22.449219 31.212234,23 C31.212234,23.550781 31.661453,24 32.212234,24 C32.763015,24 33.212234,23.550781 33.212234,23 C33.212234,22.449219 32.763015,22 32.212234,22 Z M36.212234,22 C35.661453,22 35.212234,22.449219 35.212234,23 C35.212234,23.550781 35.661453,24 36.212234,24 C36.763015,24 37.212234,23.550781 37.212234,23 C37.212234,22.449219 36.763015,22 36.212234,22 Z M40.212234,22 C39.661453,22 39.212234,22.449219 39.212234,23 C39.212234,23.550781 39.661453,24 40.212234,24 C40.763015,24 41.212234,23.550781 41.212234,23 C41.212234,22.449219 40.763015,22 40.212234,22 Z M44.212234,22 C43.661453,22 43.212234,22.449219 43.212234,23 C43.212234,23.550781 43.661453,24 44.212234,24 C44.763015,24 45.212234,23.550781 45.212234,23 C45.212234,22.449219 44.763015,22 44.212234,22 Z M48.212234,22 C47.661453,22 47.212234,22.449219 47.212234,23 C47.212234,23.550781 47.661453,24 48.212234,24 C48.763015,24 49.212234,23.550781 49.212234,23 C49.212234,22.449219 48.763015,22 48.212234,22 Z M52.212234,22 C51.661453,22 51.212234,22.449219 51.212234,23 C51.212234,23.550781 51.661453,24 52.212234,24 C52.763015,24 53.212234,23.550781 53.212234,23 C53.212234,22.449219 52.763015,22 52.212234,22 Z M21.462234,27.96875 C21.419265,27.976563 21.376297,27.988281 21.337234,28 C21.177078,28.027344 21.02864,28.089844 20.899734,28.1875 L15.618484,32.1875 C15.356765,32.375 15.200515,32.679688 15.200515,33 C15.200515,33.320313 15.356765,33.625 15.618484,33.8125 L20.899734,37.8125 C21.348953,38.148438 21.985672,38.058594 22.321609,37.609375 C22.657547,37.160156 22.567703,36.523438 22.118484,36.1875 L19.212234,34 L49.212234,34 L46.305984,36.1875 C45.856765,36.523438 45.766922,37.160156 46.102859,37.609375 C46.438797,38.058594 47.075515,38.148438 47.524734,37.8125 L52.805984,33.8125 C53.067703,33.625 53.223953,33.320313 53.223953,33 C53.223953,32.679688 53.067703,32.375 52.805984,32.1875 L47.524734,28.1875 C47.30989,28.027344 47.040359,27.960938 46.774734,28 C46.743484,28 46.712234,28 46.680984,28 C46.282547,28.074219 45.96614,28.382813 45.884109,28.78125 C45.802078,29.179688 45.970047,29.585938 46.305984,29.8125 L49.212234,32 L19.212234,32 L22.118484,29.8125 C22.520828,29.566406 22.696609,29.070313 22.536453,28.625 C22.380203,28.179688 21.930984,27.90625 21.462234,27.96875 Z M16.212234,42 C15.661453,42 15.212234,42.449219 15.212234,43 C15.212234,43.550781 15.661453,44 16.212234,44 C16.763015,44 17.212234,43.550781 17.212234,43 C17.212234,42.449219 16.763015,42 16.212234,42 Z M20.212234,42 C19.661453,42 19.212234,42.449219 19.212234,43 C19.212234,43.550781 19.661453,44 20.212234,44 C20.763015,44 21.212234,43.550781 21.212234,43 C21.212234,42.449219 20.763015,42 20.212234,42 Z M24.212234,42 C23.661453,42 23.212234,42.449219 23.212234,43 C23.212234,43.550781 23.661453,44 24.212234,44 C24.763015,44 25.212234,43.550781 25.212234,43 C25.212234,42.449219 24.763015,42 24.212234,42 Z M28.212234,42 C27.661453,42 27.212234,42.449219 27.212234,43 C27.212234,43.550781 27.661453,44 28.212234,44 C28.763015,44 29.212234,43.550781 29.212234,43 C29.212234,42.449219 28.763015,42 28.212234,42 Z M32.212234,42 C31.661453,42 31.212234,42.449219 31.212234,43 C31.212234,43.550781 31.661453,44 32.212234,44 C32.763015,44 33.212234,43.550781 33.212234,43 C33.212234,42.449219 32.763015,42 32.212234,42 Z M36.212234,42 C35.661453,42 35.212234,42.449219 35.212234,43 C35.212234,43.550781 35.661453,44 36.212234,44 C36.763015,44 37.212234,43.550781 37.212234,43 C37.212234,42.449219 36.763015,42 36.212234,42 Z M40.212234,42 C39.661453,42 39.212234,42.449219 39.212234,43 C39.212234,43.550781 39.661453,44 40.212234,44 C40.763015,44 41.212234,43.550781 41.212234,43 C41.212234,42.449219 40.763015,42 40.212234,42 Z M44.212234,42 C43.661453,42 43.212234,42.449219 43.212234,43 C43.212234,43.550781 43.661453,44 44.212234,44 C44.763015,44 45.212234,43.550781 45.212234,43 C45.212234,42.449219 44.763015,42 44.212234,42 Z M48.212234,42 C47.661453,42 47.212234,42.449219 47.212234,43 C47.212234,43.550781 47.661453,44 48.212234,44 C48.763015,44 49.212234,43.550781 49.212234,43 C49.212234,42.449219 48.763015,42 48.212234,42 Z M52.212234,42 C51.661453,42 51.212234,42.449219 51.212234,43 C51.212234,43.550781 51.661453,44 52.212234,44 C52.763015,44 53.212234,43.550781 53.212234,43 C53.212234,42.449219 52.763015,42 52.212234,42 Z" id="inside_range" fill="#000000" fill-rule="nonzero"></path>
        </g>
    </g>
</svg>
        </div>
        <div style="font-family: 'IBM Plex Mono', monospace, courier; color: black; font-size: 10px; display: inline-block; vertical-align: middle;">
            <div>col_vals_between()</div>
        </div>
        </td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">age</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">[18, 80]</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" class="gt_row gt_center"><svg width="25px" height="25px" viewBox="0 0 25 25" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="vertical-align: middle;">
    <g id="unchanged" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="unchanged" transform="translate(0.500000, 0.570147)">
            <rect id="Rectangle" x="0.125132506" y="0" width="23.749735" height="23.7894737"></rect>
            <path d="M5.80375046,8.18194736 C3.77191832,8.18194736 2.11875046,9.83495328 2.11875046,11.8669474 C2.11875046,13.8989414 3.77191832,15.5519474 5.80375046,15.5519474 C7.8355826,15.5519474 9.48875046,13.8989414 9.48875046,11.8669474 C9.48875046,9.83495328 7.83552863,8.18194736 5.80375046,8.18194736 Z M5.80375046,14.814915 C4.17821997,14.814915 2.85578285,13.4924778 2.85578285,11.8669474 C2.85578285,10.2414169 4.17821997,8.91897975 5.80375046,8.91897975 C7.42928095,8.91897975 8.75171807,10.2414169 8.75171807,11.8669474 C8.75171807,13.4924778 7.42928095,14.814915 5.80375046,14.814915 Z" id="Shape" fill="#000000" fill-rule="nonzero"></path>
            <path d="M13.9638189,8.699335 C13.9364621,8.70430925 13.9091059,8.71176968 13.8842359,8.71923074 C13.7822704,8.73663967 13.6877654,8.77643115 13.6056956,8.83860518 L10.2433156,11.3852598 C10.0766886,11.5046343 9.97720993,11.6986181 9.97720993,11.9025491 C9.97720993,12.1064807 10.0766886,12.3004639 10.2433156,12.4198383 L13.6056956,14.966493 C13.891697,15.1803725 14.2970729,15.1231721 14.5109517,14.8371707 C14.7248313,14.5511692 14.6676309,14.145794 14.3816294,13.9319145 L12.5313257,12.5392127 L21.8812495,12.5392127 L21.8812495,11.2658854 L12.5313257,11.2658854 L14.3816294,9.87318364 C14.6377872,9.71650453 14.7497006,9.40066014 14.6477351,9.11714553 C14.5482564,8.83363156 14.262255,8.65954352 13.9638189,8.699335 Z" id="arrow" fill="#000000" transform="translate(15.929230, 11.894737) rotate(-180.000000) translate(-15.929230, -11.894737) "></path>
        </g>
    </g>
</svg></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" class="gt_row gt_center"><span style="color:#4CA64C;">&check;</span></td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" class="gt_row gt_right">5</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" class="gt_row gt_right">4<br />0.80</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" class="gt_row gt_right">1<br />0.20</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" class="gt_row gt_center"><span style="color: #AAAAAA;">&#9679;</span></td>
    <td style="height: 40px; background-color: #FCFCFC;" class="gt_row gt_center"><span style="color: #EBBC14;">&#9679;</span></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" class="gt_row gt_center"><span style="color: #FF3300;">&cir;</span></td>
    <td style="height: 40px;" class="gt_row gt_center"><a href="data:text/csv;base64,X3Jvd19udW1fLHVzZXJfaWQsYWdlLGVtYWlsLHNjb3JlCjUsNSw5NSx1c2VyNUBleGFtcGxlLmNvbSw5NS4yCg==" download="extract_0002.csv"><button style="background-color: #67C2DC; color: #FFFFFF; border: none; padding: 5px; font-weight: bold; cursor: pointer; border-radius: 4px;">CSV</button></a></td>
  </tr>
  <tr>
    <td style="height: 40px; background-color: #EBBC14; color: transparent;font-size: 0px;" class="gt_row gt_left">#EBBC14</td>
    <td style="height: 40px; color: #666666;font-size: 13px;font-weight: bold;" class="gt_row gt_right">3</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" class="gt_row gt_left">
        <div style="margin: 0; padding: 0; display: inline-block; height: 30px; vertical-align: middle; width: 16%;">
            <!--?xml version="1.0" encoding="UTF-8"?--><?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="30px" viewBox="0 0 67 67" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>col_vals_regex</title>
    <g id="Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="col_vals_regex" transform="translate(0.000000, 0.034483)">
            <path d="M56.712234,1 C59.1975153,1 61.4475153,2.00735931 63.076195,3.63603897 C64.7048747,5.26471863 65.712234,7.51471863 65.712234,10 L65.712234,10 L65.712234,65 L10.712234,65 C8.22695259,65 5.97695259,63.9926407 4.34827294,62.363961 C2.71959328,60.7352814 1.71223397,58.4852814 1.71223397,56 L1.71223397,56 L1.71223397,10 C1.71223397,7.51471863 2.71959328,5.26471863 4.34827294,3.63603897 C5.97695259,2.00735931 8.22695259,1 10.712234,1 L10.712234,1 Z" id="rectangle" stroke="#000000" stroke-width="2" fill="#FFFFFF"></path>
            <g id="regex_symbols" transform="translate(18.000000, 12.000000)" fill="#000000" fill-rule="nonzero">
                <path d="M4.17434508,33.013582 C1.94895328,33.013582 0.138006923,34.8245284 0.138006923,37.0499202 C0.138006923,39.275312 1.94895328,41.0862583 4.17434508,41.0862583 C6.39973688,41.0862583 8.21068324,39.275312 8.21068324,37.0499202 C8.21068324,34.8245284 6.39973688,33.013582 4.17434508,33.013582 Z" id="full_stop"></path>
                <path d="M23.9479718,23.3175402 L21.5628264,23.3175402 C21.2344032,23.3175402 20.9665401,23.0520067 20.9665401,22.7212538 L20.9665401,15.1022979 L14.3445004,18.8873192 C14.0626621,19.050366 13.7016292,18.952538 13.5362533,18.6706991 L12.3436806,16.6442575 C12.262157,16.506832 12.2388642,16.3437852 12.2807909,16.1900549 C12.3203879,16.0363251 12.4205455,15.9058874 12.557971,15.8266929 L19.1800101,11.9880994 L12.557971,8.15183511 C12.4205455,8.07264112 12.3203879,7.93987439 12.2807909,7.78614401 C12.2388642,7.63241423 12.262157,7.46936689 12.3413509,7.33194137 L13.5339237,5.30549975 C13.6993001,5.02366143 14.0626621,4.92816199 14.3445004,5.09120934 L20.9665401,8.87390091 L20.9665401,1.25494501 C20.9665401,0.926521818 21.2344032,0.658658658 21.5628264,0.658658658 L23.9479718,0.658658658 C24.2787247,0.658658658 24.5442582,0.926521818 24.5442582,1.25494501 L24.5442582,8.87390091 L31.1662979,5.09120934 C31.4481362,4.92816199 31.8091691,5.02366143 31.9745455,5.30549975 L33.1671182,7.33194137 C33.2486413,7.46936689 33.2719341,7.63241423 33.2300074,7.78614401 C33.1904104,7.93987439 33.0902528,8.07264112 32.9528278,8.15183511 L26.3307882,11.9880994 L32.9528278,15.8243638 C33.0879237,15.9058874 33.1880813,16.0363251 33.2300074,16.1900549 C33.269605,16.3437852 33.2486413,16.506832 33.1671182,16.6442575 L31.9745455,18.6706991 C31.8091691,18.952538 31.4481362,19.050366 31.1662979,18.8849895 L24.5442582,15.1022979 L24.5442582,22.7212538 C24.5442582,23.0520067 24.2787247,23.3175402 23.9479718,23.3175402 Z" id="asterisk"></path>
            </g>
        </g>
    </g>
</svg>
        </div>
        <div style="font-family: 'IBM Plex Mono', monospace, courier; color: black; font-size: 11px; display: inline-block; vertical-align: middle;">
            <div>col_vals_regex()</div>
        </div>
        </td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">email</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">^[^@]+@[^@]+\.[^@]+$</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" class="gt_row gt_center"><svg width="25px" height="25px" viewBox="0 0 25 25" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="vertical-align: middle;">
    <g id="unchanged" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="unchanged" transform="translate(0.500000, 0.570147)">
            <rect id="Rectangle" x="0.125132506" y="0" width="23.749735" height="23.7894737"></rect>
            <path d="M5.80375046,8.18194736 C3.77191832,8.18194736 2.11875046,9.83495328 2.11875046,11.8669474 C2.11875046,13.8989414 3.77191832,15.5519474 5.80375046,15.5519474 C7.8355826,15.5519474 9.48875046,13.8989414 9.48875046,11.8669474 C9.48875046,9.83495328 7.83552863,8.18194736 5.80375046,8.18194736 Z M5.80375046,14.814915 C4.17821997,14.814915 2.85578285,13.4924778 2.85578285,11.8669474 C2.85578285,10.2414169 4.17821997,8.91897975 5.80375046,8.91897975 C7.42928095,8.91897975 8.75171807,10.2414169 8.75171807,11.8669474 C8.75171807,13.4924778 7.42928095,14.814915 5.80375046,14.814915 Z" id="Shape" fill="#000000" fill-rule="nonzero"></path>
            <path d="M13.9638189,8.699335 C13.9364621,8.70430925 13.9091059,8.71176968 13.8842359,8.71923074 C13.7822704,8.73663967 13.6877654,8.77643115 13.6056956,8.83860518 L10.2433156,11.3852598 C10.0766886,11.5046343 9.97720993,11.6986181 9.97720993,11.9025491 C9.97720993,12.1064807 10.0766886,12.3004639 10.2433156,12.4198383 L13.6056956,14.966493 C13.891697,15.1803725 14.2970729,15.1231721 14.5109517,14.8371707 C14.7248313,14.5511692 14.6676309,14.145794 14.3816294,13.9319145 L12.5313257,12.5392127 L21.8812495,12.5392127 L21.8812495,11.2658854 L12.5313257,11.2658854 L14.3816294,9.87318364 C14.6377872,9.71650453 14.7497006,9.40066014 14.6477351,9.11714553 C14.5482564,8.83363156 14.262255,8.65954352 13.9638189,8.699335 Z" id="arrow" fill="#000000" transform="translate(15.929230, 11.894737) rotate(-180.000000) translate(-15.929230, -11.894737) "></path>
        </g>
    </g>
</svg></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" class="gt_row gt_center"><span style="color:#4CA64C;">&check;</span></td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" class="gt_row gt_right">5</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" class="gt_row gt_right">4<br />0.80</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" class="gt_row gt_right">1<br />0.20</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" class="gt_row gt_center"><span style="color: #AAAAAA;">&#9679;</span></td>
    <td style="height: 40px; background-color: #FCFCFC;" class="gt_row gt_center"><span style="color: #EBBC14;">&#9679;</span></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" class="gt_row gt_center"><span style="color: #FF3300;">&cir;</span></td>
    <td style="height: 40px;" class="gt_row gt_center"><a href="data:text/csv;base64,X3Jvd19udW1fLHVzZXJfaWQsYWdlLGVtYWlsLHNjb3JlCjMsMywyMixpbnZhbGlkLWVtYWlsLDc4LjMK" download="extract_0003.csv"><button style="background-color: #67C2DC; color: #FFFFFF; border: none; padding: 5px; font-weight: bold; cursor: pointer; border-radius: 4px;">CSV</button></a></td>
  </tr>
  <tr>
    <td style="height: 40px; background-color: #4CA64C; color: transparent;font-size: 0px;" class="gt_row gt_left">#4CA64C</td>
    <td style="height: 40px; color: #666666;font-size: 13px;font-weight: bold;" class="gt_row gt_right">4</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" class="gt_row gt_left">
        <div style="margin: 0; padding: 0; display: inline-block; height: 30px; vertical-align: middle; width: 16%;">
            <!--?xml version="1.0" encoding="UTF-8"?--><?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="30px" viewBox="0 0 67 67" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>col_vals_between</title>
    <g id="Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="col_vals_between" transform="translate(0.000000, 0.206897)">
            <path d="M56.712234,1 C59.1975153,1 61.4475153,2.00735931 63.076195,3.63603897 C64.7048747,5.26471863 65.712234,7.51471863 65.712234,10 L65.712234,10 L65.712234,65 L10.712234,65 C8.22695259,65 5.97695259,63.9926407 4.34827294,62.363961 C2.71959328,60.7352814 1.71223397,58.4852814 1.71223397,56 L1.71223397,56 L1.71223397,10 C1.71223397,7.51471863 2.71959328,5.26471863 4.34827294,3.63603897 C5.97695259,2.00735931 8.22695259,1 10.712234,1 L10.712234,1 Z" id="rectangle" stroke="#000000" stroke-width="2" fill="#FFFFFF"></path>
            <path d="M11.993484,21.96875 C10.962234,22.082031 10.188797,22.964844 10.212234,24 L10.212234,42 C10.200515,42.722656 10.579422,43.390625 11.204422,43.753906 C11.825515,44.121094 12.598953,44.121094 13.220047,43.753906 C13.845047,43.390625 14.223953,42.722656 14.212234,42 L14.212234,24 C14.220047,23.457031 14.009109,22.9375 13.626297,22.554688 C13.243484,22.171875 12.723953,21.960938 12.180984,21.96875 C12.118484,21.964844 12.055984,21.964844 11.993484,21.96875 Z M55.993484,21.96875 C54.962234,22.082031 54.188797,22.964844 54.212234,24 L54.212234,42 C54.200515,42.722656 54.579422,43.390625 55.204422,43.753906 C55.825515,44.121094 56.598953,44.121094 57.220047,43.753906 C57.845047,43.390625 58.223953,42.722656 58.212234,42 L58.212234,24 C58.220047,23.457031 58.009109,22.9375 57.626297,22.554688 C57.243484,22.171875 56.723953,21.960938 56.180984,21.96875 C56.118484,21.964844 56.055984,21.964844 55.993484,21.96875 Z M16.212234,22 C15.661453,22 15.212234,22.449219 15.212234,23 C15.212234,23.550781 15.661453,24 16.212234,24 C16.763015,24 17.212234,23.550781 17.212234,23 C17.212234,22.449219 16.763015,22 16.212234,22 Z M20.212234,22 C19.661453,22 19.212234,22.449219 19.212234,23 C19.212234,23.550781 19.661453,24 20.212234,24 C20.763015,24 21.212234,23.550781 21.212234,23 C21.212234,22.449219 20.763015,22 20.212234,22 Z M24.212234,22 C23.661453,22 23.212234,22.449219 23.212234,23 C23.212234,23.550781 23.661453,24 24.212234,24 C24.763015,24 25.212234,23.550781 25.212234,23 C25.212234,22.449219 24.763015,22 24.212234,22 Z M28.212234,22 C27.661453,22 27.212234,22.449219 27.212234,23 C27.212234,23.550781 27.661453,24 28.212234,24 C28.763015,24 29.212234,23.550781 29.212234,23 C29.212234,22.449219 28.763015,22 28.212234,22 Z M32.212234,22 C31.661453,22 31.212234,22.449219 31.212234,23 C31.212234,23.550781 31.661453,24 32.212234,24 C32.763015,24 33.212234,23.550781 33.212234,23 C33.212234,22.449219 32.763015,22 32.212234,22 Z M36.212234,22 C35.661453,22 35.212234,22.449219 35.212234,23 C35.212234,23.550781 35.661453,24 36.212234,24 C36.763015,24 37.212234,23.550781 37.212234,23 C37.212234,22.449219 36.763015,22 36.212234,22 Z M40.212234,22 C39.661453,22 39.212234,22.449219 39.212234,23 C39.212234,23.550781 39.661453,24 40.212234,24 C40.763015,24 41.212234,23.550781 41.212234,23 C41.212234,22.449219 40.763015,22 40.212234,22 Z M44.212234,22 C43.661453,22 43.212234,22.449219 43.212234,23 C43.212234,23.550781 43.661453,24 44.212234,24 C44.763015,24 45.212234,23.550781 45.212234,23 C45.212234,22.449219 44.763015,22 44.212234,22 Z M48.212234,22 C47.661453,22 47.212234,22.449219 47.212234,23 C47.212234,23.550781 47.661453,24 48.212234,24 C48.763015,24 49.212234,23.550781 49.212234,23 C49.212234,22.449219 48.763015,22 48.212234,22 Z M52.212234,22 C51.661453,22 51.212234,22.449219 51.212234,23 C51.212234,23.550781 51.661453,24 52.212234,24 C52.763015,24 53.212234,23.550781 53.212234,23 C53.212234,22.449219 52.763015,22 52.212234,22 Z M21.462234,27.96875 C21.419265,27.976563 21.376297,27.988281 21.337234,28 C21.177078,28.027344 21.02864,28.089844 20.899734,28.1875 L15.618484,32.1875 C15.356765,32.375 15.200515,32.679688 15.200515,33 C15.200515,33.320313 15.356765,33.625 15.618484,33.8125 L20.899734,37.8125 C21.348953,38.148438 21.985672,38.058594 22.321609,37.609375 C22.657547,37.160156 22.567703,36.523438 22.118484,36.1875 L19.212234,34 L49.212234,34 L46.305984,36.1875 C45.856765,36.523438 45.766922,37.160156 46.102859,37.609375 C46.438797,38.058594 47.075515,38.148438 47.524734,37.8125 L52.805984,33.8125 C53.067703,33.625 53.223953,33.320313 53.223953,33 C53.223953,32.679688 53.067703,32.375 52.805984,32.1875 L47.524734,28.1875 C47.30989,28.027344 47.040359,27.960938 46.774734,28 C46.743484,28 46.712234,28 46.680984,28 C46.282547,28.074219 45.96614,28.382813 45.884109,28.78125 C45.802078,29.179688 45.970047,29.585938 46.305984,29.8125 L49.212234,32 L19.212234,32 L22.118484,29.8125 C22.520828,29.566406 22.696609,29.070313 22.536453,28.625 C22.380203,28.179688 21.930984,27.90625 21.462234,27.96875 Z M16.212234,42 C15.661453,42 15.212234,42.449219 15.212234,43 C15.212234,43.550781 15.661453,44 16.212234,44 C16.763015,44 17.212234,43.550781 17.212234,43 C17.212234,42.449219 16.763015,42 16.212234,42 Z M20.212234,42 C19.661453,42 19.212234,42.449219 19.212234,43 C19.212234,43.550781 19.661453,44 20.212234,44 C20.763015,44 21.212234,43.550781 21.212234,43 C21.212234,42.449219 20.763015,42 20.212234,42 Z M24.212234,42 C23.661453,42 23.212234,42.449219 23.212234,43 C23.212234,43.550781 23.661453,44 24.212234,44 C24.763015,44 25.212234,43.550781 25.212234,43 C25.212234,42.449219 24.763015,42 24.212234,42 Z M28.212234,42 C27.661453,42 27.212234,42.449219 27.212234,43 C27.212234,43.550781 27.661453,44 28.212234,44 C28.763015,44 29.212234,43.550781 29.212234,43 C29.212234,42.449219 28.763015,42 28.212234,42 Z M32.212234,42 C31.661453,42 31.212234,42.449219 31.212234,43 C31.212234,43.550781 31.661453,44 32.212234,44 C32.763015,44 33.212234,43.550781 33.212234,43 C33.212234,42.449219 32.763015,42 32.212234,42 Z M36.212234,42 C35.661453,42 35.212234,42.449219 35.212234,43 C35.212234,43.550781 35.661453,44 36.212234,44 C36.763015,44 37.212234,43.550781 37.212234,43 C37.212234,42.449219 36.763015,42 36.212234,42 Z M40.212234,42 C39.661453,42 39.212234,42.449219 39.212234,43 C39.212234,43.550781 39.661453,44 40.212234,44 C40.763015,44 41.212234,43.550781 41.212234,43 C41.212234,42.449219 40.763015,42 40.212234,42 Z M44.212234,42 C43.661453,42 43.212234,42.449219 43.212234,43 C43.212234,43.550781 43.661453,44 44.212234,44 C44.763015,44 45.212234,43.550781 45.212234,43 C45.212234,42.449219 44.763015,42 44.212234,42 Z M48.212234,42 C47.661453,42 47.212234,42.449219 47.212234,43 C47.212234,43.550781 47.661453,44 48.212234,44 C48.763015,44 49.212234,43.550781 49.212234,43 C49.212234,42.449219 48.763015,42 48.212234,42 Z M52.212234,42 C51.661453,42 51.212234,42.449219 51.212234,43 C51.212234,43.550781 51.661453,44 52.212234,44 C52.763015,44 53.212234,43.550781 53.212234,43 C53.212234,42.449219 52.763015,42 52.212234,42 Z" id="inside_range" fill="#000000" fill-rule="nonzero"></path>
        </g>
    </g>
</svg>
        </div>
        <div style="font-family: 'IBM Plex Mono', monospace, courier; color: black; font-size: 10px; display: inline-block; vertical-align: middle;">
            <div>col_vals_between()</div>
        </div>
        </td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">score</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">[0, 100]</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" class="gt_row gt_center"><svg width="25px" height="25px" viewBox="0 0 25 25" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="vertical-align: middle;">
    <g id="unchanged" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="unchanged" transform="translate(0.500000, 0.570147)">
            <rect id="Rectangle" x="0.125132506" y="0" width="23.749735" height="23.7894737"></rect>
            <path d="M5.80375046,8.18194736 C3.77191832,8.18194736 2.11875046,9.83495328 2.11875046,11.8669474 C2.11875046,13.8989414 3.77191832,15.5519474 5.80375046,15.5519474 C7.8355826,15.5519474 9.48875046,13.8989414 9.48875046,11.8669474 C9.48875046,9.83495328 7.83552863,8.18194736 5.80375046,8.18194736 Z M5.80375046,14.814915 C4.17821997,14.814915 2.85578285,13.4924778 2.85578285,11.8669474 C2.85578285,10.2414169 4.17821997,8.91897975 5.80375046,8.91897975 C7.42928095,8.91897975 8.75171807,10.2414169 8.75171807,11.8669474 C8.75171807,13.4924778 7.42928095,14.814915 5.80375046,14.814915 Z" id="Shape" fill="#000000" fill-rule="nonzero"></path>
            <path d="M13.9638189,8.699335 C13.9364621,8.70430925 13.9091059,8.71176968 13.8842359,8.71923074 C13.7822704,8.73663967 13.6877654,8.77643115 13.6056956,8.83860518 L10.2433156,11.3852598 C10.0766886,11.5046343 9.97720993,11.6986181 9.97720993,11.9025491 C9.97720993,12.1064807 10.0766886,12.3004639 10.2433156,12.4198383 L13.6056956,14.966493 C13.891697,15.1803725 14.2970729,15.1231721 14.5109517,14.8371707 C14.7248313,14.5511692 14.6676309,14.145794 14.3816294,13.9319145 L12.5313257,12.5392127 L21.8812495,12.5392127 L21.8812495,11.2658854 L12.5313257,11.2658854 L14.3816294,9.87318364 C14.6377872,9.71650453 14.7497006,9.40066014 14.6477351,9.11714553 C14.5482564,8.83363156 14.262255,8.65954352 13.9638189,8.699335 Z" id="arrow" fill="#000000" transform="translate(15.929230, 11.894737) rotate(-180.000000) translate(-15.929230, -11.894737) "></path>
        </g>
    </g>
</svg></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" class="gt_row gt_center"><span style="color:#4CA64C;">&check;</span></td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" class="gt_row gt_right">5</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" class="gt_row gt_right">5<br />1.00</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" class="gt_row gt_right">0<br />0.00</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" class="gt_row gt_center"><span style="color: #AAAAAA;">&cir;</span></td>
    <td style="height: 40px; background-color: #FCFCFC;" class="gt_row gt_center"><span style="color: #EBBC14;">&cir;</span></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" class="gt_row gt_center"><span style="color: #FF3300;">&cir;</span></td>
    <td style="height: 40px;" class="gt_row gt_center">—</td>
  </tr>
  <tr>
    <td style="height: 40px; background-color: #4CA64C; color: transparent;font-size: 0px;" class="gt_row gt_left">#4CA64C</td>
    <td style="height: 40px; color: #666666;font-size: 13px;font-weight: bold;" class="gt_row gt_right">5</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" class="gt_row gt_left">
        <div style="margin: 0; padding: 0; display: inline-block; height: 30px; vertical-align: middle; width: 16%;">
            <!--?xml version="1.0" encoding="UTF-8"?--><?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="30px" viewBox="0 0 67 67" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>col_schema_match</title>
    <g id="Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="col_schema_match" transform="translate(0.000000, 0.310345)">
            <path d="M56.712234,1.01466935 C59.1975153,1.01466935 61.4475153,2.02202867 63.076195,3.65070832 C64.7048747,5.27938798 65.712234,7.52938798 65.712234,10.0146694 L65.712234,10.0146694 L65.712234,65.0146694 L10.712234,65.0146694 C8.22695259,65.0146694 5.97695259,64.00731 4.34827294,62.3786304 C2.71959328,60.7499507 1.71223397,58.4999507 1.71223397,56.0146694 L1.71223397,56.0146694 L1.71223397,10.0146694 C1.71223397,7.52938798 2.71959328,5.27938798 4.34827294,3.65070832 C5.97695259,2.02202867 8.22695259,1.01466935 10.712234,1.01466935 L10.712234,1.01466935 Z" id="rectangle" stroke="#000000" stroke-width="2" fill="#FFFFFF"></path>
            <path d="M53.712234,39.7885268 L54.212234,56.2885268 L42.212234,56.7885268 L42.212234,39.7885268 L53.712234,39.7885268 Z M39.712234,39.7885268 L39.712234,56.7885268 L27.712234,56.7885268 L27.712234,39.7885268 L39.712234,39.7885268 Z M25.212234,39.7885268 L25.212234,56.7885268 L13.712234,56.7885268 L13.212234,40.2885268 L25.212234,39.7885268 Z" id="columns_schema" stroke="#000000" fill-rule="nonzero"></path>
            <g id="vertical_equal" transform="translate(30.000000, 29.000000)" stroke="#000000" stroke-linecap="square">
                <line x1="2.21223397" y1="0.514669353" x2="2.21223397" y2="7.58573716" id="Line"></line>
                <line x1="5.21223397" y1="0.514669353" x2="5.21223397" y2="7.58573716" id="Line-Copy"></line>
            </g>
            <path d="M41.712234,9.01466935 L41.712234,27.0146694 L53.712234,27.0146694 C54.262234,27.0146694 54.712234,26.5646694 54.712234,26.0146694 L54.712234,10.0146694 C54.712234,9.46466935 54.262234,9.01466935 53.712234,9.01466935 L41.712234,9.01466935 Z M27.212234,9.01466935 C27.212234,9.01466935 27.212234,15.0146694 27.212234,27.0146694 L40.212234,27.0146694 L40.212234,9.01466935 C31.5455673,9.01466935 27.212234,9.01466935 27.212234,9.01466935 Z M13.712234,9.01466935 C13.162234,9.01466935 12.712234,9.46466935 12.712234,10.0146694 L12.712234,26.0146694 C12.712234,26.5646694 13.162234,27.0146694 13.712234,27.0146694 L25.712234,27.0146694 L25.712234,9.01466935 L13.712234,9.01466935 Z" id="columns_real" fill="#000000" fill-rule="nonzero"></path>
        </g>
    </g>
</svg>
        </div>
        <div style="font-family: 'IBM Plex Mono', monospace, courier; color: black; font-size: 10px; display: inline-block; vertical-align: middle;">
            <div>col_schema_match()</div>
        </div>
        </td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">&mdash;</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">SCHEMA</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" class="gt_row gt_center"><svg width="25px" height="25px" viewBox="0 0 25 25" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="vertical-align: middle;">
    <g id="unchanged" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="unchanged" transform="translate(0.500000, 0.570147)">
            <rect id="Rectangle" x="0.125132506" y="0" width="23.749735" height="23.7894737"></rect>
            <path d="M5.80375046,8.18194736 C3.77191832,8.18194736 2.11875046,9.83495328 2.11875046,11.8669474 C2.11875046,13.8989414 3.77191832,15.5519474 5.80375046,15.5519474 C7.8355826,15.5519474 9.48875046,13.8989414 9.48875046,11.8669474 C9.48875046,9.83495328 7.83552863,8.18194736 5.80375046,8.18194736 Z M5.80375046,14.814915 C4.17821997,14.814915 2.85578285,13.4924778 2.85578285,11.8669474 C2.85578285,10.2414169 4.17821997,8.91897975 5.80375046,8.91897975 C7.42928095,8.91897975 8.75171807,10.2414169 8.75171807,11.8669474 C8.75171807,13.4924778 7.42928095,14.814915 5.80375046,14.814915 Z" id="Shape" fill="#000000" fill-rule="nonzero"></path>
            <path d="M13.9638189,8.699335 C13.9364621,8.70430925 13.9091059,8.71176968 13.8842359,8.71923074 C13.7822704,8.73663967 13.6877654,8.77643115 13.6056956,8.83860518 L10.2433156,11.3852598 C10.0766886,11.5046343 9.97720993,11.6986181 9.97720993,11.9025491 C9.97720993,12.1064807 10.0766886,12.3004639 10.2433156,12.4198383 L13.6056956,14.966493 C13.891697,15.1803725 14.2970729,15.1231721 14.5109517,14.8371707 C14.7248313,14.5511692 14.6676309,14.145794 14.3816294,13.9319145 L12.5313257,12.5392127 L21.8812495,12.5392127 L21.8812495,11.2658854 L12.5313257,11.2658854 L14.3816294,9.87318364 C14.6377872,9.71650453 14.7497006,9.40066014 14.6477351,9.11714553 C14.5482564,8.83363156 14.262255,8.65954352 13.9638189,8.699335 Z" id="arrow" fill="#000000" transform="translate(15.929230, 11.894737) rotate(-180.000000) translate(-15.929230, -11.894737) "></path>
        </g>
    </g>
</svg></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" class="gt_row gt_center"><span style="color:#4CA64C;">&check;</span></td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px;" class="gt_row gt_right">1</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" class="gt_row gt_right">1<br />1.00</td>
    <td style="height: 40px; color: black;font-family: IBM Plex Mono;font-size: 11px; border-left: 1px dashed #E5E5E5;" class="gt_row gt_right">0<br />0.00</td>
    <td style="height: 40px; background-color: #FCFCFC; border-left: 1px solid #D3D3D3;" class="gt_row gt_center"><span style="color: #AAAAAA;">&cir;</span></td>
    <td style="height: 40px; background-color: #FCFCFC;" class="gt_row gt_center"><span style="color: #EBBC14;">&cir;</span></td>
    <td style="height: 40px; background-color: #FCFCFC; border-right: 1px solid #D3D3D3;" class="gt_row gt_center"><span style="color: #FF3300;">&cir;</span></td>
    <td style="height: 40px;" class="gt_row gt_center">—</td>
  </tr>
</tbody>
  <tfoot class="gt_sourcenotes">
  <tr>
    <td class="gt_sourcenote" colspan="14" style="text-align: left;"><div style='margin-top: 5px; margin-bottom: 5px;'><span style='background-color: #FFF; color: #444; padding: 0.5em 0.5em; position: inherit; text-transform: uppercase; margin-left: 10px; margin-right: 5px; border: solid 1px #999999; font-variant-numeric: tabular-nums; border-radius: 0; padding: 2px 10px 2px 10px;'>2026-05-29 17:44:28 UTC</span><span style='background-color: #FFF; color: #444; padding: 0.5em 0.5em; position: inherit; margin-right: 5px; border: solid 1px #999999; font-variant-numeric: tabular-nums; border-radius: 0; padding: 2px 10px 2px 10px;'>< 1 s</span><span style='background-color: #FFF; color: #444; padding: 0.5em 0.5em; position: inherit; text-transform: uppercase; margin: 5px 1px 5px -1px; border: solid 1px #999999; font-variant-numeric: tabular-nums; border-radius: 0; padding: 2px 10px 2px 10px;'>2026-05-29 17:44:28 UTC</span></div></td>
  </tr>
  <tr>
    <td class="gt_sourcenote" colspan="14" style="text-align: left;"><hr style='border: none; border-top-width: 1px; border-top-style: dotted; border-top-color: #B5B5B5; margin-top: -3px; margin-bottom: 3px;'>
<strong>Notes</strong>
<p><span style='font-variant: small-caps; font-weight: bold; font-size: smaller; text-transform: uppercase; color: #333333;'>Step 5</span> <span style='font-family: "IBM Plex Mono", monospace; font-size: smaller;'>(schema_check)</span> <span style="color:#4CA64C;">✓</span> Schema validation <strong>passed</strong>.</p>
<details style="margin-top: 2px; margin-bottom: 8px; font-size: 12px; text-indent: 12px;">
<summary style="cursor: pointer; font-weight: bold; color: #555; margin-bottom: -5px;">Schema Comparison</summary>
<div style="margin-top: 6px; padding-left: 15px; padding-right: 15px;">
<div id="pb_step_tbl" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
<style>
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans&display=swap');
#pb_step_tbl table {
          font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }
<p>#pb_step_tbl thead, tbody, tfoot, tr, td, th { border-style: none; }
tr { background-color: transparent; }
#pb_step_tbl p { margin: 0; padding: 0; }
#pb_step_tbl .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }
#pb_step_tbl .gt_caption { padding-top: 4px; padding-bottom: 4px; }
#pb_step_tbl .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
#pb_step_tbl .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
#pb_step_tbl .gt_heading { background-color: #FFFFFF; text-align: left; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
#pb_step_tbl .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
#pb_step_tbl .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
#pb_step_tbl .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; overflow-x: hidden; }
#pb_step_tbl .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
#pb_step_tbl .gt_column_spanner_outer:first-child { padding-left: 0; }
#pb_step_tbl .gt_column_spanner_outer:last-child { padding-right: 0; }
#pb_step_tbl .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
#pb_step_tbl .gt_spanner_row { border-bottom-style: hidden; }
#pb_step_tbl .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }
#pb_step_tbl .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }
#pb_step_tbl .gt_from_md&gt; :first-child { margin-top: 0; }
#pb_step_tbl .gt_from_md&gt; :last-child { margin-bottom: 0; }
#pb_step_tbl .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }
#pb_step_tbl .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; }
#pb_step_tbl .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; vertical-align: top; }
#pb_step_tbl .gt_row_group_first td { border-top-width: 2px; }
#pb_step_tbl .gt_row_group_first th { border-top-width: 2px; }
#pb_step_tbl .gt_striped { color: #333333; background-color: #F4F4F4; }
#pb_step_tbl .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
#pb_step_tbl .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
#pb_step_tbl .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
#pb_step_tbl .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
#pb_step_tbl .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
#pb_step_tbl .gt_sourcenote { font-size: 12px; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
#pb_step_tbl .gt_left { text-align: left; }
#pb_step_tbl .gt_center { text-align: center; }
#pb_step_tbl .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
#pb_step_tbl .gt_font_normal { font-weight: normal; }
#pb_step_tbl .gt_font_bold { font-weight: bold; }
#pb_step_tbl .gt_font_italic { font-style: italic; }
#pb_step_tbl .gt_super { font-size: 65%; }
#pb_step_tbl .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
#pb_step_tbl .gt_asterisk { font-size: 100%; vertical-align: 0; }</p>
</style>
<table style="table-layout: fixed;; width: 0px" class="gt_table" data-quarto-disable-processing="true" data-quarto-bootstrap="false">
<colgroup>
  <col style="width:40px;"/>
  <col style="width:190px;"/>
  <col style="width:190px;"/>
  <col style="width:40px;"/>
  <col style="width:190px;"/>
  <col style="width:30px;"/>
  <col style="width:190px;"/>
  <col style="width:30px;"/>
</colgroup>
<thead>
<tr class="gt_col_headings gt_spanner_row">
  <th class="gt_center gt_columns_top_border gt_column_spanner_outer" rowspan="1" colspan="3" scope="colgroup" id="pb_step_tbl-TARGET">
    <span class="gt_column_spanner">TARGET</span>
  </th>
  <th class="gt_center gt_columns_top_border gt_column_spanner_outer" rowspan="1" colspan="5" scope="colgroup" id="pb_step_tbl-EXPECTED">
    <span class="gt_column_spanner">EXPECTED</span>
  </th>
</tr>
<tr class="gt_col_headings">
  <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" scope="col" id="pb_step_tbl-index_target"></th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="pb_step_tbl-col_name_target">COLUMN</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="pb_step_tbl-dtype_target">DATA TYPE</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" scope="col" id="pb_step_tbl-index_exp"></th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="pb_step_tbl-col_name_exp">COLUMN</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="pb_step_tbl-col_name_exp_correct"></th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="pb_step_tbl-dtype_exp">DATA TYPE</th>
  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="pb_step_tbl-dtype_exp_correct"></th>
</tr>
</thead>
<tbody class="gt_table_body">
  <tr>
    <td style="font-size: 13px;" class="gt_row gt_right">1</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">user_id</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">Int64</td>
    <td style="font-size: 13px; border-left: 3px double #E5E5E5;" class="gt_row gt_right">1</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">user_id</td>
    <td class="gt_row gt_left"><span style='color: #4CA64C;'>✓</span></td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">Int64</td>
    <td class="gt_row gt_left"><span style='color: #4CA64C;'>✓</span></td>
  </tr>
  <tr>
    <td style="font-size: 13px;" class="gt_row gt_right">2</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">age</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">Int64</td>
    <td style="font-size: 13px; border-left: 3px double #E5E5E5;" class="gt_row gt_right">2</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">age</td>
    <td class="gt_row gt_left"><span style='color: #4CA64C;'>✓</span></td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">Int64</td>
    <td class="gt_row gt_left"><span style='color: #4CA64C;'>✓</span></td>
  </tr>
  <tr>
    <td style="font-size: 13px;" class="gt_row gt_right">3</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">email</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">String</td>
    <td style="font-size: 13px; border-left: 3px double #E5E5E5;" class="gt_row gt_right">3</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">email</td>
    <td class="gt_row gt_left"><span style='color: #4CA64C;'>✓</span></td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">String</td>
    <td class="gt_row gt_left"><span style='color: #4CA64C;'>✓</span></td>
  </tr>
  <tr>
    <td style="font-size: 13px;" class="gt_row gt_right">4</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">score</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">Float64</td>
    <td style="font-size: 13px; border-left: 3px double #E5E5E5;" class="gt_row gt_right">4</td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">score</td>
    <td class="gt_row gt_left"><span style='color: #4CA64C;'>✓</span></td>
    <td style="color: black;font-family: IBM Plex Mono;font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" class="gt_row gt_left">Float64</td>
    <td class="gt_row gt_left"><span style='color: #4CA64C;'>✓</span></td>
  </tr>
</tbody>
  <tfoot class="gt_sourcenotes">
  <tr>
    <td class="gt_sourcenote" colspan="8"><div style='padding-bottom: 2px;'>Supplied Column Schema:</div><div style='border-style: solid; border-width: thin; border-color: lightblue; padding-left: 2px; padding-right: 2px; padding-bottom: 3px;'><code style='color: #303030; font-family: monospace; font-size: 8px;'>[('user_id', 'Int64'), ('age', 'Int64'), ('email', 'String'), ('score', 'Float64')]</code></div></td>
  </tr>
  <tr>
    <td class="gt_sourcenote" colspan="8">
<div style='padding-bottom: 2px;'>Schema Match Settings</div>
<div style='padding-bottom: 4px;'><div style="display: flex; font-size: 13.7px; padding-top: 2px;"><div style="border-style: solid; border-width: 1px; border-color: #87CEFA; border-radius: 5px; background-color: #F0F8FF; font-size: x-small; padding-left: 4px; padding-right: 4px; margin-left: 5px; margin-right: 5px;  margin-top: 2px; ">COMPLETE</div><div style="border-style: solid; border-width: 1px; border-color: #87CEFA; border-radius: 5px; background-color: #F0F8FF; font-size: x-small; padding-left: 4px; padding-right: 4px; margin-left: 5px; margin-right: 5px;  margin-top: 2px; ">IN ORDER</div><div style="border-style: solid; border-width: 1px; border-color: #A9A9A9; border-radius: 5px; background-color: #F5F5F5; font-size: x-small; padding-left: 4px; padding-right: 4px; margin-left: 5px; margin-right: 5px;  margin-top: 2px; ">COLUMN &ne; column</div><div style="border-style: solid; border-width: 1px; border-color: #A9A9A9; border-radius: 5px; background-color: #F5F5F5; font-size: x-small; padding-left: 4px; padding-right: 4px; margin-left: 5px; margin-right: 5px;  margin-top: 2px; ">DTYPE &ne; dtype</div><div style="border-style: solid; border-width: 1px; border-color: #A9A9A9; border-radius: 5px; background-color: #F5F5F5; font-size: x-small; padding-left: 4px; padding-right: 4px; margin-left: 5px; margin-right: 5px;  margin-top: 2px; ">float &ne; float64</div></div></div>
</td>
  </tr>
</tfoot>
</table>
</div>
</div>
</details>
</td>
  </tr>
</tfoot>
</table>
</div>
<p>This example demonstrates Pointblank&rsquo;s chainable validation approach where each validation step is
clearly defined and can be configured with different threshold levels. The resulting validation
object provides rich, interactive reporting that shows not just what passed or failed, but detailed
statistics about the validation process. The threshold system allows for nuanced responses to data
quality issues.</p>
<h3 id="comparisons-1">Comparisons
</h3>
<p>Unlike Pandera&rsquo;s schema-first approach, Pointblank focuses on step-by-step validation with detailed
reporting and flexible failure thresholds that can be set at both the global and individual
validation step level. Both Pointblank and Validoopsie use numeric threshold values for granular
control over acceptable failure rates, but they differ in their primary focus: Pointblank emphasizes
comprehensive reporting and stakeholder communication, while Validoopsie prioritizes operational
resilience through its impact level system (low/medium/high) that controls whether threshold
breaches are logged, reported, or raise exceptions.</p>
<p>While both libraries support custom validation logic, Pointblank&rsquo;s <code>specially()</code> method integrates
seamlessly with its reporting system, whereas Validoopsie provides a structured framework for
creating custom validation classes that fit into its modular validation catalog.</p>
<h3 id="unique-strengths-and-when-to-use-2">Unique Strengths and When to Use
</h3>
<ul>
<li>beautiful, interactive HTML reports perfect for sharing with stakeholders</li>
<li>threshold-based alerting system with configurable actions</li>
<li>segmented validation for analyzing subsets of data</li>
<li>LLM-powered validation suggestions via <code>DraftValidation</code></li>
<li>comprehensive data inspection tools and summary tables</li>
<li>step-by-step validation reporting with detailed failure analysis (via <code>.get_step_report()</code>)</li>
</ul>
<p>Data practitioners might want to choose Pointblank when stakeholder communication and comprehensive
data quality reporting are priorities. Because of the reporting tables it can generate, it&rsquo;s
well-suited for data teams that need to regularly report on data quality to relevant stakeholders.
Pointblank also excels in production data monitoring scenarios, data observability workflows, and
situations where understanding the nuances of data quality issues matters more than simple pass/fail
validation.</p>
<h2 id="4-validoopsie-composable-checks-with-smart-failure-handling">4. Validoopsie: Composable Checks with Smart Failure Handling
</h2>
<p>Validoopsie is built around composable validation principles, providing a toolkit for creating
reusable validation functions organized into logical modules. Drawing inspiration from Great
Expectations but with a much lighter footprint, Validoopsie emphasizes building validation logic
from modular, testable components that can be combined in flexible ways to create complex validation
workflows. The library had Polars support from its very first release (early-2025).</p>
<p>What sets Validoopsie apart is its sophisticated approach to handling validation failures through
<em>impact levels</em> and <em>threshold tolerances</em>. These features that give you fine-grained control over
how your validation pipeline behaves when things go wrong.</p>
<h3 id="example-3">Example
</h3>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">validoopsie</span> <span class="kn">import</span> <span class="n">Validate</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">narwhals.dtypes</span> <span class="kn">import</span> <span class="n">Int64</span><span class="p">,</span> <span class="n">Float64</span><span class="p">,</span> <span class="n">String</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Composable validation checks with impact levels and thresholds</span>
</span></span><span class="line"><span class="cl"><span class="n">validation</span> <span class="o">=</span> <span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">Validate</span><span class="p">(</span><span class="n">user_data</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">ValuesValidation</span><span class="o">.</span><span class="n">ColumnValuesToBeBetween</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">column</span><span class="o">=</span><span class="s2">&#34;user_id&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">min_value</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">impact</span><span class="o">=</span><span class="s2">&#34;high&#34;</span>  <span class="c1"># Critical - will raise exception</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">ValuesValidation</span><span class="o">.</span><span class="n">ColumnValuesToBeBetween</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">column</span><span class="o">=</span><span class="s2">&#34;age&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">min_value</span><span class="o">=</span><span class="mi">18</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">max_value</span><span class="o">=</span><span class="mi">80</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">threshold</span><span class="o">=</span><span class="mf">0.1</span><span class="p">,</span>  <span class="c1"># Allow 10% failures</span>
</span></span><span class="line"><span class="cl">        <span class="n">impact</span><span class="o">=</span><span class="s2">&#34;medium&#34;</span>  <span class="c1"># Important but not critical</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">StringValidation</span><span class="o">.</span><span class="n">PatternMatch</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">column</span><span class="o">=</span><span class="s2">&#34;email&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">pattern</span><span class="o">=</span><span class="sa">r</span><span class="s2">&#34;^[^@]+@[^@]+\.[^@]+$&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">threshold</span><span class="o">=</span><span class="mf">0.05</span><span class="p">,</span>  <span class="c1"># Allow 5% malformed emails</span>
</span></span><span class="line"><span class="cl">        <span class="n">impact</span><span class="o">=</span><span class="s2">&#34;low&#34;</span>  <span class="c1"># Record but don&#39;t interrupt</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">ValuesValidation</span><span class="o">.</span><span class="n">ColumnValuesToBeBetween</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">column</span><span class="o">=</span><span class="s2">&#34;score&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">min_value</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">max_value</span><span class="o">=</span><span class="mi">100</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">impact</span><span class="o">=</span><span class="s2">&#34;medium&#34;</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">TypeValidation</span><span class="o">.</span><span class="n">TypeCheck</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">frame_schema_definition</span><span class="o">=</span><span class="p">{</span>
</span></span><span class="line"><span class="cl">            <span class="s2">&#34;user_id&#34;</span><span class="p">:</span> <span class="n">Int64</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">            <span class="s2">&#34;age&#34;</span><span class="p">:</span> <span class="n">Int64</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">            <span class="s2">&#34;email&#34;</span><span class="p">:</span> <span class="n">String</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">            <span class="s2">&#34;score&#34;</span><span class="p">:</span> <span class="n">Float64</span>
</span></span><span class="line"><span class="cl">        <span class="p">},</span>
</span></span><span class="line"><span class="cl">        <span class="n">impact</span><span class="o">=</span><span class="s2">&#34;high&#34;</span>  <span class="c1"># Schema compliance is critical</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Get validation results</span>
</span></span><span class="line"><span class="cl"><span class="n">validation</span><span class="o">.</span><span class="n">validate</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Access detailed results for analysis</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="s2">&#34;Validation results:&#34;</span><span class="p">,</span> <span class="n">validation</span><span class="o">.</span><span class="n">results</span><span class="p">)</span></span></span></code></pre></div></div>
<pre><span class="ansi-green-fg">2026-05-29 10:44:28.536</span> | <span class="ansi-bold">INFO    </span> | <span class="ansi-cyan-fg">validoopsie.validate</span>:<span class="ansi-cyan-fg">validate</span>:<span class="ansi-cyan-fg">414</span> - <span class="ansi-bold">Passed validation: {'validation': 'ColumnValuesToBeBetween', 'impact': 'high', 'timestamp': '2026-05-29T10:44:28.495055-07:00', 'column': 'user_id', 'result': {'status': 'Success', 'threshold_pass': True, 'message': 'All items passed the validation.', 'frame_row_number': 5, 'threshold': 0.0}}</span>
<span class="ansi-green-fg">2026-05-29 10:44:28.537</span> | <span class="ansi-red-fg ansi-bold">ERROR   </span> | <span class="ansi-cyan-fg">validoopsie.validate</span>:<span class="ansi-cyan-fg">validate</span>:<span class="ansi-cyan-fg">406</span> - <span class="ansi-red-fg ansi-bold">Failed validation: ColumnValuesToBeBetween_age - The column 'age' has values that are not between 18 and 80.</span>
<span class="ansi-green-fg">2026-05-29 10:44:28.537</span> | <span class="ansi-yellow-fg ansi-bold">WARNING </span> | <span class="ansi-cyan-fg">validoopsie.validate</span>:<span class="ansi-cyan-fg">validate</span>:<span class="ansi-cyan-fg">408</span> - <span class="ansi-yellow-fg ansi-bold">Failed validation: PatternMatch_email - The column 'email' has entries that do not match the pattern '^[^@]+@[^@]+\.[^@]+$'.</span>
<span class="ansi-green-fg">2026-05-29 10:44:28.537</span> | <span class="ansi-bold">INFO    </span> | <span class="ansi-cyan-fg">validoopsie.validate</span>:<span class="ansi-cyan-fg">validate</span>:<span class="ansi-cyan-fg">414</span> - <span class="ansi-bold">Passed validation: {'validation': 'ColumnValuesToBeBetween', 'impact': 'medium', 'timestamp': '2026-05-29T10:44:28.499332-07:00', 'column': 'score', 'result': {'status': 'Success', 'threshold_pass': True, 'message': 'All items passed the validation.', 'frame_row_number': 5, 'threshold': 0.0}}</span>
<span class="ansi-green-fg">2026-05-29 10:44:28.537</span> | <span class="ansi-bold">INFO    </span> | <span class="ansi-cyan-fg">validoopsie.validate</span>:<span class="ansi-cyan-fg">validate</span>:<span class="ansi-cyan-fg">414</span> - <span class="ansi-bold">Passed validation: {'validation': 'TypeCheck', 'impact': 'high', 'timestamp': '2026-05-29T10:44:28.499875-07:00', 'column': 'DataTypeColumnValidation', 'result': {'status': 'Success', 'threshold_pass': True, 'message': 'All items passed the validation.', 'frame_row_number': 4, 'threshold': 0.0}}</span>
</pre>
<pre><code>Validation results: {'Summary': {'passed': False, 'validations': ['ColumnValuesToBeBetween_user_id', 'ColumnValuesToBeBetween_age', 'PatternMatch_email', 'ColumnValuesToBeBetween_score', 'TypeCheck_DataTypeColumnValidation'], 'failed_validation': ['ColumnValuesToBeBetween_age', 'PatternMatch_email']}, 'ColumnValuesToBeBetween_user_id': {'validation': 'ColumnValuesToBeBetween', 'impact': 'high', 'timestamp': '2026-05-29T10:44:28.495055-07:00', 'column': 'user_id', 'result': {'status': 'Success', 'threshold_pass': True, 'message': 'All items passed the validation.', 'frame_row_number': 5, 'threshold': 0.0}}, 'ColumnValuesToBeBetween_age': {'validation': 'ColumnValuesToBeBetween', 'impact': 'medium', 'timestamp': '2026-05-29T10:44:28.497442-07:00', 'column': 'age', 'result': {'status': 'Fail', 'threshold_pass': False, 'message': &quot;The column 'age' has values that are not between 18 and 80.&quot;, 'failing_items': [95], 'failed_number': 1, 'frame_row_number': 5, 'threshold': 0.1, 'failed_percentage': 0.2}}, 'PatternMatch_email': {'validation': 'PatternMatch', 'impact': 'low', 'timestamp': '2026-05-29T10:44:28.498322-07:00', 'column': 'email', 'result': {'status': 'Fail', 'threshold_pass': False, 'message': &quot;The column 'email' has entries that do not match the pattern '^[^@]+@[^@]+\\.[^@]+$'.&quot;, 'failing_items': ['invalid-email'], 'failed_number': 1, 'frame_row_number': 5, 'threshold': 0.05, 'failed_percentage': 0.2}}, 'ColumnValuesToBeBetween_score': {'validation': 'ColumnValuesToBeBetween', 'impact': 'medium', 'timestamp': '2026-05-29T10:44:28.499332-07:00', 'column': 'score', 'result': {'status': 'Success', 'threshold_pass': True, 'message': 'All items passed the validation.', 'frame_row_number': 5, 'threshold': 0.0}}, 'TypeCheck_DataTypeColumnValidation': {'validation': 'TypeCheck', 'impact': 'high', 'timestamp': '2026-05-29T10:44:28.499875-07:00', 'column': 'DataTypeColumnValidation', 'result': {'status': 'Success', 'threshold_pass': True, 'message': 'All items passed the validation.', 'frame_row_number': 4, 'threshold': 0.0}}}
</code></pre>
<p>This example showcases Validoopsie&rsquo;s key differentiators: modular validation categories
(<code>ValuesValidation</code>, <code>StringValidation</code>, <code>TypeValidation</code>) combined with <em>impact levels</em> that
control failure behavior and <em>thresholds</em> that allow controlled tolerance for data quality issues.
Unlike other libraries that treat all validation failures equally, Validoopsie lets you specify
which validations are critical (&ldquo;high&rdquo; impact raises exceptions) versus informational (&ldquo;low&rdquo; impact
just logs results).</p>
<p>Validoopsie&rsquo;s most powerful feature is its three-tier <code>impact=</code> system combined with <code>threshold=</code>
tolerance:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="c1"># Example showing sophisticated failure handling</span>
</span></span><span class="line"><span class="cl"><span class="n">validation</span> <span class="o">=</span> <span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="n">Validate</span><span class="p">(</span><span class="n">user_data</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="c1"># Critical validation - no tolerance</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">NullValidation</span><span class="o">.</span><span class="n">ColumnNotBeNull</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">column</span><span class="o">=</span><span class="s2">&#34;user_id&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">impact</span><span class="o">=</span><span class="s2">&#34;high&#34;</span>    <span class="c1"># Will raise an exception if any Null values found</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="c1"># Important validation with tolerance</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">StringValidation</span><span class="o">.</span><span class="n">PatternMatch</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">column</span><span class="o">=</span><span class="s2">&#34;email&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">pattern</span><span class="o">=</span><span class="sa">r</span><span class="s2">&#34;^[^@]+@[^@]+\.[^@]+$&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">threshold</span><span class="o">=</span><span class="mf">0.15</span><span class="p">,</span>  <span class="c1"># Allow up to 15% malformed emails</span>
</span></span><span class="line"><span class="cl">        <span class="n">impact</span><span class="o">=</span><span class="s2">&#34;medium&#34;</span>  <span class="c1"># Log failures but don&#39;t stop processing</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="c1"># Informational validation</span>
</span></span><span class="line"><span class="cl">    <span class="o">.</span><span class="n">ValuesValidation</span><span class="o">.</span><span class="n">ColumnValuesToBeBetween</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">column</span><span class="o">=</span><span class="s2">&#34;score&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">min_value</span><span class="o">=</span><span class="mi">90</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">max_value</span><span class="o">=</span><span class="mi">100</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">threshold</span><span class="o">=</span><span class="mf">0.8</span><span class="p">,</span>  <span class="c1"># Allow 80% to be outside &#34;excellent&#34; range</span>
</span></span><span class="line"><span class="cl">        <span class="n">impact</span><span class="o">=</span><span class="s2">&#34;low&#34;</span>    <span class="c1"># Just track high performers</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">validation</span><span class="o">.</span><span class="n">validate</span><span class="p">()</span></span></span></code></pre></div></div>
<pre><span class="ansi-green-fg">2026-05-29 10:44:28.547</span> | <span class="ansi-bold">INFO    </span> | <span class="ansi-cyan-fg">validoopsie.validate</span>:<span class="ansi-cyan-fg">validate</span>:<span class="ansi-cyan-fg">414</span> - <span class="ansi-bold">Passed validation: {'validation': 'ColumnNotBeNull', 'impact': 'high', 'timestamp': '2026-05-29T10:44:28.545540-07:00', 'column': 'user_id', 'result': {'status': 'Success', 'threshold_pass': True, 'message': 'All items passed the validation.', 'frame_row_number': 5, 'threshold': 0.0}}</span>
<span class="ansi-green-fg">2026-05-29 10:44:28.548</span> | <span class="ansi-red-fg ansi-bold">ERROR   </span> | <span class="ansi-cyan-fg">validoopsie.validate</span>:<span class="ansi-cyan-fg">validate</span>:<span class="ansi-cyan-fg">406</span> - <span class="ansi-red-fg ansi-bold">Failed validation: PatternMatch_email - The column 'email' has entries that do not match the pattern '^[^@]+@[^@]+\.[^@]+$'.</span>
<span class="ansi-green-fg">2026-05-29 10:44:28.548</span> | <span class="ansi-bold">INFO    </span> | <span class="ansi-cyan-fg">validoopsie.validate</span>:<span class="ansi-cyan-fg">validate</span>:<span class="ansi-cyan-fg">414</span> - <span class="ansi-bold">Passed validation: {'validation': 'ColumnValuesToBeBetween', 'impact': 'low', 'timestamp': '2026-05-29T10:44:28.547029-07:00', 'column': 'score', 'result': {'status': 'Success', 'threshold_pass': True, 'message': "The column 'score' has values that are not between 90 and 100.", 'failing_items': [78.3, 85.5, 88.7], 'failed_number': 3, 'frame_row_number': 5, 'threshold': 0.8, 'failed_percentage': 0.6}}</span>
</pre>
<p>Validoopsie strikes a unique balance between operational flexibility and production reliability,
making it an excellent choice for teams that need sophisticated failure handling without the
complexity of larger validation frameworks.</p>
<h3 id="comparisons-2">Comparisons
</h3>
<p>Validoopsie&rsquo;s functional approach contrasts with Pandera&rsquo;s schema-centric methodology and Patito&rsquo;s
object-oriented models. While Pandera focuses on statistical validation and Patito emphasizes
Pydantic integration, Validoopsie prioritizes flexibility and operational robustness.</p>
<p>Compared to Pointblank, both libraries offer sophisticated threshold-based failure handling using
numeric values (e.g., 0.1 for 10% tolerance), but they differ in their architectural approach:
Validoopsie combines numeric thresholds with impact levels (low/medium/high) that control the
behavioral response to threshold breaches, while Pointblank integrates thresholds directly into its
comprehensive reporting and alerting system. Both support custom validation, but Validoopsie uses a
modular validation catalog approach while Pointblank&rsquo;s <code>specially()</code> method integrates seamlessly
with its step-by-step reporting workflow.</p>
<p>Validoopsie is the only library in this survey that provides built-in logging capabilities, making
it particularly valuable for production environments where validation events need to be tracked and
monitored.</p>
<p>The library&rsquo;s Great Expectations inspiration is evident in its modular design, but Validoopsie
delivers this functionality with a much lighter dependency footprint and simpler API. Teams
familiar with Great Expectations will find Validoopsie&rsquo;s approach familiar but more streamlined.</p>
<h3 id="unique-strengths-and-when-to-use-3">Unique Strengths and When to Use
</h3>
<p>Validoopsie&rsquo;s standout features include:</p>
<ul>
<li>graduated failure handling through impact levels (low/medium/high) combined with numeric
thresholds that control both tolerance levels and behavioral responses to failures</li>
<li>numeric threshold tolerance allowing controlled acceptance of data quality issues (e.g., &ldquo;allow
10% email format failures&rdquo; with <code>threshold=0.1</code>)</li>
<li>built-in structured logging using loguru allows for automatic logging of validation results,
failures, and performance metrics (unique among these libraries)</li>
<li>being a lightweight Great Expectations alternative with similar composability but minimal
dependencies</li>
<li>an extensive validation catalog organized into logical namespaces (Date, String, Null, Values,
etc.)</li>
<li>custom validation framework with consistent patterns for creating domain-specific rules</li>
</ul>
<p>Choose Validoopsie when you need:</p>
<ul>
<li>operational resilience in production pipelines where partial data quality issues shouldn&rsquo;t
stop processing</li>
<li>comprehensive validation logging and monitoring for observability in production environments</li>
<li>fine-grained control over validation failure behavior with different criticality levels</li>
<li>lightweight Great Expectations functionality without the complexity and dependencies</li>
<li>custom validation development with a clear, consistent framework</li>
<li>modular validation design that promotes reusability across projects</li>
</ul>
<p>Validoopsie is particularly well-suited for data engineering teams building robust production
pipelines where data quality monitoring is important but pipeline availability is critical. Its
impact/threshold system makes it uniquely powerful for environments where you need to distinguish
between &ldquo;nice to have&rdquo; and &ldquo;must have&rdquo; data quality requirements.</p>
<h2 id="5-dataframely-type-safe-schema-validation-with-advanced-features">5. Dataframely: Type-Safe Schema Validation with Advanced Features
</h2>
<p>Dataframely is a comprehensive data validation framework that brings type-safe schema validation to
Polars DataFrames with some of the most advanced features in the ecosystem. The library focuses on
providing both runtime validation and static type checking, with particular strengths in
collection validation for related DataFrames and extensive integration capabilities with external
tools.</p>
<p>Dataframely launched in early 2025 with native Polars support as a core feature, built specifically
for the modern data ecosystem with first-class support for complex validation scenarios.</p>
<h3 id="example-4">Example
</h3>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">polars</span> <span class="k">as</span> <span class="nn">pl</span>
</span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">dataframely</span> <span class="k">as</span> <span class="nn">dy</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">class</span> <span class="nc">UserSchema</span><span class="p">(</span><span class="n">dy</span><span class="o">.</span><span class="n">Schema</span><span class="p">):</span>
</span></span><span class="line"><span class="cl">    <span class="n">user_id</span> <span class="o">=</span> <span class="n">dy</span><span class="o">.</span><span class="n">Int64</span><span class="p">(</span><span class="n">primary_key</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="n">age</span> <span class="o">=</span> <span class="n">dy</span><span class="o">.</span><span class="n">Int64</span><span class="p">(</span><span class="n">nullable</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="n">email</span> <span class="o">=</span> <span class="n">dy</span><span class="o">.</span><span class="n">String</span><span class="p">(</span><span class="n">nullable</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">regex</span><span class="o">=</span><span class="sa">r</span><span class="s2">&#34;^[^@]+@[^@]+\.[^@]+$&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="n">score</span> <span class="o">=</span> <span class="n">dy</span><span class="o">.</span><span class="n">Float64</span><span class="p">(</span><span class="n">nullable</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mf">0.0</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mf">100.0</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="c1"># Use @dy.rule() for age range validation</span>
</span></span><span class="line"><span class="cl">    <span class="nd">@dy.rule</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">    <span class="k">def</span> <span class="nf">age_in_range</span><span class="p">(</span><span class="bp">cls</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">pl</span><span class="o">.</span><span class="n">Expr</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">        <span class="k">return</span> <span class="n">pl</span><span class="o">.</span><span class="n">col</span><span class="p">(</span><span class="s2">&#34;age&#34;</span><span class="p">)</span><span class="o">.</span><span class="n">is_between</span><span class="p">(</span><span class="mi">18</span><span class="p">,</span> <span class="mi">80</span><span class="p">,</span> <span class="n">closed</span><span class="o">=</span><span class="s2">&#34;both&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Validate using the schema</span>
</span></span><span class="line"><span class="cl"><span class="k">try</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">    <span class="n">validated_data</span> <span class="o">=</span> <span class="n">UserSchema</span><span class="o">.</span><span class="n">validate</span><span class="p">(</span><span class="n">user_data</span><span class="p">,</span> <span class="n">cast</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="nb">print</span><span class="p">(</span><span class="s2">&#34;Validation successful!&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="nb">print</span><span class="p">(</span><span class="n">validated_data</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">    <span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&#34;Validation failed: </span><span class="si">{</span><span class="n">e</span><span class="si">}</span><span class="s2">&#34;</span><span class="p">)</span></span></span></code></pre></div></div>
<p>This example showcases Dataframely&rsquo;s class-based schema approach with several notable features:
primary key constraints, comprehensive type validation with bounds, regex pattern matching, and
custom validation rules using the <code>@dy.rule()</code> decorator (used here for age range checking).</p>
<p>The <code>cast=True</code> parameter automatically coerces column types to match the schema definitions. This
is really useful when working with data from external sources where column types might not exactly
match your schema expectations (e.g., integers loaded as strings from CSV files).</p>
<p>Dataframely features soft validation and failure introspection. As one of Dataframely&rsquo;s standout
features, it brings a fairly sophisticated approach to validation failures. Rather than just raising
exceptions, it provides detailed failure analysis:</p>
<div class="code-block"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="c1"># Soft validation: separate valid and invalid rows</span>
</span></span><span class="line"><span class="cl"><span class="n">good_data</span><span class="p">,</span> <span class="n">failure_info</span> <span class="o">=</span> <span class="n">UserSchema</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">user_data</span><span class="p">,</span> <span class="n">cast</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="s2">&#34;Valid rows:&#34;</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">good_data</span><span class="p">))</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="s2">&#34;Failure counts:&#34;</span><span class="p">,</span> <span class="n">failure_info</span><span class="o">.</span><span class="n">counts</span><span class="p">())</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="s2">&#34;Co-occurrence analysis:&#34;</span><span class="p">,</span> <span class="n">failure_info</span><span class="o">.</span><span class="n">cooccurrence_counts</span><span class="p">())</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Inspect the actual failed rows</span>
</span></span><span class="line"><span class="cl"><span class="n">failed_rows</span> <span class="o">=</span> <span class="n">failure_info</span><span class="o">.</span><span class="n">invalid</span><span class="p">()</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="s2">&#34;Failed data:&#34;</span><span class="p">,</span> <span class="n">failed_rows</span><span class="p">)</span></span></span></code></pre></div></div>
<h3 id="comparisons-3">Comparisons
</h3>
<p>While both Dataframely and Pandera offer schema-centric validation approaches, they serve different
validation philosophies. Pandera excels in statistical validation with hypothesis testing and
distribution checks, making it ideal for data science workflows where statistical properties matter.
Dataframely, by contrast, emphasizes relational data integrity and type safety, providing more
sophisticated failure analysis and collection-level validation capabilities that Pandera doesn&rsquo;t
offer.</p>
<p>The relationship between Dataframely and Patito is particularly interesting since both use
class-based schema definitions. However, Dataframely extends far beyond Patito&rsquo;s Pydantic-focused
approach. Where Patito provides clean, simple validation with excellent Pydantic integration,
Dataframely offers advanced features like collection validation, group rules, and comprehensive
failure introspection. Teams already invested in Pydantic workflows might prefer Patito&rsquo;s
simplicity, while those building complex data systems will appreciate Dataframely&rsquo;s feature set.</p>
<p>Dataframely and Pointblank represent two different approaches to comprehensive data validation.
Pointblank shines in stakeholder communication with its beautiful interactive reports and
threshold-based alerting systems, making it perfect for data quality reporting. Dataframely focuses
instead on type safety and complex validation logic, with unique collection validation capabilities
that no other library in this survey provides. The choice between these two will comes down to
whether your priority is communicating validation results or ensuring complex data relationships
remain consistent.</p>
<p>When compared to Validoopsie&rsquo;s method chaining approach, Dataframely offers a more structured,
schema-centric methodology with advanced type safety features that Validoopsie doesn&rsquo;t provide.
While Validoopsie excels in operational flexibility and lightweight design for building reusable
validation components, Dataframely&rsquo;s strength lies in its comprehensive type system integration,
collection validation capabilities, and sophisticated failure analysis. And that makes it ideal for
complex data engineering workflows where relationships between multiple DataFrames matter as much as
individual DataFrame validation.</p>
<h3 id="unique-strengths-and-when-to-use-4">Unique Strengths and When to Use
</h3>
<p>Dataframely&rsquo;s standout features include:</p>
<ul>
<li>advanced type safety with full mypy integration and generic DataFrame types</li>
<li>collection validation for ensuring consistency across related DataFrames</li>
<li>group-based validation rules using <code>@dy.rule(group_by=[...])</code> for aggregate constraints</li>
<li>schema inheritance for reducing code duplication in related schemas</li>
<li>production-ready soft validation that separates valid and invalid data</li>
</ul>
<p>One might choose Dataframely when building complex data systems where:</p>
<ul>
<li>type safety and static analysis are critical for code quality</li>
<li>you need to validate relationships between multiple related DataFrames</li>
<li>you&rsquo;re working with production pipelines that need to handle partial data quality issues
gracefully</li>
<li>schema reuse and inheritance would benefit your codebase organization</li>
</ul>
<p>Dataframely is particularly well-suited for data engineering teams building robust, type-safe data
pipelines where the relationships between different data entities are as important as the validation
of individual DataFrames. Its collection validation capabilities make it uniquely powerful for
ensuring referential integrity in complex data workflows.</p>
<h2 id="choosing-the-right-library">Choosing the Right Library
</h2>
<p>With five solid validation libraries to choose from, the decision often comes down to your team&rsquo;s
specific workflow, existing tech stack, and validation requirements. Here are some practical
considerations to help guide your choice:</p>
<p><em>Start with your existing tools</em></p>
<p>If you&rsquo;re already using Pydantic extensively, Patito will feel natural. Teams that are heavily
invested in type checking and statistical analysis should probably gravitate toward Pandera. If
you&rsquo;re building data products that need stakeholder buy-in, Pointblank&rsquo;s reporting capabilities
become incredibly useful in that context. For teams already committed to strong typing and static
analysis workflows, Dataframely&rsquo;s advanced type safety features will feel like a natural extension
of your existing practices.</p>
<p><em>Consider your validation complexity</em></p>
<p>For straightforward schema validation and type checking, any of these libraries will work well. But
if you need statistical hypothesis testing, Pandera is your best bet. For highly custom validation
logic that needs to be composed and reused, Validoopsie shines. When validation results need to be
communicated to non-technical stakeholders, Pointblank&rsquo;s interactive reports are basically
unmatched. If you&rsquo;re dealing with complex relational data where multiple DataFrames need to maintain
consistency with each other, Dataframely&rsquo;s collection validation capabilities are unique in the
ecosystem.</p>
<p><em>Think about failure tolerance requirements</em></p>
<p>One of the most important architectural differences among these libraries is how they handle
validation failures. Only Pointblank and Validoopsie offer numeric threshold-based failure
tolerance. This is the ability to accept a controlled percentage of validation failures without
treating the entire validation as failed.</p>
<p>This distinction can be crucial for production environments where some level of data quality issues
is acceptable and you need fine-grained control over when validations should fail versus warn. In
many real-world scenarios, poor data quality is a given reality, and the goal becomes gradually
improving quality over time rather than enforcing perfection. Thresholds can then be seen not as
simple failure tolerances but more like data quality metrics and improvement goals (e.g., you might
start with <code>threshold=0.15</code> for email validation and progressively tighten to <code>0.05</code> as upstream
systems improve).</p>
<p><em>Think about your team&rsquo;s preferences</em></p>
<p>There&rsquo;s a human dimension here. Some data teams might prefer the declarative, schema-first approach
of Pandera, Patito, and Dataframely, whereas others like the step-by-step, method-chaining style of
Pointblank and Validoopsie. There&rsquo;s really no right or wrong choice here. It&rsquo;s all about what feels
right and most natural for your team&rsquo;s coding style and mental model.</p>
<p><em>Don&rsquo;t feel locked into one choice</em></p>
<p>My hunch is that many teams already successfully use different libraries for different parts of
their data pipeline. They&rsquo;re leveraging each tool&rsquo;s strengths where they matter most. So you could
conceivably use Patito for Pydantic-style validation, Pandera for statistical checks in your
analysis pipeline, Pointblank for generating stakeholder reports, and Dataframely for complex data
engineering workflows (use &rsquo;em all!). This multi-library approach can be particularly effective in
larger organizations with diverse validation needs.</p>
<p>I suppose the key is to start with one library that fits your immediate needs, learn it well, and
then consider expanding your toolkit as your validation requirements evolve.</p>
<h2 id="summary-and-wrapping-up">Summary and Wrapping Up
</h2>
<p>The Python ecosystem offers truly excellent options for validating Polars DataFrames! Choosing is
always tough but this is how one could make the decision based on specific needs:</p>
<ul>
<li>for type-safe pipelines, <strong>Pandera</strong>, <strong>Dataframely</strong>, or <strong>Patito</strong> are ideal</li>
<li>for stakeholder reporting, <strong>Pointblank</strong> is a great choice</li>
<li>for row-level object modeling, go with <strong>Patito</strong></li>
<li>for statistical validation, <strong>Pandera</strong> is perfect</li>
<li>for data quality improvement, <strong>Pointblank</strong> or <strong>Validoopsie</strong> fit well</li>
</ul>
<p>Each library has evolved to serve different aspects of the data validation ecosystem. Try them all
and, with a little understanding of their strengths, you&rsquo;ll get good at picking the right data
validation tool for your specific use case.</p>
<p>This survey represents our understanding of these libraries as of mid-2025. Given the rapid pace of
development in the Python data ecosystem, some details may become outdated or contain inaccuracies
(we may have even gotten things wrong at the outset). If you notice any errors or have updates to
share, we&rsquo;d love to hear from you! Please reach out through:</p>
<ul>
<li><a href="https://github.com/posit-dev/pointblank/issues" target="_blank" rel="noopener">GitHub Issues</a></li>
<li><a href="https://github.com/posit-dev/pointblank/discussions" target="_blank" rel="noopener">GitHub Discussions</a></li>
<li>Our <a href="https://discord.com/invite/YH7CybCNCQ" target="_blank" rel="noopener">Discord Server</a></li>
</ul>
<p>Any feedback you provide helps keep this resource accurate and useful for the community!</p>
]]></description>
    </item>
    <item>
      <title>C&#39;mon C&#39;mon: Let&#39;s Do a Pointblank Workshop!</title>
      <link>https://opensource.posit.co/blog/2025-06-03_lets-workshop-together/</link>
      <pubDate>Tue, 03 Jun 2025 00:00:00 +0000</pubDate>
      <guid>https://opensource.posit.co/blog/2025-06-03_lets-workshop-together/</guid>
      <dc:creator>Rich Iannone</dc:creator><description><![CDATA[<p>Recently, I&rsquo;ve been giving free workshops to data teams on Pointblank. These sorts of engagements
energize me, and I truly enjoy hearing what people are concerned with when it comes to data
validation. If <em>your</em> team is interested, I would love to schedule something with y&rsquo;all! Please
reach out at <a href="mailto:rich@posit.co">rich@posit.co</a> or message me on the (<a href="https://discord.com/invite/YH7CybCNCQ" target="_blank" rel="noopener">Pointblank Discord</a>).</p>
<p>Workshops have been especially helpful for understanding how people use and share Pointblank&rsquo;s
<a href="https://posit-dev.github.io/pointblank/user-guide/index.html" target="_blank" rel="noopener">validation results table</a>. For example, I learned that people like to
email or pull up the table for stakeholders so they can walk through problem cases (it&rsquo;s a great
conversation starter for getting to the heart of data quality issues).</p>
<p>A couple of months ago, I gave a workshop to one of Apple&rsquo;s data teams. During the Q&amp;A afterwards,
someone asked whether you can perform the same validation on different chunks of table rows. This
was a very helpful nudge for me to add a <a href="https://posit-dev.github.io/pointblank/user-guide/segmentation.html" target="_blank" rel="noopener"><code>segments=</code> argument</a>
to all of Pointblank&rsquo;s validation methods!</p>
<p>We are excited about how things are going with the Pointblank project and are <em>always up</em> for
providing a workshop to your data team (at no cost). If this sounds interesting to you please feel
free to contact me through email or via Discord. Don&rsquo;t be shy. Just know that if you have a need for
data validation, we&rsquo;re here to help!</p>
<h2 id="acknowledgment">Acknowledgment
</h2>
<p>I&rsquo;d like to give special thanks to Rami Krispin for his interest in Pointblank and for facilitating
a recent workshop. If you&rsquo;re interested in more data science insights, check out
<a href="https://ramikrispin.substack.com" target="_blank" rel="noopener">Rami&rsquo;s Data Newsletter</a> where he shares valuable perspectives
on data engineering, LLMs, and analytics.</p>
]]></description>
    </item>
  </channel>
</rss>
