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 grain in DSI callsites #363

Merged
merged 8 commits into from
Nov 11, 2024
Merged

Conversation

WilliamDee
Copy link
Contributor

Description

Given that custom granularity is available, we need to start supporting it when parsing through names and filters.

Non-breaking changes

  • Removed WhereFilterTimeDimensionFactory as it's not used anywhere (MetricFlow has it's own in metricflow-semantics)
  • Added tests to test parsing of group by's using custom grain and filtering with custom grain

Breaking changes

  • Removed DunderedNameFormatter in favour of StructuredDunderedName as it's duplicate logic
  • Added custom_granularity_names to StructuredDunderedName.parse_name as a parameter to parse out any custom grain
    • Updated callsites for this
  • Changed PydanticWhereFilter.call_parameter_sets and PydanticWhereFilterIntersection.filter_expression_parameter_sets from a property to a method that takes in the valid custom grain names
    • Updated callsites for this

Checklist

Resolves SL-2989

@WilliamDee WilliamDee requested review from QMalcolm, graciegoheen and a team as code owners November 5, 2024 23:15
Copy link

linear bot commented Nov 5, 2024

@cla-bot cla-bot bot added the cla:yes label Nov 5, 2024
@WilliamDee WilliamDee force-pushed the will/support-custom-grain branch from dc47c31 to e20b045 Compare November 5, 2024 23:20
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.

Left a couple comments but otherwise looks good!

Since this is a breaking change, I would wait to merge it until you're ready to bump the version (otherwise can risk someone else doing a patch version bump that includes your change). This should be a minor version bump.
@DevonFulcher also has a breaking change PR up. Maybe you guys can coordinate releasing & updating core. Make sure you guys sync with me before you update core because there are some extra steps you'll need to take.

@WilliamDee WilliamDee force-pushed the will/support-custom-grain branch from 8b3303a to 7c59d74 Compare November 9, 2024 00:28
@WilliamDee WilliamDee merged commit 5083005 into main Nov 11, 2024
22 checks passed
@WilliamDee WilliamDee deleted the will/support-custom-grain branch November 11, 2024 23:19
WilliamDee added a commit to dbt-labs/metricflow that referenced this pull request Dec 5, 2024
## Context

We merged 2 breaking changes in DSI
dbt-labs/dbt-semantic-interfaces#363 and
dbt-labs/dbt-semantic-interfaces#365 which
changed most spec typing that used time granularity to be a `str`
instead of `TimeGranularity` to enable support for custom granularity.
Similarly, there were additional breaking changes to the objects that
requires passing in `custom_granularity_names`. This PR updates all
those callsites to be compatible with the new version of DSI (to be
released)

Resolves SL-3097
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.

2 participants