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
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move dataflow_to_sql_converter fixture to main fixture set
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.
tlento committed Nov 2, 2023
commit 91472abeb7036adb4d8f5f614e5601c352ab1e1c
13 changes: 13 additions & 0 deletions metricflow/test/fixtures/sql_fixtures.py
Original file line number Diff line number Diff line change
@@ -2,9 +2,22 @@

import pytest

from metricflow.model.semantic_manifest_lookup import SemanticManifestLookup
from metricflow.plan_conversion.column_resolver import DunderColumnAssociationResolver
from metricflow.plan_conversion.dataflow_to_sql import DataflowToSqlQueryPlanConverter
from metricflow.sql.render.sql_plan_renderer import DefaultSqlQueryPlanRenderer, SqlQueryPlanRenderer


@pytest.fixture
def default_sql_plan_renderer() -> SqlQueryPlanRenderer: # noqa: D
return DefaultSqlQueryPlanRenderer()


@pytest.fixture(scope="session")
def dataflow_to_sql_converter( # noqa: D
simple_semantic_manifest_lookup: SemanticManifestLookup,
) -> DataflowToSqlQueryPlanConverter:
return DataflowToSqlQueryPlanConverter(
column_association_resolver=DunderColumnAssociationResolver(simple_semantic_manifest_lookup),
semantic_manifest_lookup=simple_semantic_manifest_lookup,
)
17 changes: 0 additions & 17 deletions metricflow/test/plan_conversion/conftest.py

This file was deleted.