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

Validate granularity names in saved query where filters #359

Merged
merged 7 commits into from
Nov 4, 2024

Conversation

theyostalservice
Copy link
Contributor

@theyostalservice theyostalservice commented Oct 24, 2024

Resolves #360

Description

Validate time spines in saved query where filters

Validations for time spines in WHERE filters in Saved Queries.

This mimics the where filter time spine validation for metrics and applies it to saved queries.

This also bumps the version. (I assume this is necessary?)

Checklist

Validations for time spines in WHERE filters in
Saved Queries.

This mimics the where filter time spine validation for
metrics and applies it to saved queries.

This also bumps the version.  (I assume this is
necessary?)
Copy link

cla-bot bot commented Oct 24, 2024

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR.

CLA has not been signed by users: @theyostalservice

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @theyostalservice and the rest of your teammates on Graphite Graphite

Copy link

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

@cla-bot cla-bot bot added the cla:yes label Oct 24, 2024
@theyostalservice theyostalservice marked this pull request as ready for review October 24, 2024 01:05
.changes/unreleased/Under the Hood-20241023-180425.yaml Outdated Show resolved Hide resolved
dbt_semantic_interfaces/validations/saved_query.py Outdated Show resolved Hide resolved
dbt_semantic_interfaces/validations/saved_query.py Outdated Show resolved Hide resolved
dbt_semantic_interfaces/validations/saved_query.py Outdated Show resolved Hide resolved
dbt_semantic_interfaces/validations/saved_query.py Outdated Show resolved Hide resolved
tests/validations/test_saved_query.py Outdated Show resolved Hide resolved
@theyostalservice theyostalservice changed the title Validate time spines in saved query where filters Validate granularities in saved query where filters Oct 24, 2024
@theyostalservice theyostalservice changed the title Validate granularities in saved query where filters Validate granularity names in saved query where filters Oct 27, 2024
This is not *exactly* what was described in Courtney's comments, but I
think there was a little roughness in that plan once I began implementing
(but I'm happy to change course if reviewers disagree!).

This commit promotes the `WhereFiltersAreParseable` to be
`WhereFiltersAreParseableRule` (a free-standing 'rule' in a separate
file).  It was weird to be passing things in from other classes but
somehow centralizing the manifest, so instead, I just moved ALL of
the relevant checks here.

This moves the tests for where filters to a new file specifically
for this rule (again, I'm open to the idea that this would be better
just divided amongst the existing tests, but they share so much
conceptually that it seems nice to group them together and to have
a test that is pointed 1:1 at a rule where possible).

Finally, I also moved some of the test support functions
(`check_only_one_error_with_message`, for example) to
`dbt_semantic_interfaces.test_utils` because they seem useful and
reusable.
@theyostalservice
Copy link
Contributor Author

For visibility - I wanted to make sure the explanation of where I expanded on the feedback from @courtneyholcomb was visible and explain the reasoning, so I'm copying the commit message from the latest update to a comment:

Centralize Where filter validation + comments

This is not exactly what was described in Courtney's comments, but I
think there was a little roughness in that plan once I began implementing
(but I'm happy to change course if reviewers disagree!).

This commit promotes the WhereFiltersAreParseable to be
WhereFiltersAreParseableRule (a free-standing 'rule' in a separate
file). It was weird to be passing things in from other classes but
somehow centralizing the manifest, so instead, I just moved ALL of
the relevant checks here.

This moves the tests for where filters to a new file specifically
for this rule (again, I'm open to the idea that this would be better
just divided amongst the existing tests, but they share so much
conceptually that it seems nice to group them together and to have
a test that is pointed 1:1 at a rule where possible).

Finally, I also moved some of the test support functions
(check_only_one_error_with_message, for example) to
dbt_semantic_interfaces.test_utils because they seem useful and
reusable.

Copy link
Contributor

@courtneyholcomb courtneyholcomb left a comment

Choose a reason for hiding this comment

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

Looks great thank you!!

@theyostalservice theyostalservice merged commit f12f91c into main Nov 4, 2024
19 checks passed
@theyostalservice theyostalservice deleted the validate_saved_query_timespines branch November 4, 2024 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add validation for time spine names in where filters of saved queries
2 participants