fix: normalize null types in QNAM columns after supp merge#1782
Open
filippsatverily wants to merge 2 commits into
Open
fix: normalize null types in QNAM columns after supp merge#1782filippsatverily wants to merge 2 commits into
filippsatverily wants to merge 2 commits into
Conversation
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.
Contributor
Author
|
@SFJohnson24 this should be the last PR before we can bump pandas |
Draft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The supp pivot (
process_supp) initializes QNAM columns withpd.NA, but the subsequent left join inmerge_pivot_supp_datasetfills unmatched rows withNaN. This creates mixed null types (NaNvspd.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. Addingfillna(pd.NA)after the merge normalizes null representation in the QNAM columns.Tested scenarios: