Skip to content

fix(pika): use ObjectProxy for ReadyMessagesDequeProxy to restore iterability with wrapt 2.x#4461

Merged
xrmx merged 3 commits into
open-telemetry:mainfrom
honeycombio:mike/pika-objectproxy
Apr 20, 2026
Merged

fix(pika): use ObjectProxy for ReadyMessagesDequeProxy to restore iterability with wrapt 2.x#4461
xrmx merged 3 commits into
open-telemetry:mainfrom
honeycombio:mike/pika-objectproxy

Conversation

@MikeGoldsmith

@MikeGoldsmith MikeGoldsmith commented Apr 17, 2026

Copy link
Copy Markdown
Member

Description

The wrapt 2.x migration (PR #4203) switched ReadyMessagesDequeProxy from ObjectProxy to BaseObjectProxy. In wrapt 2.x, BaseObjectProxy no longer proxies __iter__(), which breaks iteration over the wrapped deque.

This switches ReadyMessagesDequeProxy to use ObjectProxy which proxies all dunder methods including __iter__, restoring full deque behavior through the proxy.

ObjectProxy exists in both wrapt 1.x and 2.x so the compatibility shim is no longer needed.

Contributes to #4462

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Added test_deque_proxy_is_iterable test that verifies iteration over the proxied deque
  • All 31 existing pika tests pass with both wrapt 1.x and wrapt 2.x

Does This PR Require a Core Repo Change?

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

wrapt 2.x BaseObjectProxy does not proxy __iter__, breaking iteration
over the wrapped deque. Switch to ObjectProxy which proxies all dunder
methods including __iter__.

Assisted-by: Claude Opus 4.6
Assisted-by: Claude Opus 4.6
@MikeGoldsmith MikeGoldsmith moved this to Ready for review in Python PR digest Apr 17, 2026
@xrmx xrmx mentioned this pull request Apr 17, 2026
4 tasks
@github-project-automation github-project-automation Bot moved this from Ready for review to Approved PRs in Python PR digest Apr 17, 2026
@xrmx

xrmx commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

@MikeGoldsmith could you please check what's wrong with precommit?

Assisted-by: Claude Opus 4.6
@xrmx
xrmx merged commit 6c8e64e into open-telemetry:main Apr 20, 2026
750 of 752 checks passed
@github-project-automation github-project-automation Bot moved this from Approved PRs to Done in Python PR digest Apr 20, 2026
@MikeGoldsmith
MikeGoldsmith deleted the mike/pika-objectproxy branch April 20, 2026 08:19
xrmx added a commit that referenced this pull request Apr 24, 2026
…rability with wrapt 2.x (#4461) (#4485)

* use ObjectProxy for pika ReadyMessagesDequeProxy to restore iterability

wrapt 2.x BaseObjectProxy does not proxy __iter__, breaking iteration
over the wrapped deque. Switch to ObjectProxy which proxies all dunder
methods including __iter__.

Assisted-by: Claude Opus 4.6

* update changelog with PR number

Assisted-by: Claude Opus 4.6

* fix lint: import ordering and formatting

Assisted-by: Claude Opus 4.6

Co-authored-by: Mike Goldsmith <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants