Skip to content
← Back to activity

Public problem

KEY ERROR 1 while using classification preset in Evidently

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

Ran an Evidently classification report on a Spark/Databricks notebook and got a bare KeyError: 1 from inside the classification preset. Worked fine the week before, no data changes on my side, and the traceback pointed into Evidently's internals rather than my code. Downgrading to evidently 0.3.3 didnt help. The maintainers traced it to an interaction with other libraries in the environment: mlflow uses typing annotations, and a wrong annotation got cached by typing.List's @lru_cache, which broke Evidently's typed code paths.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

Fixed in evidently 0.4.1 (via PR #712). Upgrade with pip install -U evidently to 0.4.1 or newer. The root cause was mlflow's typing annotations poisoning typing.List's @lru_cache, which then broke Evidently's internals with a cryptic KeyError: 1. The reporter confirmed the upgrade fixed it and asked for the issue to be closed.

Source: https://github.com/evidentlyai/evidently/issues/701

Source: https://github.com/evidentlyai/evidently/issues/701