Skip to content

fix: use isupper/islower for case validators#1775

Open
Chessing234 wants to merge 2 commits into
allenai:mainfrom
Chessing234:fix/uppercase-lowercase-isupper
Open

fix: use isupper/islower for case validators#1775
Chessing234 wants to merge 2 commits into
allenai:mainfrom
Chessing234:fix/uppercase-lowercase-isupper

Conversation

@Chessing234

@Chessing234 Chessing234 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • text == text.upper()/lower() accepted empty and digit-only strings.
  • Use str.isupper / str.islower like IFEvalG.

Test plan

  • TestValidateUpperLower

GPU_TESTS=bypass
CHANGELOG=

Chessing234 and others added 2 commits July 18, 2026 19:54
text == text.upper() accepted empty and digit-only strings; match IFEvalG.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the validate_uppercase and validate_lowercase functions in open_instruct/if_functions.py to use Python's built-in str.isupper() and str.islower() methods instead of comparing the string to its upper/lower-cased version. This ensures that empty strings and strings containing only non-letter characters correctly fail validation. Additionally, corresponding unit tests have been added to open_instruct/test_if_functions.py to verify these behaviors, and the CHANGELOG.md has been updated. There are no review comments, so I have 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.

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.

1 participant