-
Notifications
You must be signed in to change notification settings - Fork 14
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
base: main
Are you sure you want to change the base?
Conversation
…WhereFilterIntersection.filter_expression_parameter_sets from property to a method that takes in the valid custom grain names
…nticWhereFilterIntersection.filter_expression_parameter_sets
dc47c31
to
e20b045
Compare
There was a problem hiding this 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.
@@ -91,52 +91,3 @@ def entity_prefix(self) -> Optional[str]: | |||
return DUNDER.join(tuple(entity_reference.element_name for entity_reference in self.entity_links)) | |||
|
|||
return None | |||
|
|||
|
|||
class DunderedNameFormatter: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming you checked that this isn't used in any dependent repos?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for all the other deleted objects!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup! now i'm paranoid, gonna make another pass to see
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so DunderedNameFormatter
is used in MF, but I thought it should be fine since this is release a minor version upgrade, which shouldn't be picked up by MF right away right? And when I upgrade, i'll update those in MF
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good! I would double check that metricflow-semantics
won't pick it up (it's not always pinned to a patch version)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait ignore me you're right. Minor is not the same is patch. Sorry my brain is busted rn 🙃
@@ -49,6 +49,7 @@ def create_time_dimension( | |||
time_granularity_name: Optional[str] = None, | |||
entity_path: Sequence[str] = (), | |||
date_part_name: Optional[str] = None, | |||
custom_granularity_names: Sequence[str] = (), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this not be optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
felt better for this to be default to a sequence, so we don't need to handle this at the bottom where we do
StructuredDunderedName.parse_name(
name=time_dimension_name, custom_granularity_names=custom_granularity_names or ()
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I guess I just want to make sure people don't skip it without realizing that it's necessary. Like sometimes I like to leave params like this as required so that people are forced to actively pass in the empty value and hopefully in the process they check out what it's used for and make sure they're doing the right thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooo yea, ill drop the default
Description
Given that custom granularity is available, we need to start supporting it when parsing through names and filters.
Non-breaking changes
WhereFilterTimeDimensionFactory
as it's not used anywhere (MetricFlow has it's own in metricflow-semantics)Breaking changes
DunderedNameFormatter
in favour ofStructuredDunderedName
as it's duplicate logiccustom_granularity_names
toStructuredDunderedName.parse_name
as a parameter to parse out any custom grainPydanticWhereFilter.call_parameter_sets
andPydanticWhereFilterIntersection.filter_expression_parameter_sets
from a property to a method that takes in the valid custom grain namesChecklist
changie new
to create a changelog entryResolves SL-2989