Skip to content

fix: normalize null types in QNAM columns after supp merge - #1782

Merged
SFJohnson24 merged 3 commits into
cdisc-org:mainfrom
filippsatverily:filipps/pandas3-normalize-supp-nulls
Jun 24, 2026
Merged

fix: normalize null types in QNAM columns after supp merge#1782
SFJohnson24 merged 3 commits into
cdisc-org:mainfrom
filippsatverily:filipps/pandas3-normalize-supp-nulls

Conversation

@filippsatverily

Copy link
Copy Markdown
Contributor

The supp pivot (process_supp) initializes QNAM columns with pd.NA, but the subsequent left join in merge_pivot_supp_dataset fills unmatched rows with NaN. This creates mixed null types (NaN vs pd.NA) in the same column. On pandas <3.0 this is invisible since both are treated identically, but on pandas 3.0 with nullable dtypes the inconsistency causes strict equality checks to fail. Adding fillna(pd.NA) after the merge normalizes null representation in the QNAM columns.

Tested scenarios:

The supp pivot uses pd.NA for empty cells, but the left join produces
NaN for unmatched rows. On pandas 3.0 with nullable dtypes this creates
mixed null types in the same column (NaN vs pd.NA), which fails strict
equality checks. Normalizing with fillna(pd.NA) after the merge makes
null representation consistent.
@filippsatverily
filippsatverily marked this pull request as ready for review June 23, 2026 19:29
@filippsatverily

Copy link
Copy Markdown
Contributor Author

@SFJohnson24 this should be the last PR before we can bump pandas

@SFJohnson24 SFJohnson24 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds null normalization for merge pivot. Test suite: #1785 and unit tests, pilot study fine

@SFJohnson24
SFJohnson24 merged commit 6a444be into cdisc-org:main Jun 24, 2026
11 checks passed
@SFJohnson24 SFJohnson24 mentioned this pull request Jun 26, 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.

2 participants