Skip to content

Commit

Permalink
fixup! WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed Dec 9, 2024
1 parent 064f346 commit cf3b66d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion metricflow/dataflow/builder/dataflow_plan_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1930,7 +1930,6 @@ def _build_time_spine_node(
time_spine_node = JoinToCustomGranularityNode.create(
parent_node=time_spine_node, time_dimension_spec=custom_spec
)
# TODO: need TransformTimeDimensionsNode in either of the above paths?
else:
# TODO: support multiple time spines here. Build node on the one with the smallest base grain.
# Then, pass custom_granularity_specs into _build_pre_aggregation_plan if they aren't satisfied by smallest time spine.
Expand Down
12 changes: 6 additions & 6 deletions metricflow/plan_conversion/dataflow_to_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -1209,9 +1209,9 @@ def visit_metric_time_dimension_transform_node(self, node: MetricTimeDimensionTr
spec=metric_time_dimension_spec,
)
)
output_column_to_input_column[
metric_time_dimension_column_association.column_name
] = matching_time_dimension_instance.associated_column.column_name
output_column_to_input_column[metric_time_dimension_column_association.column_name] = (
matching_time_dimension_instance.associated_column.column_name
)

output_instance_set = InstanceSet(
measure_instances=tuple(output_measure_instances),
Expand Down Expand Up @@ -1965,7 +1965,7 @@ def visit_cutom_granularity_bounds_node( # noqa: D102
) # will be node.time_granularity

# Build new columns & instances that calculate the start and end of the custom grain.
window_instance = from_data_set.instance_from_time_dimension_grain_and_date_part(
parent_window_instance = from_data_set.instance_from_time_dimension_grain_and_date_part(
time_granularity=window_grain, date_part=None
)
window_column_expr = SqlColumnReferenceExpression.from_table_and_column_names(
Expand All @@ -1985,8 +1985,8 @@ def visit_cutom_granularity_bounds_node( # noqa: D102
new_instances: Tuple[TimeDimensionInstance, ...] = ()
new_select_columns: Tuple[SqlSelectColumn, ...] = ()
for agg_state, func_args in agg_state_to_func_args.items():
new_instance = window_instance.with_new_spec(
new_spec=window_instance.spec.with_aggregation_state(agg_state),
new_instance = parent_window_instance.with_new_spec(
new_spec=parent_window_instance.spec.with_aggregation_state(agg_state),
column_association_resolver=self._column_association_resolver,
)
new_instances += (new_instance,)
Expand Down

0 comments on commit cf3b66d

Please sign in to comment.