From ef04d8427ccf92f412347549548e1d995b02a04e Mon Sep 17 00:00:00 2001 From: Maxime Armstrong Date: Thu, 2 Jan 2025 14:49:42 -0500 Subject: [PATCH] Update post review --- .../dashboard/definitions.py | 1 + .../dagster_powerbi_tests/test_asset_specs.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/examples/project_atproto_dashboard/project_atproto_dashboard/dashboard/definitions.py b/examples/project_atproto_dashboard/project_atproto_dashboard/dashboard/definitions.py index 06063f4a7a212..e5414bee55a1e 100644 --- a/examples/project_atproto_dashboard/project_atproto_dashboard/dashboard/definitions.py +++ b/examples/project_atproto_dashboard/project_atproto_dashboard/dashboard/definitions.py @@ -44,5 +44,6 @@ def get_semantic_model_spec(self, data: PowerBIContentData) -> dg.AssetSpec: power_bi_specs = load_powerbi_asset_specs( power_bi_workspace, dagster_powerbi_translator=CustomDagsterPowerBITranslator, +) defs = dg.Definitions(assets=[*power_bi_specs], resources={"power_bi": power_bi_workspace}) diff --git a/python_modules/libraries/dagster-powerbi/dagster_powerbi_tests/test_asset_specs.py b/python_modules/libraries/dagster-powerbi/dagster_powerbi_tests/test_asset_specs.py index 5f5547184a1b1..eb3060d95c3a3 100644 --- a/python_modules/libraries/dagster-powerbi/dagster_powerbi_tests/test_asset_specs.py +++ b/python_modules/libraries/dagster-powerbi/dagster_powerbi_tests/test_asset_specs.py @@ -119,11 +119,15 @@ def test_translator_custom_metadata_legacy( credentials=PowerBIToken(api_token=fake_token), workspace_id=workspace_id, ) - all_asset_specs = load_powerbi_asset_specs( - workspace=resource, - dagster_powerbi_translator=MyCustomTranslator, - use_workspace_scan=False, - ) + with pytest.warns( + DeprecationWarning, + match=r"Support of `dagster_powerbi_translator` as a Type\[DagsterPowerBITranslator\]", + ): + all_asset_specs = load_powerbi_asset_specs( + workspace=resource, + dagster_powerbi_translator=MyCustomTranslator, + use_workspace_scan=False, + ) asset_spec = next(spec for spec in all_asset_specs) assert "custom" in asset_spec.metadata