Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report observed values in feature validation as Gauge #1280

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions sdk/python/feast/contrib/validation/ge.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ def udf(df: pd.DataFrame) -> pd.Series:
valid_rows = pd.Series([True] * df.shape[0])

for check in result.results:
if check.success:
continue

if check.exception_info["raised_exception"]:
# ToDo: probably we should mark all rows as invalid
continue
Expand All @@ -124,7 +121,10 @@ def udf(df: pd.DataFrame) -> pd.Series:
]
)

if "unexpected_count" in check.result:
if (
"unexpected_count" in check.result
and check.result["unexpected_count"] > 0
):
reporter.increment(
"feast_feature_validation_check_failed",
value=check.result["unexpected_count"],
Expand All @@ -137,12 +137,15 @@ def udf(df: pd.DataFrame) -> pd.Series:

valid_rows.iloc[check.result["unexpected_index_list"]] = False

elif "observed_value" in check.result:
reporter.increment(
elif "observed_value" in check.result and check.result["observed_value"]:
reporter.gauge(
"feast_feature_validation_observed_value",
value=int(
check.result["observed_value"] * 100
), # storing as decimal with precision 2
check.result["observed_value"]
* 100 # storing as decimal with precision 2
)
if not check.success
else 0, # nullify everything below threshold
tags=[
f"feature_table:{os.getenv('FEAST_INGESTION_FEATURE_TABLE', 'unknown')}",
f"project:{os.getenv('FEAST_INGESTION_PROJECT_NAME', 'default')}",
Expand Down