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

Organize DataflowPlanBuilder Recursive Case Handling #874

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

plypaul
Copy link
Contributor

@plypaul plypaul commented Nov 15, 2023

Description

This PR separates the recursive handling of derived metrics into cases
using different methods that are shorter / easier to understand:

  • Build a node to compute a simple / base metric.
  • Build a node to compute a derived metric.
  • Build a node to compute a metric of any type.
  • Build a node to compute many metrics.

In addition, this also moves MetricLookUp.measures_for_metric() into the
DataflowPlanBuilder because it seemed a little out of place in MetricLookUp
due to the dependence on the column association resolver.

This is mostly a shuffling of the code w/o logic changes.

@cla-bot cla-bot bot added the cla:yes label Nov 15, 2023
@plypaul plypaul requested review from tlento and WilliamDee November 15, 2023 05:58
@plypaul plypaul marked this pull request as ready for review November 15, 2023 06:04
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.

Seems reasonable!

@@ -123,35 +121,6 @@ def configured_input_measure_for_metric(self, metric_reference: MetricReference)
else:
assert_values_exhausted(metric.type)

def measures_for_metric(
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh yeah I think this was used somewhere else, and isn't anymore. Agree it makes more sense in the one place it's used, although making the DataflowPlanBuilder longer is a bit of a bummer.

@plypaul plypaul force-pushed the plypaul--58.3--assorted-spec-changes branch from a2f779b to 6331dbb Compare November 16, 2023 04:04
Base automatically changed from plypaul--58.3--assorted-spec-changes to main November 16, 2023 04:18
…ookUp.measures_for_metric().

This more cleanly separates the recursive handling of derived metrics into
cases:

* Build a node to compute a simple / base metric.
* Build a node to compute a derived metric.
* Build a node to compute a metric of any type.
* Build a node to compute many metrics.

In addition, this also moves MetricLookUp.measures_for_metric() into the
DataflowPlanBuilder because it seemed a little out of place in MetricLookUp
due to the dependence on the column association resolver.
@plypaul plypaul force-pushed the plypaul--58.4--refactor-dfpb branch from 0361b0e to 4c6ecb8 Compare November 16, 2023 04:21
@plypaul plypaul merged commit 92fb771 into main Nov 16, 2023
8 checks passed
@plypaul plypaul deleted the plypaul--58.4--refactor-dfpb branch November 16, 2023 04:33
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