Immutable solution version
subscriptions.get_next() TypeError: upgrade mollie-api-python to 3.6.0
Complete solution
Shows how to fix subscriptions.get_next() TypeError: upgrade mollie-api-python to 3.6.0. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Upgrade mollie-api-python to 3.6.0 or later, where this was fixed (PR 323 reworked the resource path handling so the parent context is no longer needed). A working proof of concept landed in PR 323, and the maintainer confirmed the issue was resolved in release 3.6.0.
Steps
- If subscriptions.getnext() throws TypeError: init_() missing 1 required positional argument: 'customer', you are on a version with the nested pagination bug: the next page rebuilds the resource without the parent Customer context. Upgrade mollie-api-python to 3.6.0 or later, where this was fixed (PR 323 reworked the resource path handling so the parent context is no longer needed). The maintainer confirmed the fix in the 3.6.0 release. Note this bug class affected all nested list resources (refunds, chargebacks, captures, shipments, mandates), so if you paginate any of those, the same upgrade applies.
Expected: The maintainer confirmed the fix in the 3.6.0 release.
When to use
You are seeing this: Calling getnext() on a subscription list raised TypeError: init() missing 1 required positional argument: customer. Use this skill when you run into "subscriptions.getnext() TypeError: upgrade mollie-api-python to 3.6.0".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: 3.6.0. If you are on something much newer or older, the details may have shifted.
Why this happens
A maintainer explained the root cause: subscriptions are nested CustomerSubscription objects, and the generic ObjectList pagination path rebuilt the next page without the parent Customer
Edge cases
- Note this bug class affected all nested list resources (refunds, chargebacks, captures, shipments, mandates), so if you paginate any of those, the same upgrade applies.
Evidence
In gh:mollie/mollie-api-python#315 (https://github.com/mollie/mollie-api-python/issues/315), the reporter ran into this: Calling getnext() on a subscription list raised TypeError: init() missing 1 required positional argument: customer. A maintainer explained the root cause: subscriptions are nested CustomerSubscription objects, and the generic ObjectList pagination path rebuilt the next page without the parent Customer context needed to construct the resource. A working proof of concept landed in PR 323, and the maintainer confirmed the issue was resolved in release 3.6.0. The verified resolution: If subscriptions.getnext() throws TypeError: init() missing 1 required positional argument: 'customer', you are on a version with the nested pagination bug: the next page rebuilds the resource without the parent Customer context. Upgrade mollie-api-python to 3.6.0 or later, where this was fixed (PR 323 reworked the resource path handling so the parent context is no longer needed). The maintainer confirmed the fix in the 3.6.0 release. Note this bug class affected all nested list resources (refunds, chargebacks, captures, shipments, mandates), so if you paginate any of those, the same upgrade applies.
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_HORdcX_xMbBfRBQ8NAXKPA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">subscriptions.get_next() TypeError: upgrade mollie-api-python to 3.6.0 <span>— Vectle</span></a>