BUG: Fix compress_identical_objects ignoring remove_orphans parameter#3691
Closed
r266-tech wants to merge 1 commit intopy-pdf:mainfrom
Closed
BUG: Fix compress_identical_objects ignoring remove_orphans parameter#3691r266-tech wants to merge 1 commit intopy-pdf:mainfrom
r266-tech wants to merge 1 commit intopy-pdf:mainfrom
Conversation
The remove_orphans parameter was accepted but never checked, causing orphan objects to always be removed regardless of the parameter value. Fixes py-pdf#3306
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3691 +/- ##
=======================================
Coverage 97.43% 97.43%
=======================================
Files 55 55
Lines 10001 10002 +1
Branches 1837 1838 +1
=======================================
+ Hits 9744 9745 +1
Misses 149 149
Partials 108 108 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
|
Thanks for the PR. It seems like some checks are still failing. Additionally, we already have an open PR #3310 for this which hopefully is ready to be merged soon. In the meantime, I will leave your PR as-is. |
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.
Description
Fixes #3306
The
remove_orphansparameter inPdfWriter.compress_identical_objects()was accepted but never checked, causing orphan objects to always be removed regardless of the parameter value.Changes
if remove_orphans:checkremove_orphans=Falsepreserves orphan objects andremove_orphans=Trueremoves themVerification