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

Updated error message for validation tasks #1338

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

WilliamDee
Copy link
Contributor

Context

Currently, in dwh validations for dimensions, we query all the dimensions in 1 query and if that fails we attempt to query each dimension one by one. However, with time dimension, we end up querying multiple variants of a singular dimension (ie., ordered_at expands to querying ordered_at__week, ordered_at__month, etc...), but the error message only used the element_ment. This meant in the error, we ended up seeing "duplicates", but it was actually just querying each one of those variants. With this, we should use the qualfiied name to see what we're actually querying for

Example:

Screenshot 2024-07-15 at 10 33 32 PM

@@ -238,7 +238,7 @@ def gen_dimension_tasks(
),
element_type=SemanticModelElementType.DIMENSION,
),
error_message=f"Unable to query dimension `{spec.element_name}` on semantic model `{semantic_model.name}` in data warehouse",
error_message=f"Unable to query dimension `{spec.qualified_name}` on semantic model `{semantic_model.name}` in data warehouse",
Copy link
Contributor Author

@WilliamDee WilliamDee Jul 16, 2024

Choose a reason for hiding this comment

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

Q: This was logic already here, but do we need to query against every grain for a time dimension? Could we just consolidate this to only query for the time dimension column or are there cases where the grain/dow casting fails. This all feels redundant if that's not the case

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmmm cases I can think of:

  • the grain is too small for what the time dimension supports
  • date part is not supported for cumulative metrics

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So since these arent metric queries and just straight SELECT <dim column> FROM sem_model do those still apply?

Copy link
Contributor

Choose a reason for hiding this comment

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

If the user can request a grain then the grain one still applies! Like is there a date trunc happening here? If so it could fail if the time column can't be trunced to a certain level

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually same for date part since they could request a date part that's too small for the column

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea the date trunc happens here

@WilliamDee WilliamDee merged commit 61677ec into main Jul 16, 2024
43 checks passed
@WilliamDee WilliamDee deleted the will/update-validator-message branch July 16, 2024 14:13
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