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

Support custom granularity in linkable spec resolution #1415

Open
wants to merge 3 commits into
base: court/parse-custom-2
Choose a base branch
from

Conversation

courtneyholcomb
Copy link
Contributor

@courtneyholcomb courtneyholcomb commented Sep 20, 2024

Further updates to linkable spec resolution needed to support custom granularities.

This also fixes a bug related to cumulative metric restrictions: Cumulative metrics CAN be queried with non-default granularity now, so this removes that restriction. This was not an issue in actual queries because that logic was only hit when querying metadata, but it could result in a bug when listing dimensions for a cumulative metric. Instead of restricting derived time granularity, restrict cumulative metrics from being used with date part (this matches existing query behavior). This change required adding a DATE_PART LinkableElementProperty and updating LinkableDimensions accordingly, so that's what you'll see in the snapshot changes.

@cla-bot cla-bot bot added the cla:yes label Sep 20, 2024
…ution

Cumulative metrics CAN be queried with non-default granularity now, so
remove that restriction. This was not an issue in actual queries because
 that logic was only hit when querying metadata, but this old logic
could result in a bug when listing dimensions for a cumulative metric.
Instead, restrict cumulative metrics from being used with date part,
which matches existing query behavior. This required adding a DATE_PART
LinkableElementProperty and updating LinkableDimensions accordingly.
Also updates related date part properties.
This logic is only hit for certain types of metrics (like cumulative and
 derived metrics) so I didn't catch it until adding tests for those
metric types.
@dbt-labs dbt-labs deleted a comment from github-actions bot Sep 20, 2024
@courtneyholcomb courtneyholcomb changed the title Check query tests for custom granularity Support custom granularity in linkable spec resolution Sep 20, 2024
@courtneyholcomb courtneyholcomb marked this pull request as ready for review September 20, 2024 22:20
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.

1 participant