Skip to content

Commit

Permalink
Fix pyright and code
Browse files Browse the repository at this point in the history
  • Loading branch information
maximearmstrong committed Dec 27, 2024
1 parent b666549 commit 2a268ea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion docs/content/integrations/tableau.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ class MyCustomTableauTranslator(DagsterTableauTranslator):


tableau_specs = load_tableau_asset_specs(
tableau_workspace, dagster_tableau_translator=MyCustomTableauTranslator
tableau_workspace,
dagster_tableau_translator=MyCustomTableauTranslator,
)
defs = dg.Definitions(assets=[*tableau_specs], resources={"tableau": tableau_workspace})
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ def build_defs(

resource_key = "tableau"

asset_specs = load_tableau_asset_specs(self, dagster_tableau_translator)
asset_specs = load_tableau_asset_specs(self, dagster_tableau_translator())

non_executable_asset_specs = [
spec
Expand Down Expand Up @@ -599,7 +599,7 @@ def build_client(self) -> None:
@record
class TableauWorkspaceDefsLoader(StateBackedDefinitionsLoader[Mapping[str, Any]]):
workspace: BaseTableauWorkspace
translator: Type[DagsterTableauTranslator]
translator: DagsterTableauTranslator

@property
def defs_key(self) -> str:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from dagster_tableau.asset_utils import parse_tableau_external_and_materializable_asset_specs
from dagster_tableau.assets import build_tableau_materializable_assets_definition
from dagster_tableau.resources import TableauCloudWorkspace, load_tableau_asset_specs
from dagster_tableau.translator import DagsterTableauTranslator
from dagster_tableau.translator import DagsterTableauTranslator, TableauTranslatorData

from dagster_tableau_tests.conftest import (
FAKE_CONNECTED_APP_CLIENT_ID,
Expand Down Expand Up @@ -67,12 +67,12 @@ def cacheable_asset_defs_refreshable_workbooks():
@lazy_definitions
def cacheable_asset_defs_custom_translator():
class MyCoolTranslator(DagsterTableauTranslator):
def get_asset_spec(self, data) -> AssetSpec:
def get_asset_spec(self, data: TableauTranslatorData) -> AssetSpec:
default_spec = super().get_asset_spec(data)
return default_spec.replace_attributes(key=default_spec.key.with_prefix("my_prefix"))

tableau_specs = load_tableau_asset_specs(
workspace=resource, dagster_tableau_translator=MyCoolTranslator
workspace=resource, dagster_tableau_translator=MyCoolTranslator()
)

return Definitions(assets=[*tableau_specs], jobs=[define_asset_job("all_asset_job")])
Expand Down

0 comments on commit 2a268ea

Please sign in to comment.