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

Split up test_dataflow_to_sql_plan module into more manageable components #836

Merged
merged 4 commits into from
Nov 3, 2023

Conversation

tlento
Copy link
Contributor

@tlento tlento commented Nov 2, 2023

This is step 1 of the grand effort to break up test_dataflow_to_sql_plan.
Here we move the grab bag of query rendering tests exercising basic
conversion from metric queries to rendered SQL. This naturally follows
some smaller changes which ensure the tests still function correctly.

Subsequent changes will move more focused testing areas, such as
cumulative metrics, derived metrics, and granularity/date part
adjustments, to their own modules.

The test_dataflow_to_sql_plan module has become a dumping
ground for a mixture of direct tests of DataflowPlan to
SqlQueryPlan object conversion and tests which are more about
query rendering for a variety of metric queries.

In preparation for splitting the latter class of tests into
their own location, we consolidate the former class into
a single block at the top of the module for ease of review.
The dataflow_to_sql_converter fixture was scoped to the package
containing the plan_conversion tests, but it's useful anywhere
we need an initialized DataflowToSqlQueryPlanConverter built on
our most common simple semantic manifest.

Since we're splitting up the plan_conversion tests into plan conversion
and query rendering, it makes sense to hoist this out to where we
define our more broadly available fixtures.
The snapshot generator script had a typo in it preventing any
non-duckdb engine from executing. It also shifted to a mark based
filter which excluded all engine-agnostic snapshots from regeneration.

Since we can rapidly execute those tests without needing an external
connection this simply runs a broader set of tests in duckdb, and
relies on the mark for our other engine tests.
This is step 1 of the grand effort to break up test_dataflow_to_sql_plan.
Here we move the grab bag of query rendering tests exercising basic
conversion from metric queries to rendered SQL.

Subsequent changes will move more focused testing areas, such as
cumulative metrics, derived metrics, and granularity/date part
adjustments, to their own modules.
@cla-bot cla-bot bot added the cla:yes label Nov 2, 2023
Copy link

github-actions bot commented Nov 2, 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 marked this pull request as ready for review November 3, 2023 00:29
@tlento tlento added the Run Tests With Other SQL Engines Runs the test suite against the SQL engines in our target environment label Nov 3, 2023
@tlento tlento temporarily deployed to DW_INTEGRATION_TESTS November 3, 2023 00:29 — with GitHub Actions Inactive
@tlento tlento requested a review from plypaul November 3, 2023 00:29
@tlento tlento temporarily deployed to DW_INTEGRATION_TESTS November 3, 2023 00:29 — with GitHub Actions Inactive
@tlento tlento temporarily deployed to DW_INTEGRATION_TESTS November 3, 2023 00:29 — with GitHub Actions Inactive
@tlento tlento temporarily deployed to DW_INTEGRATION_TESTS November 3, 2023 00:29 — with GitHub Actions Inactive
@github-actions github-actions bot removed the Run Tests With Other SQL Engines Runs the test suite against the SQL engines in our target environment label Nov 3, 2023
Copy link
Contributor

@courtneyholcomb courtneyholcomb left a comment

Choose a reason for hiding this comment

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

LGTM!

@tlento tlento merged commit 6f6de91 into main Nov 3, 2023
46 of 48 checks passed
@tlento tlento deleted the split-up-test-dataflow-to-sql branch November 3, 2023 00:52
@tlento
Copy link
Contributor Author

tlento commented Nov 3, 2023

Quick note - the convert_and_check helper added here removes all of the SqlQueryPlan output because it isn't terribly useful for these more complex rendered queries, and fewer generated files seemed better.

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