Skip to content

Fix: table_diff - correctly handle nulls in boolean columns when displaying the row diff #4310

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
May 5, 2025

Conversation

erindru
Copy link
Collaborator

@erindru erindru commented May 4, 2025

Prior to this, running table_diff on tables with a boolean column that contained nulls would produce the following error:

TypeError: boolean value of NA is ambiguous

This error is thrown when pd.NA is attempted to be converted to a Python boolean, eg bool(pd.NA).

This PR converts the pd.NA to a Python None before determining if cells match to avoid this error

@erindru erindru requested a review from themisvaltinos May 4, 2025 22:24
@erindru erindru merged commit 8e3ac17 into main May 5, 2025
23 checks passed
@erindru erindru deleted the erin/table-diff-boolean branch May 5, 2025 04:05
erindru added a commit that referenced this pull request May 5, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants