Skip to content

fix: handle None drop_na_params during replay to prevent AttributeError#227

Open
gitadi2 wants to merge 2 commits intoc2siorg:mainfrom
gitadi2:fix/dropna-none-crash-199
Open

fix: handle None drop_na_params during replay to prevent AttributeError#227
gitadi2 wants to merge 2 commits intoc2siorg:mainfrom
gitadi2:fix/dropna-none-crash-199

Conversation

@gitadi2
Copy link
Copy Markdown

@gitadi2 gitadi2 commented Mar 25, 2026

Fixes

#199

Type of Change

  • Bug fix

Problem

Projects containing a dropNa transformation without parameters cannot be saved or reverted. When drop_na_params is serialized as None by Pydantic, the replay handler calls .get("columns") on None, causing an AttributeError.

Root Cause

The line:

columns = action_details.get("drop_na_params", {}).get("columns")

The default {} only applies when the key is missing. When the key exists with value None, .get() returns None, and calling .get("columns") on None crashes.

Fix

columns = (action_details.get("drop_na_params") or {}).get("columns")

Using or {} converts None to an empty dict, so .get("columns") always works.

Testing

  • Manual testing
  • Existing tests pass

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review
  • My changes generate no new warnings

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