Skip to content

Commit 301f61e

Browse files
committed
some apidocs
Signed-off-by: Oleksii Moskalenko <moskalenko.alexey@gmail.com>
1 parent acbfe84 commit 301f61e

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

sdk/python/feast/dqm/profilers/ge_profiler.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ def analyze_dataset(self, df: pd.DataFrame) -> Profile:
141141
return GEProfile(expectation_suite=self.user_defined_profiler(dataset))
142142

143143
def to_proto(self):
144+
# keep only the code and drop context for now
145+
# ToDo (pyalex): include some context, but not all (dill tries to pull too much)
144146
udp = FunctionType(self.user_defined_profiler.__code__, {})
145147
return GEValidationProfilerProto(
146148
profiler=GEValidationProfilerProto.UserDefinedProfiler(

sdk/python/feast/saved_dataset.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,30 @@ class ValidationReference:
224224
_dataset: Optional[SavedDataset] = None
225225

226226
def __init__(self, name: str, dataset_name: str, profiler: Profiler):
227+
"""
228+
Validation reference combines a reference dataset (currently only a saved dataset object can be used as
229+
a reference) and a profiler function to generate a validation profile.
230+
The validation profile can be cached in this object, and in this case
231+
the saved dataset retrieval and the profiler call will happen only once.
232+
233+
Validation reference is being stored in the Feast registry and can be retrieved by its name, which
234+
must be unique within one project.
235+
236+
Args:
237+
name: unique name
238+
dataset_name: name of a saved dataset
239+
profiler: profiler function used to generate profile from a saved dataset
240+
"""
227241
self.name = name
228242
self.dataset_name = dataset_name
229243
self.profiler = profiler
230244

231245
@classmethod
232246
def from_saved_dataset(cls, name: str, dataset: SavedDataset, profiler: Profiler):
247+
"""
248+
Internal constructor to create validation reference object with actual saved dataset object
249+
(regular constructor requires only its name).
250+
"""
233251
ref = ValidationReference(name, dataset.name, profiler)
234252
ref._dataset = dataset
235253
return ref

0 commit comments

Comments
 (0)