Skip to content

Commit

Permalink
[dagster-looker] Mark asset key methods as deprecated in DagsterLooke…
Browse files Browse the repository at this point in the history
…rApiTranslator (#26049)

## Summary & Motivation

Like #26028 but for Looker API

## Changelog

[dagster-looker] `DagsterLookerApiTranslator.get_asset_key` is
deprecated in favor of `DagsterLookerApiTranslator.get_asset_spec().key`
  • Loading branch information
maximearmstrong authored Nov 25, 2024
1 parent 8048220 commit 39610e2
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
AssetSpec,
_check as check,
)
from dagster._annotations import public
from dagster._annotations import deprecated, public
from dagster._core.definitions.metadata.metadata_value import MetadataValue
from dagster._record import record
from dagster._utils.log import get_dagster_logger
Expand Down Expand Up @@ -115,6 +115,10 @@ def __init__(self, looker_instance_data: Optional[LookerInstanceData]):
def instance_data(self) -> Optional[LookerInstanceData]:
return self._looker_instance_data

@deprecated(
breaking_version="1.10",
additional_warn_text="Use `DagsterLookerApiTranslator.get_asset_spec().key` instead",
)
def get_view_asset_key(self, looker_structure: LookerStructureData) -> AssetKey:
return self.get_view_asset_spec(looker_structure).key

Expand All @@ -124,6 +128,10 @@ def get_view_asset_spec(self, looker_structure: LookerStructureData) -> AssetSpe
key=AssetKey(["view", lookml_view.view_name]),
)

@deprecated(
breaking_version="1.10",
additional_warn_text="Use `DagsterLookerApiTranslator.get_asset_spec().key` instead",
)
def get_explore_asset_key(self, looker_structure: LookerStructureData) -> AssetKey:
return self.get_explore_asset_spec(looker_structure).key

Expand Down Expand Up @@ -173,6 +181,10 @@ def get_explore_asset_spec(self, looker_structure: LookerStructureData) -> Asset
else:
check.assert_never(lookml_explore)

@deprecated(
breaking_version="1.10",
additional_warn_text="Use `DagsterLookerApiTranslator.get_asset_spec().key` instead",
)
def get_dashboard_asset_key(self, looker_structure: LookerStructureData) -> AssetKey:
return self.get_dashboard_asset_spec(looker_structure).key

Expand Down Expand Up @@ -218,6 +230,10 @@ def get_asset_spec(self, looker_structure: LookerStructureData) -> AssetSpec:
else:
check.assert_never(looker_structure.structure_type)

@deprecated(
breaking_version="1.10",
additional_warn_text="Use `DagsterLookerApiTranslator.get_asset_spec().key` instead",
)
@public
def get_asset_key(self, looker_structure: LookerStructureData) -> AssetKey:
return self.get_asset_spec(looker_structure).key

0 comments on commit 39610e2

Please sign in to comment.