C2W3_Assignment - Exercise 12: Get parent artifacts

From the artifact_id_events, get the execution ids of OUTPUT events.

# Cast to a set to remove duplicates if any.
execution_id = set( 
    for event in artifact_id_events # @REPLACE
    if event.type == metadata_store_pb2.Event.OUTPUT # @REPLACE

Do I need to update the code between # @replace tag?
I’m getting the following error:
File “”, line 15
for event in artifact_id_events # @REPLACE
SyntaxError: invalid syntax

Hi! Thank you for bringing this to our attention. We have published a new version of the assignment which cleans up the boilerplate code for that exercise. Please reopen your notebook from the Coursera workspace to see the update.

As for hints on how to answer, the code there will look similar to the one used to get the parent_artifact_ids. You will just need to be mindful of the properties and event types. Hope this helps!

1 Like

Hi Chris,
Thanks for the clarification!
I have passed revised assignment.
Thanks a lot for your help on this!


1 Like