fix: ignore empty trailing pieces in sentence count#1780
Conversation
A terminator at the end of the text produced an extra empty split. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Code Review
This pull request updates the verify_sentence_constraint function in open_instruct/if_functions.py to filter out empty or whitespace-only strings resulting from splitting sentences with trailing terminators. Additionally, a new test suite TestVerifySentenceConstraint has been added to open_instruct/test_if_functions.py to validate this behavior, and the CHANGELOG.md has been updated accordingly. There are no review comments, so there is no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
Test plan
TestVerifySentenceConstraintGPU_TESTS=bypass
CHANGELOG=