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

Move snapshot files to enumerated paths #613

Merged
merged 1 commit into from
Jun 22, 2023

Conversation

tlento
Copy link
Contributor

@tlento tlento commented Jun 21, 2023

MetricFlow has sets of query planning and dialect rendering tests
that compare against snapshot files representing plans and SQL
queries. For dialect-specific constructs, we rely on a dialect-
specific snapshot file. For historical reasons, these were stored
in a path location bound to the SqlClient class used in the tests.

Now that we are moving to a model where we delegate this work to
dbt adapters, we will be re-using the same SqlClient class for
multiple dialects. More generally, we'd like to separate our
warehouse client from our dialect operations. So this commit
moves the relevant files to a path based on the target engine
property of the SqlClient interface. Since our dialects currently
map on to supported engines 1:1, we can do this for now, and
eventually convert to dialect-only differentiation in the future.

Note - this was done via file moves in the IDE, which seem to
be the equivalent of git mv under the hood.

MetricFlow has sets of query planning and dialect rendering tests
that compare against snapshot files representing plans and SQL
queries. For dialect-specific constructs, we rely on a dialect-
specific snapshot file. For historical reasons, these were stored
in a path location bound to the SqlClient class used in the tests.

Now that we are moving to a model where we delegate this work to
dbt adapters, we will be re-using the same SqlClient class for
multiple dialects. More generally, we'd like to separate our
warehouse client from our dialect operations. So this commit
moves the relevant files to a path based on the target engine
property of the SqlClient interface. Since our dialects currently
map on to supported engines 1:1, we can do this for now, and
eventually convert to dialect-only differentiation in the future.
@cla-bot cla-bot bot added the cla:yes label Jun 21, 2023
Copy link
Contributor Author

tlento commented Jun 21, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@github-actions
Copy link

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 temporarily deployed to DW_INTEGRATION_TESTS June 21, 2023 20:51 — with GitHub Actions Inactive
@tlento tlento temporarily deployed to DW_INTEGRATION_TESTS June 21, 2023 20:51 — with GitHub Actions Inactive
@tlento tlento temporarily deployed to DW_INTEGRATION_TESTS June 21, 2023 20:51 — with GitHub Actions Inactive
@tlento tlento temporarily deployed to DW_INTEGRATION_TESTS June 21, 2023 20:51 — with GitHub Actions Inactive
@tlento tlento temporarily deployed to DW_INTEGRATION_TESTS June 21, 2023 20:51 — with GitHub Actions Inactive
@tlento tlento marked this pull request as ready for review June 21, 2023 20:53
@tlento
Copy link
Contributor Author

tlento commented Jun 21, 2023

DuckDB and Postgres passed locally, running other warehouse tests in CI, will fix up anything that goes awry.

@tlento tlento merged commit 834d82a into main Jun 22, 2023
@tlento tlento deleted the move-snapshots-to-engine-type-paths branch June 22, 2023 21:54
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