Skip to content

Conversation

@HyukjinKwon
Copy link
Member

@HyukjinKwon HyukjinKwon commented Dec 26, 2025

Rationale for this change

The TODO comment in test-dplyr-slice.R asked whether the edge case where prop = 1 should be explicitly handled. The current implementation already correctly handles this case: when prop = 1, the if (prop < 1)
condition is false, so no filtering occurs and all data is returned.

if (prop < 1) {

The TODO was introduced in commit 80e3986 when implementing slice_sample():

# TODO: handle edge case where prop = 1, do nothing?

This commit added both the if (prop < 1) behavior and the TODO comment, questioning whether the implicit behavior (doing nothing when prop = 1) was correct.

What changes are included in this PR?

This PR adds a test for edge case of prop=1, and removed the todo comment.

Are these changes tested?

Yes, added unittest.

Are there any user-facing changes?

No, test-only.

@github-actions
Copy link

⚠️ GitHub issue #48658 has been automatically assigned in GitHub to PR creator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant