Lab assessment C2W3_Assignment

Can someone please share the code for def get_parent_artifacts(store, artifact): .

I have passed my assignment but got this part wrong. I spent a while trying to understand but the protobuf definition is out of my reach. I got this from ChatGPT for ml_metadata.proto.metadata_store_pb2.Execution . However, I am unable to access “parents” nor check for types like
# From execution_id_events, get the artifact ids of INPUT events.

// An Execution represents an execution of a component in a ML workflow. Executions
// have Types and are associated with one or more contexts (which represent
// the context or scope in which an execution occurs), and possibly artifacts
// (which represent the input/output to/from an execution). An Execution can
// be linked to another Execution, representing a parent/child relationship.
message Execution {
  // Optional ID of the execution.
  int64 id = 1;

  // Optional type_id of the execution. It references an ExecutionType ID.
  int64 type_id = 2;

  // Optional ID of the context associated with the execution.
  repeated int64 contexts = 3;

  // Optional ID of the artifact associated with the execution.
  repeated int64 artifacts = 4;

  // Optional ID of the parent executions.
  repeated int64 parent_ids = 5;

  // Optional start time of the execution.
  google.protobuf.Timestamp start_time = 6;

  // Optional end time of the execution.
  google.protobuf.Timestamp end_time = 7;

  // Optional status of the execution.
  ExecutionStatus status = 8;

  // Optional custom properties of the execution.
  repeated KeyValue custom_properties = 9;

  // Optional last update time of the execution.
  google.protobuf.Timestamp last_update_time = 10;
}

Dear @Vijay_Rajan ,

How are you? Sorry to hear that.

However, to provide code for this function is not recommended as it is actually part of the exercise 12 of the assignment. You can just follow the tips provided to you and you should be fine to track the inputs of a particular artifact.

Hope it helps!

Kader
MLEP Mentor