From 8a07033f1655b8ab0f55c3e5915d6c38cc161223 Mon Sep 17 00:00:00 2001 From: prha Date: Wed, 8 May 2024 15:52:13 -0700 Subject: [PATCH] remove get_event_records calls from graphql --- .../dagster_graphql/schema/asset_graph.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/asset_graph.py b/python_modules/dagster-graphql/dagster_graphql/schema/asset_graph.py index b154fdd33de1..19c0a61dc6e4 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/asset_graph.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/asset_graph.py @@ -21,7 +21,7 @@ SensorType, ) from dagster._core.errors import DagsterInvariantViolationError -from dagster._core.event_api import EventRecordsFilter +from dagster._core.event_api import AssetRecordsFilter from dagster._core.events import DagsterEventType from dagster._core.remote_representation import CodeLocation, ExternalRepository from dagster._core.remote_representation.external import ExternalJob, ExternalSensor @@ -577,15 +577,14 @@ def resolve_assetMaterializationUsedData( instance=graphene_info.context.instance, asset_graph=asset_graph ) data_time_resolver = CachingDataTimeResolver(instance_queryer=instance_queryer) - event_records = instance.get_event_records( - EventRecordsFilter( - event_type=DagsterEventType.ASSET_MATERIALIZATION, + event_records = instance.fetch_materializations( + AssetRecordsFilter( + asset_key=asset_key, before_timestamp=int(timestampMillis) / 1000.0 + 1, after_timestamp=int(timestampMillis) / 1000.0 - 1, - asset_key=asset_key, ), limit=1, - ) + ).records if not event_records: return []