dagster icon indicating copy to clipboard operation
dagster copied to clipboard

[dagster-tableau] Use get_asset_spec().key in DagsterTableauTranslator

Open maximearmstrong opened this issue 1 year ago • 1 comments

Summary & Motivation

Following an internal discussion here and product review here, get_asset_spec().key is the new recommended way to access the asset key in the Translator.

Asset keys can now be customized in a custom translator using replace_attributes, like:

class MyCustomTableauTranslator(DagsterTableauTranslator):
    def get_asset_spec(self, data: TableauContentData) -> dg.AssetSpec:
        default_spec = super().get_asset_spec(data)
        return replace_attributes(
            default_spec,
            key=default_spec.key.with_prefix("prefix"),
        )

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

These changes will also be done to the following integrations:

  • Power BI
  • Sigma
  • Looker
  • dlt
  • Sling
  • sdf

We will need to rework dbt to use this pattern.

How I Tested These Changes

Updated unit test with BK

maximearmstrong avatar Nov 20 '24 02:11 maximearmstrong

This stack of pull requests is managed by Graphite. Learn more about stacking.

maximearmstrong avatar Nov 20 '24 02:11 maximearmstrong