Skip to content

Commit bdb520a

Browse files
authored
Merge pull request #33 from cipher813/fix/daily-append-zero-ok-guard
Remove over-eager n_ok==0 guard in daily_append
2 parents 39359b7 + ed6fcbc commit bdb520a

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

builders/daily_append.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,14 +307,16 @@ def daily_append(
307307
n_ok, n_skip, n_err, len(stock_tickers), t_total,
308308
)
309309

310-
# Hard-fail guards — prevent silently returning a no-op as success.
310+
# Hard-fail on high error rate. ``n_ok == 0`` alone is NOT a failure
311+
# signal — it correctly occurs when every ticker hit the
312+
# "today already in ArcticDB" skip path (a second same-day invocation,
313+
# or a Step Function retry that runs after the first one succeeded).
314+
# The real silent-fail we're guarding against (ArcticDB-wide auth /
315+
# connectivity failure making every read throw) now registers as
316+
# ``n_err`` rather than ``n_skip`` after PR #24, so the 5% error-rate
317+
# threshold catches it without false positives on no-op reruns.
311318
# dry_run is exempt because it short-circuits the per-ticker loop.
312319
if not dry_run:
313-
if n_ok == 0:
314-
raise RuntimeError(
315-
f"ArcticDB daily_append wrote zero tickers "
316-
f"(n_skip={n_skip} n_err={n_err} of {len(stock_tickers)}) — treating as pipeline failure"
317-
)
318320
err_rate = n_err / max(len(stock_tickers), 1)
319321
if err_rate > 0.05:
320322
raise RuntimeError(

0 commit comments

Comments
 (0)