Skip to content

Reclassify user related errors #1760

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

Merged
merged 5 commits into from
Jun 2, 2025
Merged

Reclassify user related errors #1760

merged 5 commits into from
Jun 2, 2025

Conversation

WilliamDee
Copy link
Contributor

Context

We throw a bunch of different exceptions for different scenarios. In attempts to categorize the errors appropriately, we will introduce a InformativeError which denotes that it isn't a system error from MF, but an error that falls under the bucket of things that a user can tweak in their input (either in their manifest config or query formulation) or it's just not supported.

This isn't a complete solution, but there will be further efforts to classify more and make all the error handling be more verbose.

@WilliamDee WilliamDee requested a review from a team as a code owner May 27, 2025 15:43
@cla-bot cla-bot bot added the cla:yes label May 27, 2025
@WilliamDee WilliamDee force-pushed the will/classify-errors branch from 3a68557 to cd7bf59 Compare May 27, 2025 15:56
Copy link
Contributor

@plypaul plypaul left a comment

Choose a reason for hiding this comment

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

@@ -4,7 +4,13 @@
from typing import Dict, Optional


class CustomerFacingSemanticException(Exception):
class InformativeError(Exception):
"""Raised when the error is actionable by the user or is informational."""
Copy link
Contributor

Choose a reason for hiding this comment

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

What errors aren't informational?

Copy link
Contributor Author

@WilliamDee WilliamDee May 27, 2025

Choose a reason for hiding this comment

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

There's probably a better naming for this, but just trying to categorize it into the buckets of system/internal errors vs user/featurenotsupported/configerror/etc... and the latter I considered as informational to the user

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to InformativeUserError if that's any better and updated the docstring

@WilliamDee
Copy link
Contributor Author

WilliamDee commented May 27, 2025

LGTM, but please see comments. Also, I was thinking of adding a base exception class like:

https://github.com/dbt-labs/metricflow/blob/p/semantic_graph.pr_1760_comment/metricflow-semantics/metricflow_semantics/experimental/metricflow_exception.py

@plypaul yea the InformationalUserError can inherit the base MetricflowException. I was just thinking we should be able to have a catch-all exception that allows us to know this is an error that is not actionable on our end (not a bug or anything)

@plypaul
Copy link
Contributor

plypaul commented May 27, 2025

To clarify, I haven't thought much about the exception class hierarchy, and the linked file was for reference, not that we need to put that in right now.

@WilliamDee WilliamDee merged commit efc7db3 into main Jun 2, 2025
12 checks passed
@WilliamDee WilliamDee deleted the will/classify-errors branch June 2, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants