From 5895144386f67f48a5fc8f55659ce557f5572085 Mon Sep 17 00:00:00 2001 From: JamieDeMaria Date: Thu, 18 Jan 2024 12:58:45 -0500 Subject: [PATCH] wip --- .../dagster/_core/execution/context/compute.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/python_modules/dagster/dagster/_core/execution/context/compute.py b/python_modules/dagster/dagster/_core/execution/context/compute.py index e2a604431518b..1d16aa8a2dee4 100644 --- a/python_modules/dagster/dagster/_core/execution/context/compute.py +++ b/python_modules/dagster/dagster/_core/execution/context/compute.py @@ -4,6 +4,7 @@ from inspect import ( _empty as EmptyAnnotation, ) +import pstats from typing import ( AbstractSet, Any, @@ -1483,13 +1484,17 @@ def latest_materialization_for_upstream_asset( materialization_events = ( self.op_execution_context._step_execution_context.upstream_asset_materialization_events # noqa: SLF001 ) - if AssetKey.from_coercible(key) in materialization_events.keys(): - return materialization_events.get(AssetKey.from_coercible(key)) + if self.has_partition_key: + # if the asset is par + pass + else: + if AssetKey.from_coercible(key) in materialization_events.keys(): + return materialization_events.get(AssetKey.from_coercible(key)) - raise DagsterInvariantViolationError( - f"Cannot fetch AssetMaterialization for asset {key}. {key} must be an upstream dependency" - "in order to call latest_materialization_for_upstream_asset." - ) + raise DagsterInvariantViolationError( + f"Cannot fetch AssetMaterialization for asset {key}. {key} must be an upstream dependency" + "in order to call latest_materialization_for_upstream_asset." + ) ######## Deprecated methods