Skip to content

Conversation

@aborem
Copy link
Collaborator

@aborem aborem commented Jul 21, 2025

While working on #5 , I realized that extending OAuth2Session was a bit overkill since we don't need the level of configurability it provides (e.g., fetch_token's 16 arguments, of which we'll only ever use two).

IIRC, it's usually better not to use inheritance in cases like these anyway (composition over inheritance?).

@aborem aborem requested a review from alexbainter July 21, 2025 20:22
Copy link
Collaborator

@alexbainter alexbainter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me!

@aborem aborem merged commit c62262b into main Jul 22, 2025
1 check passed
@aborem aborem deleted the aborem/base-service-uses-composition branch July 22, 2025 03:55
aborem added a commit that referenced this pull request Jul 22, 2025
Closes #5 

Also adds two new abstract methods to the BaseTransferService. We used
to get them for free when BaseTransferService was extending
OAuth2Session, but no longer since #24 .
aborem added a commit that referenced this pull request Jul 25, 2025
Closes #30 and discussed in
dtinit/pardner-site#10 (comment)

* Creates stateless OAuth functions in `src/pardner/stateless/base.py`,
which are adapted from the base service transfer class and its methods
created in #24 #16 . Eventually other stateless functions will use these
to make their requests (they're essentially wrappers for these core
ones).
* Extracts common logic and helpers in tests into conftest.py. Also
needed to create new directories and modules in the test directory

This doesn't change anything about the existing classes because using a
class instance implies that you're okay with state, so making those
optionally stateless is not necessary.
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.

3 participants