Repository navigation
BUG: Check the page label style and type it as the strings it accepts - #4017
Merged
stefan6419846 merged 3 commits intoAug 27, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4017 +/- ##
=======================================
Coverage 98.00% 98.00%
=======================================
Files 57 57
Lines 11143 11145 +2
Branches 2091 2092 +1
=======================================
+ Hits 10921 10923 +2
Misses 124 124
Partials 98 98 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
RavSinghChandan
force-pushed
the
validate-page-label-style
branch
2 times, most recently
from
August 26, 2026 11:54
83638c4 to
e92fe87
Compare
stefan6419846
requested changes
Aug 26, 2026
set_page_label validates its indices, its start and that a style or prefix is given, but not the style itself, so an unknown one was written into /S and then dropped on the way back out: index2label logs 'Ignoring unknown page label numbering style' and falls back to the page position, leaving the caller with plain numbers and a log line. The style was also annotated Optional[PageLabelStyle], which is a plain class holding the five string constants rather than a type any caller can satisfy. Typed as the literal strings it takes, which clears two typeguard failures.
The class held the five style strings but was used as a type, so the annotation could not be satisfied by the strings every caller passes. Making it a StrEnum, as FilterTypes already is, lets the annotation name it directly and the validation check membership, so the separate Literal alias goes away.
RavSinghChandan
force-pushed
the
validate-page-label-style
branch
from
August 27, 2026 02:40
e92fe87 to
e1156e1
Compare
Contributor
Author
|
Agreed, that's the better fix. PageLabelStyle is a StrEnum now like FilterTypes, so the annotation can name it directly and the separate alias is gone. |
stefan6419846
previously approved these changes
Aug 27, 2026
stefan6419846
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
set_page_labelvalidates its indices, itsstartand that a style or prefix is given, but not the style itself:index2labellogs "Ignoring unknown page label numbering style" and falls back to the page position, so the caller is left with plain numbers and a log line.The style was also annotated
Optional[PageLabelStyle], which is a plain class holding the five string constants rather than a type any caller can satisfy - every caller passes"/D". Typed as the literal strings it takes, which clears two typeguard failures.Reverting the change fails the four new tests