Skip to content

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

Open
filippsatverily wants to merge 2 commits into
cdisc-org:mainfrom
filippsatverily:filipps/pandas3-normalize-supp-nulls
Open

fix: normalize null types in QNAM columns after supp merge#1782
filippsatverily wants to merge 2 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

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