C2W3 Assignment Exercise 12

Could somebody please give me some guidance on C2W3 Exercise 12. I’m trying

Get events associated with the artifact id

#artifact_id_events = None
artifact_id_events = get_events_by_artifact_ids(
    artifact_id: Iterable[int]
) -> List[mlmd.proto.Event]  

and I get NameError: name ‘get_events_by_artifact_ids’ is not defined

Also, I get the same error below for:

From execution_id_events, get the artifact ids of INPUT events.

# Cast to a set to remove duplicates if any.
parent_artifact_ids = set( 
    event.artifact_id
    for event in execution_id_events
    if event.type == metadata_store_pb2.Event.INPUT
)

Hi @Mark_Malter

Please consider that the ‘get_events_by_artifact_ids’ function is a method of the object ‘store’ passed as a parameter to the get_parent_artifacts.
So I think you should invoke it as
store.get_events_by_artifact_ids([artifact_id])
The same for the other APIs
store.get_events_by_execution_ids
and
store.get_artifacts_by_id
Hope this helps
Br