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

Remove generic source dataset constructs #768

Merged
merged 3 commits into from
Sep 8, 2023

Conversation

tlento
Copy link
Contributor

@tlento tlento commented Sep 7, 2023

The original implementation of MetricFlow used a generic type
annotation for the "Source DataSet" of the dataflow plan. This was
in place to support some specific implementations of Transform's
proprietary product logic, and as an interface boundary it proved
ineffective. Consequently, attempts to revisit that functionality
will rely on other approaches.

Within MetricFlow, this generic type resolves, to one of two concrete types:
the SqlDataSet, or the SemanticModelDataSet, which inherits from
SqlDataSet. Since it's far simpler to just use SqlDataSet as the
required type than to litter the codebase with generic typehints and
concrete type specs in some places but not others, we make that change
along with some associated cleanup. In particular, the SqlDataSet class
rightly belongs with the other DataSet subclasses, rather than in the
plan_conversion package.

The original implementation of MetricFlow used a generic type
annotation for the "Source DataSet" of the dataflow plan. This was
in place to support some specific implementations of Transform's
proprietary product logic, and as an interface boundary it proved
ineffective. Consequently, attempts to revisit that functionality
will rely on other approaches.

Within MetricFlow, this generic type resolves, to one of two concrete types:
the SqlDataSet, or the SemanticModelDataSet, which inherits from
SqlDataSet. Since it's far simpler to just use SqlDataSet as the
required type than to litter the codebase with generic typehints and
concrete type specs in some places but not others, we make that change here.

Sadly, this must all be done in one massive commit, because there's no way
to get the typechecker to pass by removing this one stage at a time without
doing considerably more restructuring around the data set handoffs.

This commit was produced via a mixture of mechanical find/replace
approaches within VSCode, along with file-by-file manual fixups for
cases where leftovers were causing trouble.
In cleaning up our dataset module organization I noticed this
helper class was not used anywhere. This removes it.
The other DataSet classes are all in one place, and this is no
longer strictly a plan_conversion artifact (indeed, it never
was, it just looked that way due to the generics).
@cla-bot cla-bot bot added the cla:yes label Sep 7, 2023
Copy link
Contributor Author

tlento commented Sep 7, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

@tlento tlento merged commit 87ee477 into main Sep 8, 2023
@tlento tlento deleted the remove-generic-dataset-constructs branch September 8, 2023 20:27
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