Skip to content

fix: use SOURCE_ERROR in streaming runner commit-failure path#71

Merged
anaselmhamdi merged 1 commit into
mainfrom
anaselmhamdi/fix-error
Apr 17, 2026
Merged

fix: use SOURCE_ERROR in streaming runner commit-failure path#71
anaselmhamdi merged 1 commit into
mainfrom
anaselmhamdi/fix-error

Conversation

@anaselmhamdi

Copy link
Copy Markdown
Collaborator

Summary

  • PipelineReturnStatus.ERROR does not exist on the enum — when source.commit() raised in StreamingRunner.run(), the except branch crashed with a secondary AttributeError: ERROR instead of reporting failure cleanly.
  • Swap both references in bizon/engine/runner/adapters/streaming.py:168-169 to PipelineReturnStatus.SOURCE_ERROR, matching the convention already used in bizon/engine/pipeline/producer.py.

Observed in production

Datadog traceback:

File ".../bizon/engine/runner/adapters/streaming.py", line 168, in run
  monitor.track_pipeline_status(PipelineReturnStatus.ERROR)
File ".../python3.11/enum.py", line 786, in __getattr__
  raise AttributeError(name) from None
AttributeError: ERROR

Downstream impact (verified safe)

  • track_pipeline_status(...): value is interpolated into a statsd tag. SOURCE_ERROR is already emitted elsewhere (producer.py), so no new metric cardinality.
  • RunnerStatus(stream=SOURCE_ERROR): validates against Optional[PipelineReturnStatus]; is_success returns False; to_string() renders "Pipeline finished with status Failure (Stream: source_error)".
  • bizon/cli/main.py:136 branches on result.is_success → failure path runs as intended (previously it never got there because of the crash).

Test plan

  • uv run ruff check bizon/engine/runner/adapters/streaming.py — clean
  • grep -rn "PipelineReturnStatus.ERROR\b" bizon/ returns no matches
  • Smoke test: RunnerStatus(stream=PipelineReturnStatus.SOURCE_ERROR)is_success=False, to_string() renders correctly
  • Merge and observe that streaming-runner commit failures now log source_error cleanly instead of AttributeError: ERROR

Version bump will follow in a separate PR.

🤖 Generated with Claude Code

PipelineReturnStatus.ERROR does not exist on the enum, so when
source.commit() raised in the streaming runner the except branch
crashed with a secondary AttributeError instead of reporting failure.
Use SOURCE_ERROR, matching the convention already used in producer.py.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@anaselmhamdi anaselmhamdi mentioned this pull request Apr 17, 2026
2 tasks
@anaselmhamdi anaselmhamdi merged commit ce31285 into main Apr 17, 2026
1 check 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.

1 participant