Monitoring metrics crash on NaN/Inf feature values, silently dropping the whole feature view

Aperta
#6,783 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
numpy, python

Direzione di ricerca

Leggi feast/monitoring/metrics_calculator.py, in particolare MetricsCalculator.compute_numeric() e compute_all(), quindi esamina feast/infra/offline_stores/dask.py per _dask_compute_numeric_metrics. Verifica il comportamento con i valori di riproduzione contenenti NaN o infinito; il lavoro è completo quando entrambi i percorsi calcolano le metriche per i valori finiti senza eliminare l’intera feature view e applicano gli helper numerici sicuri esistenti a tutte le statistiche riportate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

kind/bug priority/p2

Expected Behavior

Computing monitoring metrics for a numeric feature should succeed even when some values are NaN or +-Infinity, which occur naturally in feature engineering (e.g. a ratio whose denominator is zero).

Current Behavior

MetricsCalculator.compute_numeric() passes values straight into np.histogram(), which raises on non-finite input:

ValueError: autodetected range of [0.05, inf] is not finite

compute_all() has no per-column error handling, so this exception discards metrics for the entire feature view - including columns that are perfectly well-formed.

The failure is silent to the caller: POST /monitoring/compute (and the auto_compute endpoint the Feast UI's "Compute Metrics" button calls) still returns HTTP 200 with "status": "completed" and "computed_features": 0. Nothing surfaces to the UI - the feature view is simply absent from the Monitoring page, with no error shown anywhere.

The same unguarded np.histogram call is duplicated in the Dask offline store (_dask_compute_numeric_metrics), so it fails there too.

Steps to reproduce

import pyarrow as pa
from feast.monitoring.metrics_calculator import MetricsCalculator

calc = MetricsCalculator()
arr = pa.array([0.05, 0.06, float("inf"), 0.08], type=pa.float64())
calc.compute_numeric(arr)
# ValueError: autodetected range of [0.05, inf] is not finite

Or end-to-end: define a FeatureView with a feature computed as clicks / impressions where one row has impressions = 0, enable data_quality_monitoring in feature_store.yaml, and run feast apply. The apply succeeds but logs:

ERROR:feast.monitoring.monitoring_service:Failed to compute baseline for feature view 'campaign_stats'
ValueError: autodetected range of [0.05, inf] is not finite

and the feature view never appears on the Monitoring page, even though feast apply itself reports no error.

Specifications
  • Version: master
  • Platform: Linux (also affects the Dask offline store code path)
  • Subsystem: monitoring / metrics_calculator

Possible Solution

Filter non-finite values out after dropping nulls, before computing any statistic, and apply the existing _safe_float/opt_float helpers (which already exist for this exact purpose but were only applied to mean and stddev) to min_val, max_val, and the quantiles as well. Fix in both feast/monitoring/metrics_calculator.py and feast/infra/offline_stores/dask.py. Submitted as a PR alongside this issue.

FIX :- #6782

Lingua principale
Python
Stelle
7.4k
Fork
1.5k
Merge medio
2g 6h
PR unite (30g)
107

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di feast-dev/feast

Tutte le issue di feast-dev/feast

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.