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

Add validations for time spines #344

Merged
merged 7 commits into from
Sep 26, 2024
Merged

Conversation

courtneyholcomb
Copy link
Contributor

@courtneyholcomb courtneyholcomb commented Sep 4, 2024

Description

Validations for time spines.

  • Enforce basic naming restrictions
  • Ensure uniqueness across dimensions, entities, measures, metrics, semantic models, other custom granularities, and standard granularities
  • Ensure time granularity options in where filters are valid

Also bumps to a new production version. This new version of DSI will need to be released to mantle before custom calendar is released as a feature.

Checklist

@cla-bot cla-bot bot added the cla:yes label Sep 4, 2024
@courtneyholcomb courtneyholcomb changed the title Add parsed_column_name property to PydanticTimeSpineCustomGranularity… Add validations for time spines Sep 5, 2024
@dbt-labs dbt-labs deleted a comment from github-actions bot Sep 5, 2024
@courtneyholcomb courtneyholcomb force-pushed the court/custom-cal-validations branch from 783f1e3 to f4fcf3e Compare September 25, 2024 20:06
@courtneyholcomb courtneyholcomb force-pushed the court/custom-cal-validations branch from f4fcf3e to e6e1eb8 Compare September 25, 2024 20:06
@courtneyholcomb courtneyholcomb force-pushed the court/custom-cal-validations branch from e6e1eb8 to bf14e8a Compare September 25, 2024 20:11
@courtneyholcomb courtneyholcomb force-pushed the court/custom-cal-validations branch from 514bd38 to 71754db Compare September 26, 2024 21:01
@courtneyholcomb courtneyholcomb marked this pull request as ready for review September 26, 2024 21:46
primary_column=PydanticTimeSpinePrimaryColumn(name="ds", time_granularity=TimeGranularity.DAY),
custom_granularities=[
PydanticTimeSpineCustomGranularityColumn(name="retail_year"),
PydanticTimeSpineCustomGranularityColumn(name="quarter"), # todo
Copy link
Contributor

Choose a reason for hiding this comment

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

Is something blocking this validation? Seems like its not in this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

whoops I just forgot to remove the comment! It is validated here!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's the "names cannot match reserved time granularity keywords" one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed it!

Copy link
Contributor

Choose a reason for hiding this comment

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

ooo didn't realize it was already in the code inside check_valid_name and that was done prior to this PR

@courtneyholcomb courtneyholcomb merged commit b81abec into main Sep 26, 2024
22 checks passed
@courtneyholcomb courtneyholcomb deleted the court/custom-cal-validations branch September 26, 2024 22:03
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