From 6cf70a04f08aacd6d837584033a0f50895df3ea8 Mon Sep 17 00:00:00 2001 From: Maxime Armstrong Date: Wed, 27 Nov 2024 13:31:48 -0500 Subject: [PATCH] Fix tests --- .../dagster_fivetran_tests/experimental/test_asset_specs.py | 5 ++--- .../dagster_fivetran_tests/experimental/test_translator.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_asset_specs.py b/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_asset_specs.py index 9c1975b7ce6d2..1b1d6c2f0bf1d 100644 --- a/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_asset_specs.py +++ b/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_asset_specs.py @@ -1,6 +1,6 @@ import responses from dagster._config.field_utils import EnvVar -from dagster._core.definitions.asset_spec import AssetSpec, replace_attributes +from dagster._core.definitions.asset_spec import AssetSpec from dagster._core.test_utils import environ from dagster_fivetran import ( DagsterFivetranTranslator, @@ -123,8 +123,7 @@ def test_cached_load_spec_with_asset_factory( class MyCustomTranslator(DagsterFivetranTranslator): def get_asset_spec(self, data: FivetranConnectorTableProps) -> AssetSpec: default_spec = super().get_asset_spec(data) - return replace_attributes( - default_spec, + return default_spec.replace_attributes( key=default_spec.key.with_prefix("prefix"), metadata={**default_spec.metadata, "custom": "metadata"}, ) diff --git a/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_translator.py b/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_translator.py index 17b9c1804d25f..22a2452526d45 100644 --- a/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_translator.py +++ b/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_translator.py @@ -2,7 +2,7 @@ import responses from dagster._config.field_utils import EnvVar -from dagster._core.definitions.asset_spec import AssetSpec, replace_attributes +from dagster._core.definitions.asset_spec import AssetSpec from dagster._core.test_utils import environ from dagster_fivetran import ( DagsterFivetranTranslator, @@ -36,8 +36,7 @@ def test_fivetran_workspace_data_to_fivetran_connector_table_props_data( class MyCustomTranslator(DagsterFivetranTranslator): def get_asset_spec(self, props: FivetranConnectorTableProps) -> AssetSpec: default_spec = super().get_asset_spec(props) - return replace_attributes( - default_spec, + return default_spec.replace_attributes( key=default_spec.key.with_prefix("prefix"), metadata={**default_spec.metadata, "custom": "metadata"}, )