Skip to content

fix: coerce null stats in Apify request queue metadata#974

Merged
vdusek merged 1 commit into
masterfrom
fix/request-queue-null-stats
Jun 12, 2026
Merged

fix: coerce null stats in Apify request queue metadata#974
vdusek merged 1 commit into
masterfrom
fix/request-queue-null-stats

Conversation

@vdusek

@vdusek vdusek commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Opening a request queue crashed when the Apify API omitted stats (sending an explicit null): model_dump(by_alias=True) preserved stats: None, and the non-optional stats field on ApifyRequestQueueMetadata rejected it. The default_factory only fires when the key is absent, not when it is present-but-null.

This adds a BeforeValidator that coerces None to a default RequestQueueStats, mirroring the defensive metadata.stats or RequestQueueStats() already used in get_metadata(), so every validation path is protected.

@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Jun 12, 2026
@vdusek vdusek self-assigned this Jun 12, 2026
@github-actions github-actions Bot added this to the 142nd sprint - Tooling team milestone Jun 12, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Jun 12, 2026
@vdusek vdusek requested a review from Pijukatel June 12, 2026 09:10
@vdusek vdusek marked this pull request as ready for review June 12, 2026 09:10
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.88%. Comparing base (2cc5602) to head (a590ff9).
⚠️ Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #974      +/-   ##
==========================================
- Coverage   89.91%   89.88%   -0.04%     
==========================================
  Files          49       49              
  Lines        3085     3085              
==========================================
- Hits         2774     2773       -1     
- Misses        311      312       +1     
Flag Coverage Δ
e2e 35.98% <100.00%> (ø)
integration 56.95% <100.00%> (-0.04%) ⬇️
unit 78.70% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek vdusek merged commit 63eb771 into master Jun 12, 2026
28 of 29 checks passed
@vdusek vdusek deleted the fix/request-queue-null-stats branch June 12, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants