MCPcopy Index your code
hub / github.com/feast-dev/feast / from_proto

Method from_proto

sdk/python/feast/saved_dataset.py:307–335  ·  view source on GitHub ↗
(cls, proto: ValidationReferenceProto)

Source from the content-addressed store, hash-verified

305
306 @classmethod
307 def from_proto(cls, proto: ValidationReferenceProto) -> "ValidationReference":
308 profiler_attr = proto.WhichOneof("profiler")
309 if profiler_attr == "ge_profiler":
310 from feast.dqm.profilers.ge_profiler import GEProfiler
311
312 profiler = GEProfiler.from_proto(proto.ge_profiler)
313 else:
314 raise RuntimeError("Unrecognized profiler")
315
316 profile_attr = proto.WhichOneof("cached_profile")
317 if profile_attr == "ge_profile":
318 from feast.dqm.profilers.ge_profiler import GEProfile
319
320 profile = GEProfile.from_proto(proto.ge_profile)
321 elif not profile_attr:
322 profile = None
323 else:
324 raise RuntimeError("Unrecognized profile")
325
326 ref = ValidationReference(
327 name=proto.name,
328 dataset_name=proto.reference_dataset_name,
329 profiler=profiler,
330 description=proto.description,
331 tags=dict(proto.tags),
332 )
333 ref._profile = profile
334
335 return ref
336
337 def to_proto(self) -> ValidationReferenceProto:
338 from feast.dqm.profilers.ge_profiler import GEProfile, GEProfiler

Callers

nothing calls this directly

Calls 2

ValidationReferenceClass · 0.85
from_protoMethod · 0.45

Tested by

no test coverage detected