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

Follow-Ups From Ambiguous Group-By-Item Resolution Stack #946

Merged
merged 11 commits into from
Dec 21, 2023

Conversation

plypaul
Copy link
Contributor

@plypaul plypaul commented Dec 19, 2023

Description

This PR addresses some of the feedback in the PR stack for ambiguous group-by-item resolution and includes some re-organization of the associated code (e.g. renames / additional context fields). Please view by commit.

@cla-bot cla-bot bot added the cla:yes label Dec 19, 2023
@plypaul plypaul marked this pull request as ready for review December 19, 2023 19:38
Copy link
Contributor

@tlento tlento left a comment

Choose a reason for hiding this comment

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

Small things inline but this seems ok.

@@ -31,12 +31,12 @@
QueryGroupByItemResolutionNode,
)
from metricflow.query.group_by_item.resolution_path import MetricFlowQueryResolutionPath
from metricflow.query.issues.group_by_item_resolver.invalid_use_of_date_part import MetricExcludesDatePartIssue
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, that's much better, thanks.

) or any(spec_resolution.issue_set.has_errors for spec_resolution in self.spec_resolutions)

@property
def has_issues(self) -> bool: # noqa: D
Copy link
Contributor

Choose a reason for hiding this comment

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

Some of these things have issues.....

Sorry, it's almost vacation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To clarify, you have a name proposal?

issue_set=MetricFlowQueryResolutionIssueSet.empty_instance(),
if any(resolution.issue_set.has_errors for resolution in resolutions) or len(non_parsable_resolutions) > 0:
return FilterSpecResolutionLookUp(
spec_resolutions=tuple(resolution for resolution in resolutions if resolution.issue_set.has_errors),
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, this is filtering to only the ones with errors now. I assume that is to remove "good" resolutions from the output, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I removed the good ones since it made the snapshots smaller and if there are any errors, we wouldn't proceed with the query anyway.

Comment on lines 100 to 114
dimension_call_parameter_sets: List[DimensionCallParameterSet] = []
time_dimension_call_parameter_sets: List[TimeDimensionCallParameterSet] = []
entity_call_parameter_sets: List[EntityCallParameterSet] = []

# FilterCallParameterSets needs an update.
for filter_call_parameter_sets in filter_call_parameter_sets_sequence:
for dimension_call_parameter_set in filter_call_parameter_sets.dimension_call_parameter_sets:
if dimension_call_parameter_set not in dimension_call_parameter_sets:
dimension_call_parameter_sets.append(dimension_call_parameter_set)
for time_dimension_call_parameter_set in filter_call_parameter_sets.time_dimension_call_parameter_sets:
if time_dimension_call_parameter_set not in time_dimension_call_parameter_sets:
time_dimension_call_parameter_sets.append(time_dimension_call_parameter_set)
for entity_call_parameter_set in filter_call_parameter_sets.entity_call_parameter_sets:
if entity_call_parameter_set not in entity_call_parameter_sets:
entity_call_parameter_sets.append(entity_call_parameter_set)
Copy link
Contributor

Choose a reason for hiding this comment

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

As long as the call parameter sets remain human scale input I guess it's ok, but the advantage of the previous dict-based approach is we don't need to do this separate n^2 deduplication process.

From a readability and "there's a hidden explosive in my codebase" perspective the dict approach is probably preferable as well - these are private methods and we have no use cases for allowing duplicates 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.

I changed to this to track down a testing consistency issue, so partially changed it back. This will get rewritten with the change to FilterCallParameterSets.

Copy link
Contributor

@tlento tlento left a comment

Choose a reason for hiding this comment

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

Small things inline but this seems ok.

@plypaul plypaul force-pushed the plypaul--70--agbir-follow-up branch from fe9fa04 to 06f2b0f Compare December 21, 2023 06:17
@plypaul plypaul force-pushed the plypaul--70--agbir-follow-up branch from 06f2b0f to 54a9d04 Compare December 21, 2023 06:23
@plypaul plypaul merged commit b4ae235 into main Dec 21, 2023
9 checks passed
@plypaul plypaul deleted the plypaul--70--agbir-follow-up branch December 21, 2023 06:36
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