Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dagster-tableau] Mark get_asset_key as deprecated in DagsterTableauTranslator #26028

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we alter the implementation to just return get_asset_spec(...).key?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 7c1d54d in #26027 to respect the purpose of this PR

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