From e734e4a84631f67235e0cf180b43a32bb4e17549 Mon Sep 17 00:00:00 2001 From: Maxime Armstrong Date: Tue, 19 Nov 2024 13:12:29 -0500 Subject: [PATCH] [dagster-fivetran] Mark Fivetran legacy code as deprecated --- .../dagster-fivetran/dagster_fivetran/asset_defs.py | 9 ++++++++- .../dagster-fivetran/dagster_fivetran/resources.py | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/python_modules/libraries/dagster-fivetran/dagster_fivetran/asset_defs.py b/python_modules/libraries/dagster-fivetran/dagster_fivetran/asset_defs.py index b3963d5c56c10..e3b5878dcab11 100644 --- a/python_modules/libraries/dagster-fivetran/dagster_fivetran/asset_defs.py +++ b/python_modules/libraries/dagster-fivetran/dagster_fivetran/asset_defs.py @@ -26,7 +26,7 @@ _check as check, multi_asset, ) -from dagster._annotations import experimental +from dagster._annotations import deprecated, experimental from dagster._core.definitions.asset_spec import AssetSpec from dagster._core.definitions.cacheable_assets import ( AssetsDefinitionCacheableData, @@ -256,6 +256,9 @@ def _assets(context: OpExecutionContext, fivetran: FivetranResource) -> Any: return [_assets] +@deprecated( + breaking_version="2.0", additional_warn_text="Use the `fivetran_assets` decorator instead" +) def build_fivetran_assets( connector_id: str, destination_tables: Sequence[str], @@ -617,6 +620,10 @@ def _clean_name(name: str) -> str: return re.sub(r"[^a-z0-9]+", "_", name.lower()) +@deprecated( + breaking_version="2.0", + additional_warn_text="Use the `build_fivetran_assets_definitions` factory instead", +) def load_assets_from_fivetran_instance( fivetran: Union[FivetranResource, ResourceDefinition], key_prefix: Optional[CoercibleToAssetKeyPrefix] = None, diff --git a/python_modules/libraries/dagster-fivetran/dagster_fivetran/resources.py b/python_modules/libraries/dagster-fivetran/dagster_fivetran/resources.py index a839867296fa8..549d552601857 100644 --- a/python_modules/libraries/dagster-fivetran/dagster_fivetran/resources.py +++ b/python_modules/libraries/dagster-fivetran/dagster_fivetran/resources.py @@ -23,7 +23,7 @@ get_dagster_logger, resource, ) -from dagster._annotations import experimental +from dagster._annotations import deprecated, experimental from dagster._config.pythonic_config import ConfigurableResource from dagster._core.definitions.asset_spec import AssetSpec from dagster._core.definitions.definitions_load_context import StateBackedDefinitionsLoader @@ -72,6 +72,7 @@ FIVETRAN_RECONSTRUCTION_METADATA_KEY_PREFIX = "dagster-fivetran/reconstruction_metadata" +@deprecated(breaking_version="2.0", additional_warn_text="Use `FivetranWorkspace` instead") class FivetranResource(ConfigurableResource): """This class exposes methods on top of the Fivetran REST API.""" @@ -438,6 +439,7 @@ def get_destination_details(self, destination_id: str) -> Mapping[str, Any]: return self.make_request("GET", f"destinations/{destination_id}") +@deprecated(breaking_version="2.0", additional_warn_text="Use `FivetranWorkspace` instead") @dagster_maintained_resource @resource(config_schema=FivetranResource.to_config_schema()) def fivetran_resource(context: InitResourceContext) -> FivetranResource: