Skip to content

Conversation

@HSY-999
Copy link

@HSY-999 HSY-999 commented Nov 21, 2025

see #3467

there are a couple different solutions. this is the one i made.

for my solution, i have to assume that the key name inside DictionaryObject == __init__ parameter names. for example /Vertices and vertices. with these changes the example in #3467 exits normally.

i had to modify the __init__ logic for Polygon and PolyLine, as they both expected tuples which is not the format they are stored in DictionaryObject

if we agree this is acceptable solution, i will also add test case adapted from the issue.

@HSY-999 HSY-999 changed the title BUG: fix for merge page #3467 BUG: fix for merge page with annotation #3467 Nov 21, 2025
Copy link
Collaborator

@stefan6419846 stefan6419846 left a comment

Choose a reason for hiding this comment

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

Please have a look at the test failures and add appropriate tests.

Additionally, while your current approach might work for the current cases, I see some limitations/aspects to discuss:

  • What happens to keyword-only arguments?
  • What happens to unmatched keys?
  • What happens to keys which have to be renamed for some reasons, for example because they conflict with an existing name (like a builtin)?

Please provide some details on how you think about this and what your proposals for mitigating them are.

@HSY-999
Copy link
Author

HSY-999 commented Nov 24, 2025

* What happens to keyword-only arguments?

it does not work in a small example, but inspect does support matching on keyword arguments in a different list[str] with kwonlyargs. an additional check for this would suffice.

* What happens to unmatched keys?

they are not passed along to __init__ of the class we are trying to clone.

* What happens to keys which have to be renamed for some reasons, for example because they conflict with an existing name (like a builtin)?

good point. i will think on this. i am thinking of having some internal value in DictionaryObject or PdfObject which allow a developer to write its own key value pair if they are not the same.

@HSY-999 HSY-999 marked this pull request as draft November 25, 2025 21:37
@HSY-999
Copy link
Author

HSY-999 commented Nov 25, 2025

i made changes to the pull request based on feedback. i still need to implement automated test, as well as research renaming keys. i have converted the pull request to a draft and will change the pull request when it is ready for review again.

@codecov
Copy link

codecov bot commented Nov 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.16%. Comparing base (2f1b63e) to head (5266c84).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3532   +/-   ##
=======================================
  Coverage   97.15%   97.16%           
=======================================
  Files          56       56           
  Lines        9785     9814   +29     
  Branches     1785     1790    +5     
=======================================
+ Hits         9507     9536   +29     
  Misses        167      167           
  Partials      111      111           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stefan6419846 stefan6419846 linked an issue Dec 3, 2025 that may be closed by this pull request
@HSY-999 HSY-999 marked this pull request as ready for review December 5, 2025 21:23
@HSY-999 HSY-999 marked this pull request as draft December 5, 2025 21:28
@HSY-999
Copy link
Author

HSY-999 commented Dec 5, 2025

i have introduced changes based on feedback. i still need to think about a solution to the keys conflicting with python builtins.

@HSY-999 HSY-999 marked this pull request as ready for review December 9, 2025 18:06
@HSY-999
Copy link
Author

HSY-999 commented Dec 9, 2025

i have implemented possible solution for renaming keyword args. @stefan6419846 it is available to review when you are ready.

for the set_alt_arg_name function, you provide it keyword stored in DictionaryObject, and the value is the argument name. for example:

"/Vertices" -> "vertices"

@HSY-999 HSY-999 requested a review from stefan6419846 December 9, 2025 21:58
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.

merge_page with passed page having markup annotation fails

2 participants