-
Couldn't load subscription status.
- Fork 96
Fix Error Handling and None Value Processing in Templates Aggregation Pipeline #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for that change. Two things to check/discuss. Otherwise looks good.
| try: | ||
| # Validate input consistency | ||
| if image_ids is not None and len(image_ids) != len(templates): | ||
| raise ValueError( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about making this error more specific? Say DifferentImageIdsTemplatesListLen
| key="templates_aggregation_metadata", | ||
| extractor=lambda ct: {k: v for k, v in ct.get("aggregation_result", {}).items() if k != "iris_template"}, | ||
| extractor=lambda ct: None | ||
| if (agg := ct.get("aggregation_result")) is None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is walrus operator available in Python3.8 that we support?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it was introduced in 3.8
Fix Error Handling and None Value Processing in Templates Aggregation Pipeline (#177)
Fix Error Handling and None Value Processing in Templates Aggregation Pipeline
PR description
This PR addresses critical error handling issues and improves robustness when processing None values in the templates aggregation pipeline and output builders.
Issue
Several error handling and None value processing issues were identified:
_handle_execution_errorinstead of the correct error manageraggregation_resultis None, causing crashes during metadata extractionSolution
Error Handling Improvements:
TemplatesAggregationPipeline: Replaced incorrect_handle_execution_error(None, e)call with properself.env.error_manager(self.call_trace, e)usageNone Value Processing:
MULTIFRAME_IRIS_PIPE_ORB_OUTPUT_SPECandMULTIFRAME_IRIS_PIPE_SIMPLE_ORB_OUTPUT_SPECto safely handle Noneaggregation_resultvalues using walrus operator patternNonewhenaggregation_resultis missing rather than raising exceptionsLimitations
Type
Checklist