From c6b52116f559c869619e369653e86ef62cd3a1aa Mon Sep 17 00:00:00 2001 From: Kevin Costner <120246174+kevincostner17@users.noreply.github.com> Date: Tue, 15 Sep 2026 19:03:14 +0530 Subject: [PATCH] test(numeric): list only files that still have direct to_numeric calls Only enterprise/contracts.py has direct pd.to_numeric calls left. The other entries in _DEFERRED had no references, so the static guard never counted them; drop them so the list stays accurate, and fail the test when a _DEFERRED entry has no direct calls so the list cannot go stale again. --- tests/test_numeric.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/tests/test_numeric.py b/tests/test_numeric.py index b2becfe2..50871168 100644 --- a/tests/test_numeric.py +++ b/tests/test_numeric.py @@ -373,20 +373,8 @@ def _tripwire(arg, *args, **kwargs): _PACKAGE = Path(freshdata.__file__).resolve().parent -# Left for a follow-up PR. -_DEFERRED = frozenset({ - "enterprise/contracts.py", - "enterprise/privacy.py", - "enterprise/privacy_policy.py", - "enterprise/cleaner.py", - "enterprise/interface.py", - "learning/privacy.py", - "experimental/ai_copilot.py", - "_util.py", - "parsers/base.py", - "execution/_config.py", - "execution/backends/_duckdb.py", -}) +# Files whose direct calls are left for a follow-up PR. +_DEFERRED = frozenset({"enterprise/contracts.py"}) # Direct calls whose argument is provably numeric: pandas never runs its # string parser on them. Counts must match exactly, so a new call in the same @@ -429,3 +417,5 @@ def test_every_to_numeric_call_goes_through_safe_to_numeric(): ) stale = {rel for rel in _NUMERIC_ONLY if rel not in found} assert not stale, f"update _NUMERIC_ONLY: {stale}" + stale_deferred = {rel for rel in _DEFERRED if not _to_numeric_references(_PACKAGE / rel)} + assert not stale_deferred, f"remove from _DEFERRED: {stale_deferred}"