whylabs / whylogs

An open-source data logging library for machine learning models and data pipelines. 📚 Provides visibility into data quality & model performance over time. 🛡️ Supports privacy-preserving data collection, ensuring safety & robustness. 📈
https://whylogs.readthedocs.io/
Apache License 2.0
2.65k stars 121 forks source link

Don't flush column profile cache when cache is empty #1536

Closed jamie256 closed 4 months ago

jamie256 commented 4 months ago

Description

The internal column profile cache is flushed when turning the profile into a view, which triggers a call to columnar_update, with empty data. This can cause confusing behavior in custom metrics that keep state related to the number of times the metric has been called.

Suggestion: inspect the _cache and only flush if its not empty.