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-sigma] Update Sigma docs to use translator instance and container data classes #26800

Merged
Merged
Show file tree
Hide file tree
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
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
Loading