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

fix: remove base class to avoid type conflict #1619

Merged
merged 4 commits into from
Oct 30, 2024

Conversation

ohmayr
Copy link
Contributor

@ohmayr ohmayr commented Oct 30, 2024

Temporarily removing _BaseAuthorizedSession as a parent of AuthorizedSession to avoid type conflict between the meta classes of _BaseAuthorizedSession (i.e. abc.ABCMeta) and requests.Session (i.e. type) .

Possible solutions to tackle this are:

  • change / remove the metaclass of _BaseAuthorizedSession. However, we lose the ability to enforce the methods in subclasses.
  • compose requests.Session within AuthorizedSession instead of using inheritance. However, this changes behaviour i.e. the underlying api methods are currently exposed via AuthorizedSession. We can probably define those methods (get, post, put, etc) directly in the AuthorizedSession class.

@ohmayr ohmayr requested review from a team as code owners October 30, 2024 15:52
@ohmayr ohmayr merged commit 9e2789a into main Oct 30, 2024
15 checks passed
@ohmayr ohmayr deleted the fix-metaclass-conflict-in-AuthorizedSession branch October 30, 2024 17:49
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.

2 participants