Skip to content

Commit

Permalink
[dagster-tableau] Mark get_asset_key as deprecated in DagsterTableauT…
Browse files Browse the repository at this point in the history
…ranslator (#26028)

## Summary & Motivation

Mark DagsterTableauTranslator.get_asset_key as deprecated. To be removed
in 1.10.

This PR stack will be merged after #25941 lands, so that
`replace_attributes()` can be called as
`AssetSpec().replace_attributes()`

## Changelog

[dagster-tableau] `DagsterTableauTranslator.get_asset_key` is deprecated
in favor of `DagsterTableauTranslator.get_asset_spec().key`
  • Loading branch information
maximearmstrong authored Nov 25, 2024
1 parent 4ead1d8 commit 6a650ff
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Any, Literal, Mapping, Optional, Sequence

from dagster import _check as check
from dagster._annotations import deprecated
from dagster._core.definitions.asset_key import AssetKey
from dagster._core.definitions.asset_spec import AssetSpec
from dagster._core.definitions.metadata.metadata_set import NamespacedMetadataSet
Expand Down Expand Up @@ -110,6 +111,10 @@ def __init__(self, context: TableauWorkspaceData):
def workspace_data(self) -> TableauWorkspaceData:
return self._context

@deprecated(
breaking_version="1.10",
additional_warn_text="Use `DagsterTableauTranslator.get_asset_spec().key` instead",
)
def get_asset_key(self, data: TableauContentData) -> AssetKey:
return self.get_asset_spec(data).key

Expand All @@ -123,6 +128,7 @@ def get_asset_spec(self, data: TableauContentData) -> AssetSpec:
else:
check.assert_never(data.content_type)

@deprecated(breaking_version="1.10")
def get_sheet_asset_key(self, data: TableauContentData) -> AssetKey:
return self.get_sheet_spec(data).key

Expand Down Expand Up @@ -160,6 +166,7 @@ def get_sheet_spec(self, data: TableauContentData) -> AssetSpec:
},
)

@deprecated(breaking_version="1.10")
def get_dashboard_asset_key(self, data: TableauContentData) -> AssetKey:
return self.get_dashboard_spec(data).key

Expand Down Expand Up @@ -193,6 +200,7 @@ def get_dashboard_spec(self, data: TableauContentData) -> AssetSpec:
},
)

@deprecated(breaking_version="1.10")
def get_data_source_asset_key(self, data: TableauContentData) -> AssetKey:
return self.get_data_source_spec(data).key

Expand Down

0 comments on commit 6a650ff

Please sign in to comment.