Skip to content

Conversation

@dpriskorn
Copy link
Contributor

fixes #916

@dpriskorn
Copy link
Contributor Author

Not ready yet

DEBUG:wikibaseintegrator.wbi_helpers:{'action': 'wbmergeitems', 'fromid': 'Q333', 'toid': 'Q70', 'format': 'json', 'ignoreconflicts': 'description', 'bot': '', 'tags': 'wikibaseintegrator', 'token': '<token>+\\', 'assert': 'bot', 'maxlag': 5}
DEBUG:urllib3.connectionpool:https://dance.wikibase.cloud:443 "POST /w/api.php HTTP/1.1" 200 104
Merged Q333 into Q70
INFO:wikibaseintegrator.wbi_helpers:Creating redirect from Q333 → Q70
DEBUG:wikibaseintegrator.wbi_helpers:{'action': 'wbeditentity', 'id': 'Q333', 'clear': 'true', 'summary': 'Clearing Q333 to prepare for redirect', 'format': 'json', 'token': '<token>+\\', 'assert': 'bot', 'maxlag': 5}
DEBUG:urllib3.connectionpool:https://dance.wikibase.cloud:443 "POST /w/api.php HTTP/1.1" 200 236
ERROR:wikibaseintegrator.wbi_helpers:Exception when creating redirect Q333 → Q70: 'The "data" parameter must be set.'

@LeMyst
Copy link
Owner

LeMyst commented Oct 13, 2025

Hello @dpriskorn
Thank you for this PR.
I think there is changes needed :

  • Don't remove the merge_items function, to avoid breaking changes.
  • I think you can add two parameters, a boolean create_redirect, False by default. And a merge_logic with an enum TO_LOWEST/TO_HIGHEST/DEFAULT, to override the logic in the parameters "to" and "from".

What do you think about theses changes?

@dpriskorn
Copy link
Contributor Author

Hello @dpriskorn Thank you for this PR. I think there is changes needed :

* Don't remove the merge_items function, to avoid breaking changes.

* I think you can add two parameters, a boolean create_redirect, False by default. And a merge_logic with an enum TO_LOWEST/TO_HIGHEST/DEFAULT, to override the logic in the parameters "to" and "from".

What do you think about theses changes?

I like your suggestions :) My code was basically a quick hack.

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.

Feature request: Add default merge strategy to merge_items and support merging >2 items

2 participants