Course 2 week 3 exercise 12: parent_artifact_ids gives set()

I keep getting empty output for the function get_parents_artifacts.

def get_parent_artifacts(store, artifact):

    ### START CODE HERE ###
    .
    .
    .   
     # Get the events associated with the execution_id
    execution_id_events = store.get_events_by_artifact_ids(execution_id)
    .
    .
    .
    return parent_artifact_list

parent_artifact_ids gives set()

Can you spot any issue?

Hi @mpizos ,
Welcome to discourse!

The empty set is caused by calling the wrong mlmd method in the following line:
execution_id_events = store.get_events_by_artifact_ids(execution_id)
See mlmd metadata store for all possible methods. If you can’t find the right one, pls let me know.

After solving the problem, could you please remove the code snippet from your question above? This is because we should avoid posting code solutions in the forums to respect the Honour Code.

Thanks and best of luck!

Maarten

3 Likes

thanks. you are right. :slight_smile:

I am also editing the code snippet in order the question and answer make sense.