Skip to content

Conversation

@Aniketsy
Copy link
Contributor

@Aniketsy Aniketsy commented Nov 16, 2025

Please let me know if my approach or fix needs any improvements . I’m open to feedback and happy to make changes based on suggestions.
Thank you!

@Aniketsy Aniketsy marked this pull request as draft November 16, 2025 16:13
@Aniketsy Aniketsy marked this pull request as ready for review November 19, 2025 09:58
@Aniketsy Aniketsy marked this pull request as draft November 20, 2025 11:37
@Aniketsy
Copy link
Contributor Author

@jbrockmendel Could you please take a look in this, If i'm not in wrong direction.

@Aniketsy Aniketsy marked this pull request as ready for review November 22, 2025 06:56
@Aniketsy
Copy link
Contributor Author

@jbrockmendel Please review these changes, whenever you get a chance.

data.fillna(data_missing[1], copy=False)
tm.assert_extension_array_equal(data, data_missing)
if self._supports_fillna_copy_false:
# but with copy=False, this raises for EAs that respect the copy keyword
Copy link
Member

Choose a reason for hiding this comment

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

i think this comment should be for EAs that dont respect the copy keyword?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added a comment in the else block for the EAs that don't respect the copy keyword.

Copy link
Member

Choose a reason for hiding this comment

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

ok but isnt the comment here still wrong?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i thought about removing that comment earlier but wasn’t fully sure since it was written specifically for the if case. You're right, so I’ll remove it.

result = data.fillna(data_missing[1])
assert result[0] == data_missing[1]
res_copy = data.fillna(fill_value, copy=True)
tm.assert_extension_array_equal(res_copy, expected)
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 keep using data_missing instead of defining a new expected. i.e. minimize the diff

def test_fillna_no_op_returns_copy(self, data, request):
super().test_fillna_no_op_returns_copy(data)

def test_fillna_readonly(self, data_missing):
Copy link
Member

Choose a reason for hiding this comment

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

getting rid of this is perfect. i think there are other subclasses that override this too that we also want to get rid of

@Aniketsy
Copy link
Contributor Author

Aniketsy commented Dec 3, 2025

@jbrockmendel I've updated the code as per your suggestion. Please let me know if this also needs a whatsnew entry.

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.

not necessarily for this PR, but should we add an EA attribute specifying whether copy=False is ignored? that way we could avoid overriding tests?

2 participants