def to_proto(self): proto = ProtoExperiment() proto.experiment_id = self.experiment_id proto.name = self.name proto.artifact_location = self.artifact_location proto.lifecycle_stage = self.lifecycle_stage return proto
def test_parse_legacy_experiment(): in_json = {"experiment_id": 123, "name": "name", "unknown": "field"} message = ProtoExperiment() parse_dict(in_json, message) experiment = Experiment.from_proto(message) assert experiment.experiment_id == "123" assert experiment.name == 'name' assert experiment.artifact_location == ''
def to_proto(self): experiment = ProtoExperiment() experiment.experiment_id = self.experiment_id experiment.name = self.name experiment.artifact_location = self.artifact_location experiment.lifecycle_stage = self.lifecycle_stage experiment.tags.extend( [ProtoExperimentTag(key=key, value=val) for key, val in self._tags.items()] ) return experiment
def to_proto(self): proto = ProtoExperiment() proto.experiment_id = self.experiment_id proto.name = self.name proto.artifact_location = self.artifact_location return proto