Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

fix: remove base class to avoid type conflict#1619

Merged
ohmayr merged 4 commits intomainfrom
fix-metaclass-conflict-in-AuthorizedSession
Oct 30, 2024
Merged

fix: remove base class to avoid type conflict#1619
ohmayr merged 4 commits intomainfrom
fix-metaclass-conflict-in-AuthorizedSession

Conversation

@ohmayr
Copy link
Copy Markdown
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 a review from a team October 30, 2024 15:52
@ohmayr ohmayr requested a review from a team as a code owner October 30, 2024 15:52
@ohmayr ohmayr requested a review from sai-sunder-s October 30, 2024 15:53
@ohmayr ohmayr merged commit 9e2789a into main Oct 30, 2024
@ohmayr ohmayr deleted the fix-metaclass-conflict-in-AuthorizedSession branch October 30, 2024 17:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants