sourabh upadhye
10/01/2021, 6:36 AMJosh Lloyd
10/01/2021, 4:36 PM@sensor(pipeline_name="pipeline", mode=ENV)
def sensor(context):
""" Workaround for wildcard matching on asset_keys. From <https://github.com/dagster-io/dagster/issues/4582> """
after_cursor = int(context.cursor) if context.cursor else None
event_records = context.instance.get_event_records(
EventRecordsFilter(
event_type=DagsterEventType.ASSET_MATERIALIZATION,
after_cursor=after_cursor,
),
ascending=True,
)
for event_record in event_records:
materialization = event_record.event_log_entry.dagster_event.event_specific_data.materialization
asset_key = json.loads(materialization.asset_key.to_string())
...
sourabh upadhye
10/01/2021, 5:26 PM