Skip to content

Commit

Permalink
[dagster-fivetran] Mark Fivetran legacy code as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
maximearmstrong committed Nov 22, 2024
1 parent b417e4e commit 907a680
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -251,6 +251,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],
Expand Down Expand Up @@ -612,6 +615,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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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."""

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 907a680

Please sign in to comment.