Skip to content

fix: handle empty numpy arrays in scalar proto conversion during materialization#6267

Closed
psaikaushik wants to merge 1 commit intofeast-dev:masterfrom
psaikaushik:fix/6255-empty-numpy-array-materialization
Closed

fix: handle empty numpy arrays in scalar proto conversion during materialization#6267
psaikaushik wants to merge 1 commit intofeast-dev:masterfrom
psaikaushik:fix/6255-empty-numpy-array-materialization

Conversation

@psaikaushik
Copy link
Copy Markdown

@psaikaushik psaikaushik commented Apr 12, 2026

Closing — this is a duplicate of #6259 which was already opened by the issue author. Apologies for the noise.

When a scalar feature column contains an empty numpy array (np.array([])),
pd.isnull() returns an array instead of a scalar bool. Applying Python's
`not` operator to that array raises:

    ValueError: The truth value of an empty array is ambiguous.

This adds a safe null-check helper (is_scalar_null) that handles
array-like values before falling through to pd.isnull(). Empty arrays
are treated as null values, consistent with None and np.nan.

The helper is used in _convert_scalar_values_to_proto to replace the
bare `pd.isnull()` calls that crash on array inputs.

Closes feast-dev#6255
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