Skip to content
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

Make recipe errors more user-friendly #1118

Merged
merged 3 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20240409-112145.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Improve error messages for dataflow plan failures.
time: 2024-04-09T11:21:45.068428-07:00
custom:
Author: courtneyholcomb
Issue: "1118"
9 changes: 4 additions & 5 deletions metricflow/dataflow/builder/dataflow_plan_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,11 @@ def _build_aggregated_conversion_node(
logger.info(f"Recipe for conversion measure aggregation:\n{mf_pformat(conversion_measure_recipe)}")
if base_measure_recipe is None:
raise UnableToSatisfyQueryError(
f"Recipe not found for measure spec: {base_measure_spec.measure_spec} and linkable specs: {base_required_linkable_specs}"
f"Unable to join all items in request. Measure: {base_measure_spec.measure_spec}; Specs to join: {base_required_linkable_specs}"
)
if conversion_measure_recipe is None:
raise UnableToSatisfyQueryError(
f"Recipe not found for measure spec: {conversion_measure_spec.measure_spec}"
f"Unable to build dataflow plan for measure: {conversion_measure_spec.measure_spec}"
courtneyholcomb marked this conversation as resolved.
Show resolved Hide resolved
)

# Gets the aggregated opportunities
Expand Down Expand Up @@ -653,7 +653,7 @@ def _build_plan_for_distinct_values(self, query_spec: MetricFlowQuerySpec) -> Da
linkable_spec_set=required_linkable_specs, time_range_constraint=query_spec.time_range_constraint
)
if not dataflow_recipe:
raise UnableToSatisfyQueryError(f"Recipe not found for linkable specs: {required_linkable_specs}")
raise UnableToSatisfyQueryError(f"Unable to join all items in request: {required_linkable_specs}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this user-facing, and do we have any idea know when it happens and why? If so we could maybe add some more details around possible causes, but at this point I don't think we have that info yet.

I'm kind of wondering why this happens.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's a good question! I did a quick DD search of the past week of these errors: https://dbtlabsmt.datadoghq.com/logs?query=recipe%20not%20found%20&cols=host%2Cservice&fromUser=true&index=%2A&messageDisplay=inline&refresh_mode=sliding&storage=hot&stream_sort=desc&viz=stream&from_ts=1712081485492&to_ts=1712686285492&live=true
There is some stuff I don't understand here, like how a non-additive dimension spec might impact the dataflow plan.


output_node = dataflow_recipe.source_node
if dataflow_recipe.join_targets:
Expand Down Expand Up @@ -1300,9 +1300,8 @@ def _build_aggregated_measure_from_measure_source_node(
logger.info(f"Using recipe:\n{indent(mf_pformat(measure_recipe))}")

if measure_recipe is None:
# TODO: Improve for better user understandability.
raise UnableToSatisfyQueryError(
f"Recipe not found for measure spec: {measure_spec} and linkable specs: {required_linkable_specs}"
f"Unable to join all items in request. Measure: {measure_spec.element_name}; Specs to join: {required_linkable_specs}"
)

queried_agg_time_dimension_specs = queried_linkable_specs.included_agg_time_dimension_specs_for_measure(
Expand Down
Loading