Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: deprecation.deprecated decorator does not behave correctly for class instance methods. #26

Closed
jayaddison opened this issue Mar 21, 2024 · 1 comment · Fixed by #27
Assignees
Labels
bug Something isn't working

Comments

@jayaddison
Copy link
Owner

Background

This is a bug introduced in v0.3.2 by pull request #25.

In particular it relates to the @deprecated decorator that was introduced to indicate that borderless-accounts endpoints are no longer recommended.

Problem

The positional arguments that the decorator passes to the underlying instance method appear to be incorrect or missing.

The bug causes errors of the form: TypeError: Class.method() missing 1 required positional argument to appear.

@jayaddison jayaddison added the bug Something isn't working label Mar 21, 2024
@jayaddison jayaddison self-assigned this Mar 21, 2024
@jayaddison
Copy link
Owner Author

Note: because the bug appears to be that the self argument is not provided to instance methods at call-time, and because we do have access to the instance objects in the API, there is an ugly workaround for this: for any @deprecated methods (that is, they are defined on a Python class), the self argument can be passed manually:

client.borderless_accounts.list(client.borderless_accounts, profile_id)[0].balances

@jayaddison jayaddison pinned this issue Mar 23, 2024
@jayaddison jayaddison unpinned this issue Mar 27, 2024
Repository owner locked as resolved and limited conversation to collaborators Sep 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant