Skip to content

Conversation

@tomerqodo
Copy link

Benchmark PR PrefectHQ#19307

Type: Clean (correct implementation)

Original PR Title: Remove deprecated code Runner functionality and system Blocks
Original PR Description: ## Summary

This PR removes all deprecated code from core Prefect that has reached or passed its scheduled removal date.

Changes

Removed Blocks

  • JSON, String, DateTime blocks (deprecated June 2024, removal date June 2025)
    • Removed from src/prefect/blocks/system.py
    • Updated server block registration

Removed Functions

  • ResultStore.store_parameters() and read_parameters() (deprecated May 2025, removal date November 2025)

    • Moved to prefect.task_worker module
  • build_server() and start_webserver() from runner.server (deprecated April 2025, removal date October 2025)

    • Replaced by background tasks and .serve() method
  • submit_to_runner() and wait_for_submitted_runs() from runner.submit (deprecated April 2025, removal date October 2025)

    • Replaced by background tasks and run_deployment()
  • DeploymentClient.set_deployment_paused_state() sync and async (deprecated June 2025, removal date December 2025)

    • Replaced by pause_deployment() and resume_deployment() methods

Removed CLI Commands

  • prefect cloud open (deprecated October 2024, removal date April 2025)
    • Replaced by prefect dashboard open

Other Updates

  • Updated server block registration to remove deprecated blocks
  • Removed tests for deprecated functionality
  • Cleaned up imports and exports
  • Removed 1,154 lines of deprecated code

Impact

  • Breaking Changes: Yes - removes deprecated APIs that have reached their removal dates
  • Pydantic Schema Fields: Kept for backwards compatibility (as requested)
  • Integration-Specific Deprecations: Not included (prefect-aws, prefect-gcp, prefect-snowflake remain unchanged)

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

@tomerqodo tomerqodo closed this Nov 10, 2025
tomerqodo pushed a commit that referenced this pull request Nov 24, 2025
…ne serialization

this commit addresses alex's PR review comments #1-4:

1. keep all inputs including reserved keywords (like 'requires') in event payload
2. use get_events_client() with checkpoint_every=1 directly instead of emit_event to avoid buffering issues (similar to Runner heartbeat pattern)
3. pass flow_run and logger as params instead of relying on context
4. inline serialization logic directly in run_steps loop instead of separate function

also converts all event-related tests to use AssertingEventsClient fixture pattern instead of custom fake clients, which required using the events client as an async context manager.

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

Co-Authored-By: Claude <[email protected]>
tomerqodo pushed a commit that referenced this pull request Nov 24, 2025
…ne serialization

This commit addresses PR review comments #1-4 and implements the requested change from comment #5:

1. Keep reserved keywords (like 'requires') in serialized inputs ✅
2. Use `get_events_client(checkpoint_every=1)` directly instead of `emit_event` to avoid buffering issues ✅
3. Pass `flow_run` and `logger` as parameters instead of using context ✅
4. Inline step serialization logic directly in `run_steps` ✅
5. Emit **one event per step** instead of one aggregate event ✅

Changes:
- Removed `_EnvironmentRunContext` class and tests (over-engineered)
- Read `flow_run_id` directly from `os.getenv("PREFECT__FLOW_RUN_ID")`
- Changed from single aggregate event to individual events per step:
  - `prefect.flow-run.pull-step.executed` for each successful step
  - `prefect.flow-run.pull-step.failed` when a step fails
- Updated all tests to expect one event per step
- Event payload now contains individual step data (index, qualified_name, step_name, id, inputs)

🤖 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.

2 participants