Skip to content

Commit

Permalink
Move historical objects to fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
JCZuurmond committed Oct 21, 2024
1 parent aa408b9 commit e07c36c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tests/integration/queries/test_migration_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,7 @@ def policies():


@pytest.fixture
def schema_populated(
ws: WorkspaceClient,
sql_backend: SqlBackend,
make_catalog,
make_schema,
def historical_objects(
tables,
table_migration_statuses,
udfs,
Expand All @@ -200,6 +196,13 @@ def schema_populated(
clusters,
pipelines,
policies,
):
return tables + table_migration_statuses + udfs + grants + jobs + clusters + pipelines + policies


@pytest.fixture
def schema_populated(
ws: WorkspaceClient, sql_backend: SqlBackend, make_catalog, make_schema, historical_objects
) -> SchemaInfo:
"""Populate the historical schema given the objects from the fixtures.
Expand All @@ -210,8 +213,7 @@ def schema_populated(
schema = make_schema(catalog_name=catalog.name)
workspace_id = ws.get_workspace_id()
historicals = []
objects = tables + table_migration_statuses + udfs + grants + jobs + clusters + pipelines + policies
for table_name, id_, instance, failures, owner in objects:
for table_name, id_, instance, failures, owner in historical_objects:
# TODO: Use historical encoder from https://github.com/databrickslabs/ucx/pull/2743/
data = {
field.name: str(getattr(instance, field.name))
Expand Down

0 comments on commit e07c36c

Please sign in to comment.