Arun Kumar07/19/2021, 4:48 AM
, but I am still not sure how to get the partition info from the Asset key to pass it in the run request. The returned
does not have the partition info. Is there any other method that I can use?
prha07/19/2021, 4:51 PM
itself. You should be able to access it like this:
I should also note that as of
events = instance.events_for_asset_key(my_asset_key, limit=1) if not events: return record_id, event = events materialization = event.dagster_event.step_materialization_data.materialization partition = materialization.partition
the instance method
is deprecated in favor of
. Using this new API, the above code would look like this:
from dagster import DagsterEventType, EventRecordsFilter records = instance.get_event_records( EventRecordsFilter(event_type=DagsterEventType.ASSET_MATERIALIZATION, asset_key=my_asset_key), limit=1 ) if not records: return event = records.event_log_entry materialization = event.dagster_event.step_materialization_data.materialization partition = materialization.partition
Arun Kumar07/19/2021, 8:58 PM
and thanks again for sharing the code for get_event_records.