Skip to content

Conversation

@thaiv28
Copy link

@thaiv28 thaiv28 commented Sep 11, 2025

Added a test to TestFillNA to check that call fillna with a Series of dtype Categorical does not throw an error.

Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

)

filler = Series(Categorical([10.0, 20.0, 30.0]))
df.fillna({"ints": filler}, inplace=True)
Copy link
Member

Choose a reason for hiding this comment

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

Can you avoid mutating here; when debugging, it can be helpful to have both before and after the operation accessible.

Suggested change
df.fillna({"ints": filler}, inplace=True)
result = df.fillna({"ints": filler})

tm.assert_frame_equal(df.fillna(value=NaT), df)

def test_fillna_with_categorical_series(self):
df = DataFrame(
Copy link
Member

Choose a reason for hiding this comment

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

Add a reference to the issue as a comment on the first line.

# https://github.com/pandas-dev/pandas/issues/56329

@rhshadrach rhshadrach added Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Needs Tests Unit test(s) needed to prevent regressions Categorical Categorical Data Type labels Sep 30, 2025
@github-actions
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Oct 31, 2025
@rhshadrach
Copy link
Member

Closing as stale. If you're interested in continuing, address requests above and we'd be more than happy to reopen!

@rhshadrach rhshadrach closed this Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Categorical Categorical Data Type Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Needs Tests Unit test(s) needed to prevent regressions Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: AssertionError: Did not expect new dtype float64 to equal self.dtype float64. Please report a bug

2 participants