Skip to content

Commit

Permalink
counter -> gauge (#1280)
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii Moskalenko <[email protected]>
  • Loading branch information
pyalex authored Jan 21, 2021
1 parent cb3db2d commit f9e6a88
Showing 1 changed file with 11 additions and 8 deletions.
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

0 comments on commit f9e6a88

Please sign in to comment.