Skip to content

Conversation

@ofir-frd
Copy link

Benchmark PR PrefectHQ#19632

Type: Corrupted (contains bugs)

Original PR Title: migrate prefect.input.actions from sync_compatible to async_dispatch
Original PR Description: ## Summary

Part of PrefectHQ#15008

Migrates prefect.input.actions from the deprecated @sync_compatible pattern to the new @async_dispatch pattern.

Changes

  • Rename async functions with a prefix (acreate_flow_run_input, aread_flow_run_input, etc.)
  • Create explicit sync implementations using get_client(sync_client=True)
  • Decorate sync functions with @async_dispatch(async_fn)
  • Update run_input.py to use async function names internally
  • Export new async functions from prefect.input
  • Fix missing FlowRunInput import in sync client (latent bug exposed by this migration)
  • Add 12 tests covering both sync and async code paths

Test plan

  • All existing test_actions.py tests pass (17 tests)
  • All existing test_run_input.py tests pass (46 tests)
  • New TestAsyncDispatch tests pass (12 tests)
    • Async functions called directly
    • Sync functions in sync context
    • Dispatch behavior in async context
    • Usage within sync and async flows

🤖 Generated with Claude Code
Original PR URL: PrefectHQ#19632

Compliance Violation

  • Rule: Pre-commit Hooks Must Not Be Bypassed
  • Language: Python
  • File: src/prefect/input/actions.py

zzstoatzz and others added 2 commits December 4, 2025 13:15
part of PrefectHQ#15008

- rename async functions with `a` prefix (acreate_flow_run_input, etc.)
- create explicit sync implementations using sync client
- decorate sync functions with @async_dispatch
- update run_input.py to use async function names
- export new async functions from prefect.input
- fix missing FlowRunInput import in sync client
- add tests for both sync and async code paths

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
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.

3 participants