<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ahmed Abdeltawab</title>
    <description>The latest articles on DEV Community by Ahmed Abdeltawab (@ahmedabdeltawab).</description>
    <link>https://dev.to/ahmedabdeltawab</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4069261%2Fffc54d43-6307-4eca-b088-baa393b4f082.png</url>
      <title>DEV Community: Ahmed Abdeltawab</title>
      <link>https://dev.to/ahmedabdeltawab</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ahmedabdeltawab"/>
    <language>en</language>
    <item>
      <title>An adversarial review found 11 real defects in my Python library. Best decision I made.</title>
      <dc:creator>Ahmed Abdeltawab</dc:creator>
      <pubDate>Tue, 11 Aug 2026 12:23:15 +0000</pubDate>
      <link>https://dev.to/ahmedabdeltawab/an-adversarial-review-found-11-real-defects-in-my-python-library-best-decision-i-made-2h85</link>
      <guid>https://dev.to/ahmedabdeltawab/an-adversarial-review-found-11-real-defects-in-my-python-library-best-decision-i-made-2h85</guid>
      <description>&lt;p&gt;I built and published a Python library — then put it in front of an adversarial review whose only job was to break it. This is what it found, and what the library looks like now.&lt;/p&gt;

&lt;h2&gt;
  
  
  What pydextra is
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;pip install pydextra&lt;/code&gt;, then &lt;code&gt;import dextra as dx&lt;/code&gt;. It's a small data-analysis library with one obsession: &lt;strong&gt;disclosure&lt;/strong&gt;. Its 63 public functions — plus 5 scikit-learn-compatible wrappers, 68 public callables in all — share one flag vocabulary and:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;print a one-line &lt;code&gt;Decision:&lt;/code&gt; explaining what they did and why,&lt;/li&gt;
&lt;li&gt;keep an audit trail on the DataFrame,&lt;/li&gt;
&lt;li&gt;and, wherever statistics are learned from data, return a replayable &lt;code&gt;params&lt;/code&gt; plan — fit on train, replay verbatim on test — so train/test leakage becomes hard to commit by accident.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One real call, verbatim from the leakage-safe pipeline notebook:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;train_fe&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;featpipe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;train&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;steps&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;steps&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;return_params&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Decision: Fitted a 3-step featpipe pipeline (handle_missing -&amp;gt; encode -&amp;gt; scale);
33 new column(s) produced; combined params is a versioned, JSON-serialisable
artifact. Apply to held-out data with featpipe(df_test, params=...).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The part I'm most proud of isn't a feature
&lt;/h2&gt;

&lt;p&gt;An adversarial external evaluation found &lt;strong&gt;11 evidence-backed defects&lt;/strong&gt; in the library. Version 0.6.0 closed all 11 — each one reproduced first by a failing "red" test, then fixed until green, with ~35 permanent regression tests and zero-warning exit gates. The original independent audit had scored an earlier version 82/100; the updated referee evaluation of 0.6.0 passed every agreed gate — 10/10 on a measurable definition fixed before the work started — with the remaining limitations listed openly in the repo.&lt;/p&gt;

&lt;p&gt;Since 0.6.0 the API is frozen by policy: no new features, hotfixes only. What you evaluate today is what you run next year.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three notebooks, real mess
&lt;/h2&gt;

&lt;p&gt;All three are published fully executed on Kaggle:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://www.kaggle.com/code/ahmedabdeltawab40/rescuing-9-291-invoices-from-coercion-pydextra" rel="noopener noreferrer"&gt;Rescuing 9,291 invoice numbers from silent coercion&lt;/a&gt;&lt;/strong&gt; — how numeric coercion silently eats identifiers, and how a disclosure-first loader catches it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://www.kaggle.com/code/ahmedabdeltawab40/two-pipelines-same-auc-0-8465-one-is-lying" rel="noopener noreferrer"&gt;Two pipelines, same AUC (0.8465) — one is lying&lt;/a&gt;&lt;/strong&gt; — the wrong protocol and the right one produce identical single-run AUC (0.8465); only 10 repetitions expose the real optimistic bias (+0.0261 ± 0.0210, wrong side higher in 9 of 10 runs). The full write-up: &lt;a href="https://ahmedabdeltawab602-collab.github.io/dextra/same-auc-hidden-leak/" rel="noopener noreferrer"&gt;Same AUC, hidden leak&lt;/a&gt;, or &lt;a href="https://colab.research.google.com/github/ahmedabdeltawab602-collab/dextra/blob/main/notebooks/00-leakage-in-5-minutes.ipynb" rel="noopener noreferrer"&gt;run it in 5 minutes on Colab&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://www.kaggle.com/code/ahmedabdeltawab40/egypt-food-prices-2010-2026-arabic-eda-pydextra" rel="noopener noreferrer"&gt;Egypt food prices 2010–2026: a fully-Arabic EDA&lt;/a&gt;&lt;/strong&gt; — garlic +214.8% in one jump. Deliberately written in Arabic: technical Arabic data-science content is rare, and this is a small contribution against that gap.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Honest scope
&lt;/h2&gt;

&lt;p&gt;It's a personal educational-practical project — &lt;strong&gt;not&lt;/strong&gt; a pandas replacement, and not aimed at production-scale pipelines. pandas is the engine underneath; pydextra adds the disclosure layer.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/ahmedabdeltawab602-collab/dextra" rel="noopener noreferrer"&gt;https://github.com/ahmedabdeltawab602-collab/dextra&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;PyPI: &lt;a href="https://pypi.org/project/pydextra/" rel="noopener noreferrer"&gt;https://pypi.org/project/pydextra/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Docs: &lt;a href="https://ahmedabdeltawab602-collab.github.io/dextra/" rel="noopener noreferrer"&gt;https://ahmedabdeltawab602-collab.github.io/dextra/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the idea of functions that explain themselves appeals to you, a GitHub star helps others find it.&lt;/p&gt;

</description>
      <category>python</category>
      <category>datascience</category>
      <category>opensource</category>
      <category>testing</category>
    </item>
  </channel>
</rss>
