Skip to content

Commit d07b2b0

Browse files
committed
fix: modify calls to translator to pass fqn instead
This fixes the error where materialisations return wrong asset keys, and hence can't be marked as completed on Dagster.
1 parent 0e60e04 commit d07b2b0

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

dagster_sqlmesh/config.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,8 @@ class SQLMeshContextConfig(Config):
2626
gateway: str
2727
config_override: dict[str, Any] | None = Field(default_factory=lambda: None)
2828

29-
3029
@property
3130
def sqlmesh_config(self) -> MeshConfig | None:
3231
if self.config_override:
3332
return MeshConfig.parse_obj(self.config_override)
34-
return None
35-
33+
return None

dagster_sqlmesh/resource.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ def notify_success(
146146
# We allow selecting models. That value is mapped to models_map.
147147
# If the model is not in models_map, we can skip any notification
148148
if model:
149-
output_key = self.translator.get_asset_key_str(model.name)
149+
# Passing model.fqn to translator
150+
output_key = self.translator.get_asset_key_str(model.fqn)
150151
asset_key = self._context.asset_key_for_output(output_key)
151152
yield MaterializeResult(
152153
asset_key=asset_key,
@@ -302,7 +303,7 @@ def run(
302303
models_map = {}
303304
for key, model in models.items():
304305
if (
305-
translator.get_sqlmesh_model_name_from_key_str(model.name)
306+
translator.get_asset_key_str(model.fqn)
306307
in context.selected_output_names
307308
):
308309
models_map[key] = model

0 commit comments

Comments
 (0)