fix: use SOURCE_ERROR in streaming runner commit-failure path#71
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PipelineReturnStatus.ERRORdoes not exist on the enum — whensource.commit()raised inStreamingRunner.run(), theexceptbranch crashed with a secondaryAttributeError: ERRORinstead of reporting failure cleanly.bizon/engine/runner/adapters/streaming.py:168-169toPipelineReturnStatus.SOURCE_ERROR, matching the convention already used inbizon/engine/pipeline/producer.py.Observed in production
Datadog traceback:
Downstream impact (verified safe)
track_pipeline_status(...): value is interpolated into a statsd tag.SOURCE_ERRORis already emitted elsewhere (producer.py), so no new metric cardinality.RunnerStatus(stream=SOURCE_ERROR): validates againstOptional[PipelineReturnStatus];is_successreturnsFalse;to_string()renders"Pipeline finished with status Failure (Stream: source_error)".bizon/cli/main.py:136branches onresult.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— cleangrep -rn "PipelineReturnStatus.ERROR\b" bizon/returns no matchesRunnerStatus(stream=PipelineReturnStatus.SOURCE_ERROR)→is_success=False,to_string()renders correctlysource_errorcleanly instead ofAttributeError: ERRORVersion bump will follow in a separate PR.
🤖 Generated with Claude Code