Skip to content

Commit

Permalink
[dagster-sigma] Update Sigma docs to use translator instance and cont…
Browse files Browse the repository at this point in the history
…ainer data classes (#26800)

## Summary & Motivation

As title.

## How I Tested These Changes

BK and docs preview
  • Loading branch information
maximearmstrong authored Jan 3, 2025
1 parent 5a63f7e commit b912cb4
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
Binary file modified docs/content/api/modules.json.gz
Binary file not shown.
Binary file modified docs/content/api/searchindex.json.gz
Binary file not shown.
Binary file modified docs/content/api/sections.json.gz
Binary file not shown.
6 changes: 3 additions & 3 deletions docs/content/integrations/sigma.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ from dagster_sigma import (
DagsterSigmaTranslator,
SigmaBaseUrl,
SigmaOrganization,
SigmaWorkbook,
SigmaWorkbookTranslatorData,
load_sigma_asset_specs,
)

Expand All @@ -117,15 +117,15 @@ sigma_organization = SigmaOrganization(

# A translator class lets us customize properties of the built Sigma assets, such as the owners or asset key
class MyCustomSigmaTranslator(DagsterSigmaTranslator):
def get_asset_spec(self, data: SigmaWorkbook) -> dg.AssetSpec:
def get_asset_spec(self, data: SigmaWorkbookTranslatorData) -> dg.AssetSpec:
# We create the default asset spec using super()
default_spec = super().get_asset_spec(data)
# we customize the team owner tag for all Sigma assets
return default_spec.replace_attributes(owners=["team:my_team"])


sigma_specs = load_sigma_asset_specs(
sigma_organization, dagster_sigma_translator=MyCustomSigmaTranslator
sigma_organization, dagster_sigma_translator=MyCustomSigmaTranslator()
)
defs = dg.Definitions(assets=[*sigma_specs], resources={"sigma": sigma_organization})
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
DagsterSigmaTranslator,
SigmaBaseUrl,
SigmaOrganization,
SigmaWorkbook,
SigmaWorkbookTranslatorData,
load_sigma_asset_specs,
)

Expand All @@ -17,14 +17,14 @@

# A translator class lets us customize properties of the built Sigma assets, such as the owners or asset key
class MyCustomSigmaTranslator(DagsterSigmaTranslator):
def get_asset_spec(self, data: SigmaWorkbook) -> dg.AssetSpec:
def get_asset_spec(self, data: SigmaWorkbookTranslatorData) -> dg.AssetSpec:
# We create the default asset spec using super()
default_spec = super().get_asset_spec(data) # type: ignore
default_spec = super().get_asset_spec(data)
# we customize the team owner tag for all Sigma assets
return default_spec.replace_attributes(owners=["team:my_team"])


sigma_specs = load_sigma_asset_specs(
sigma_organization, dagster_sigma_translator=MyCustomSigmaTranslator
sigma_organization, dagster_sigma_translator=MyCustomSigmaTranslator()
)
defs = dg.Definitions(assets=[*sigma_specs], resources={"sigma": sigma_organization})
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
from dagster_sigma.translator import (
DagsterSigmaTranslator as DagsterSigmaTranslator,
SigmaDataset as SigmaDataset,
SigmaDatasetTranslatorData as SigmaDatasetTranslatorData,
SigmaWorkbook as SigmaWorkbook,
SigmaWorkbookTranslatorData as SigmaWorkbookTranslatorData,
)
from dagster_sigma.version import __version__

Expand Down

1 comment on commit b912cb4

@github-actions
Copy link

Choose a reason for hiding this comment

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

Deploy preview for dagster-docs ready!

✅ Preview
https://dagster-docs-pmj7oxbms-elementl.vercel.app
https://master.dagster.dagster-docs.io

Built with commit b912cb4.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.