Skip to content

pandas#1789

Merged
gerrycampion merged 21 commits into
mainfrom
pandas
Jun 30, 2026
Merged

pandas#1789
gerrycampion merged 21 commits into
mainfrom
pandas

Conversation

@SFJohnson24

@SFJohnson24 SFJohnson24 commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

per @filippsatverily Removes the last remaining upper-bound version cap. All pandas 3.0 compatibility fixes are now on main (#1767, #1772, #1774, #1776, #1777, #1782, #1786).

I had to add some extra changes to preserve behavior in 2 operations:

  • In day_data_validator.py, explicitly cast columns to object type before mapping timestamp parsing functions, ensuring compatibility with pandas 3 and preventing type casting-related issues. [1] [2]
  • In distinct.py, replaced direct list conversion with a new _apply_dropna_list function to remove NaN values before collecting unique values, addressing changes in how pandas 3 handles missing data in groupby operations. [1] [2]

@SFJohnson24 SFJohnson24 marked this pull request as ready for review June 26, 2026 18:09
@SFJohnson24 SFJohnson24 requested a review from RamilCDISC June 26, 2026 18:10
@SFJohnson24 SFJohnson24 requested a review from gerrycampion June 26, 2026 18:14
.groupby(self.params.grouping, as_index=False, group_keys=False)
.data[self.params.target]
.apply(list)
.apply(_apply_dropna_list)

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.

Before the grouped path used .apply(list) which would preserve the missing values but _apply_dropna_list drops them. If this is intentional then the ungrouped non reference path still uses data = result[self.params.target].unique() and then result = list(data) which preserves the missing values in the list. The distinct operation will have two different behaviors then. Please let me know if I misunderstanding something here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

made them have parity

@RamilCDISC RamilCDISC 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.

The PR is one of the last changes for pandas 3.0 compatibility. The PR updates the Distinct operation and updates pandas version in the tests.The PR was validated by:

  1. Reviewing the PR for any unwanted code or comments.
  2. Reviewing the PR in accordance to AC.
  3. Reviewing the updated operation for consistency throughout its different return paths.
  4. Ensuring all unit and regression tests pass.
  5. Ensuring pandas version update does not break any CI check.
  6. Ensuring pandas version update does not cause any regressions.

@gerrycampion gerrycampion merged commit a966e1f into main Jun 30, 2026
13 checks passed
@gerrycampion gerrycampion deleted the pandas branch June 30, 2026 23:02
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.

3 participants