Conversation
When using page_by with new_page=True (which triggers pagination and is commonly used with landscape orientation), the page_by columns were appearing as regular data columns instead of being used for pagination grouping only. Root cause: - SinglePageStrategy explicitly excludes page_by columns from headers when auto-generating them - PaginatedStrategy did not exclude page_by columns from the DataFrame - This caused page_by columns to appear as regular columns in paginated documents Changes: 1. Updated prepare_dataframe_for_body_encoding() to remove page_by columns from the processed DataFrame when new_page=True (similar to how subline_by columns are removed) 2. Updated PaginatedStrategy to adjust col_rel_width for both subline_by AND page_by columns when auto-generating headers Behavior: - page_by without new_page: columns appear as group headers (existing) - page_by with new_page=True: columns are removed from display, values are used for pagination grouping only (fixed) - subline_by: columns are removed, values appear as paragraph headers (unchanged) Fixes #126
Add explicit type annotation for excluded_cols variable to satisfy mypy type checker requirements.
Add unit test to verify that page_by columns are properly excluded from table display when new_page=True is used (commonly with landscape orientation). This test ensures that: 1. Page_by columns are removed from the output table 2. Only the non-page_by columns (ID, Event) appear in cells 3. Pagination (page breaks) occurs correctly 4. Data values from non-page_by columns are present This is a regression test to prevent issue #126 from recurring.
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.
No description provided.