Skip to content

fix: Fix ValueError when passing evals_dataframe to spans.log()#123

Open
nluzio wants to merge 1 commit intomainfrom
log-spans-fix
Open

fix: Fix ValueError when passing evals_dataframe to spans.log()#123
nluzio wants to merge 1 commit intomainfrom
log-spans-fix

Conversation

@nluzio
Copy link

@nluzio nluzio commented Feb 10, 2026

Summary

Fix ValueError when passing evals_dataframe to spans.log()

Problem

When calling spans.log() with both a dataframe and an evals_dataframe, the method
would fail with:
ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(),
a.item(), a.any() or a.all().

This occurred because the code was using if evals_df: to check if the eval
dataframe exists, but pandas DataFrames cannot be evaluated directly in a boolean
context.

Solution

Changed all boolean checks on evals_df from if evals_df: to if evals_df is not None: to properly check for the existence of the dataframe.

Changes

Fixed 4 instances in src/arize/spans/client.py:

  • Line 146: Index reset check
  • Line 186: Column removal check
  • Line 202: Values validation check
  • Line 227: DataFrame merge check

The code already used the correct pattern (is not None) in some places but was
inconsistent.

@nluzio nluzio changed the title fix: fixing eval_df boolean issue fix: Fix ValueError when passing evals_dataframe to spans.log() Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant