Skip to content

build(deps): pin fastapi<0.144 until Prefect works on current FastAPI (#353) - #358

Merged
tino097 merged 4 commits into
mainfrom
353-fastapi-pin
Oct 29, 2026
Merged

tino097 merged 4 commits into
mainfrom
353-fastapi-pin

Conversation

@tino097

@tino097 tino097 commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Fixes #353

Proposed fixes:

Every fresh install since 2026-10-20 fails on import prefect:

TypeError: Body() got an unexpected keyword argument 'min_items'
  prefect/server/api/concurrency_limits_v2.py:305

Prefect 3.7 only requires fastapi<1.0, and FastAPI 0.155.0 removed the deprecated min_items argument Prefect still passes. This takes down the unit suite, prefect server start, and the integration CI. Main is red for this reason, and so are #356, #357 and the recent Dependabot PRs.

The first version of this PR pinned fastapi<0.155. The integration run on that commit got past the import and the server start, then ckan datapusher_plus prefect-deploy failed with a second FastAPI change: 0.144 to 0.154 no longer treat a JSON null as "missing" for Body(None) on an int parameter, so the Prefect client's workers/filter request (limit: null, offset: null) is rejected:

422 Unprocessable Entity ... {'type': 'int_type', 'loc': ['body', 'limit'], 'msg': 'Input should be a valid integer', 'input': None}

This PR therefore pins fastapi<0.144. 0.143.x is what main's last green CI run (2026-10-16) installed; the whole 0.144 to 0.162 range was released between 2026-10-18 and 23.

Check Observed result
pip install --dry-run --ignore-installed -r requirements.txt fastapi 0.143.5 with prefect 3.7.8
Local Prefect 3.7.8 server, POST workers/filter with limit: null 422 on fastapi 0.154.0; 404 (pool lookup, expected) on 0.143.5
PrefectClient.read_workers_for_work_pool against that server on 0.143.5 succeeds
Unit suite (pytest tests --ignore=tests/integration --ignore=tests/js, with --ckan-ini) 342 passed, 1 skipped on 0.143.5; 15 failed on 0.162.0 before any pin
CI on the <0.155 commit unit suite passed, integration failed at prefect-deploy with the 422 above
  • Pin rather than Prefect bump. prefect>=3.7,<3.8 stays; a Prefect release that works on current FastAPI is the real fix and this pin should go with it.
  • No code change. Only requirements.txt and the changelog.

🤖 Generated with Claude Code

Prefect 3.7 only requires fastapi<1.0. FastAPI 0.155.0 (2026-10-20)
removed the deprecated min_items argument that
prefect/server/api/concurrency_limits_v2.py still passes to Body(), so
every fresh install fails on import prefect with
"TypeError: Body() got an unexpected keyword argument 'min_items'",
taking down the unit suite, prefect server start and the integration CI.

A dry-run install of the pinned requirements resolves fastapi 0.154.0
with prefect 3.7.8. Drop the pin once a Prefect release stops passing
min_items.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The first CI run with fastapi<0.155 got past import prefect and prefect
server start, then failed in prefect-deploy: FastAPI 0.144 to 0.154 no
longer treat a JSON null as "missing" for Body(None) on an int
parameter, so the Prefect client's workers/filter request (limit: null,
offset: null) is rejected with 422 "Input should be a valid integer".

Reproduced against a local Prefect 3.7.8 server: 422 on fastapi 0.154.0,
404 (pool lookup, as expected) on 0.143.5, and
read_workers_for_work_pool succeeds on 0.143.5. 0.143.x is what the last
green main CI run installed. Unit suite: 342 passed on 0.143.5.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@tino097 tino097 changed the title build(deps): pin fastapi<0.155 until Prefect drops min_items (#353) build(deps): pin fastapi<0.144 until Prefect works on current FastAPI (#353) Oct 28, 2026
@tino097
tino097 requested a review from jqnatividad October 28, 2026 18:08
tino097 and others added 2 commits October 28, 2026 19:12
Rationale stays in the commit history, PR #358 and issue #353.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

✅ No blocking issues noticed

No blocking implementation findings were identified. The dependency and Prefect compatibility criteria remain unverified by automated tests, including resolution, import, worker filtering, and deployment workflow coverage.

About this PR

  • Consider adding automated dependency-resolution and Prefect smoke/integration coverage so the compatibility pin cannot be accidentally weakened or removed without detection.

Test suggestions

  • Verify dependency resolution selects FastAPI below 0.144 while satisfying the Prefect constraint.
  • Import Prefect successfully using the pinned dependency set.
  • Exercise Prefect worker filtering with null limit and offset values.
  • Run the Prefect deployment workflow against the pinned FastAPI version.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify dependency resolution selects FastAPI below 0.144 while satisfying the Prefect constraint.
2. Import Prefect successfully using the pinned dependency set.
3. Exercise Prefect worker filtering with null limit and offset values.
4. Run the Prefect deployment workflow against the pinned FastAPI version.

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

@tino097
tino097 merged commit 1cc6e00 into main Oct 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unit suite fails with FastAPI >= 0.155 (Prefect 3.7.8: Body() got an unexpected keyword argument 'min_items')

1 participant