diff --git a/python_modules/dagster/dagster/_core/instance/__init__.py b/python_modules/dagster/dagster/_core/instance/__init__.py index 8e5c3f03e81c2..fa0d587228000 100644 --- a/python_modules/dagster/dagster/_core/instance/__init__.py +++ b/python_modules/dagster/dagster/_core/instance/__init__.py @@ -1988,8 +1988,8 @@ def get_latest_asset_check_evaluation_record( asset_check_key ) - @public @traced + @deprecated(breaking_version="2.0") def get_event_records( self, event_records_filter: "EventRecordsFilter", @@ -2008,7 +2008,7 @@ def get_event_records( Returns: List[EventLogRecord]: List of event log records stored in the event log storage. """ - from dagster._core.events import DagsterEventType + from dagster._core.events import PIPELINE_EVENTS, DagsterEventType if ( event_records_filter.event_type == DagsterEventType.ASSET_MATERIALIZATION_PLANNED @@ -2018,6 +2018,18 @@ def get_event_records( "Asset materialization planned events with partitions subsets will not be " "returned when the event records filter contains the asset_partitions argument" ) + elif event_records_filter.event_type == DagsterEventType.ASSET_MATERIALIZATION: + warnings.warn( + "Use fetch_materializations instead of get_event_records to fetch materialization events." + ) + elif event_records_filter.event_type == DagsterEventType.ASSET_OBSERVATION: + warnings.warn( + "Use fetch_observations instead of get_event_records to fetch observation events." + ) + elif event_records_filter.event_type in PIPELINE_EVENTS: + warnings.warn( + "Use fetch_run_status_changes instead of get_event_records to fetch run status change events." + ) return self._event_storage.get_event_records(event_records_filter, limit, ascending)