Skip to content
New issue

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

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

Already on GitHub? # to your account

Refactor Collection superclass #186

Merged
merged 12 commits into from
Nov 5, 2023
Merged

Refactor Collection superclass #186

merged 12 commits into from
Nov 5, 2023

Conversation

mattt
Copy link
Contributor

@mattt mattt commented Nov 5, 2023

This PR removes abstract methods from base collection, leaving each collection to define its own get / create / list methods on its own terms.

The primary benefit to having abstract methods defined was to reuse shared logic for reload, but that method is short and required additional maneuvering to define an id field. The downside of this tight coupling was that resources were required to implement methods that would raise NotImplemented. And their signatures for create methods were inflexible, requiring either a mismatch with the parent class or an elaborate workaround with overloads and unpacked typed dict kwargs.

mattt added 12 commits November 5, 2023 04:03
Signed-off-by: Mattt Zmuda <mattt@replicate.com>
Signed-off-by: Mattt Zmuda <mattt@replicate.com>
Signed-off-by: Mattt Zmuda <mattt@replicate.com>
Signed-off-by: Mattt Zmuda <mattt@replicate.com>
Signed-off-by: Mattt Zmuda <mattt@replicate.com>
Signed-off-by: Mattt Zmuda <mattt@replicate.com>
Add field for _client

Signed-off-by: Mattt Zmuda <mattt@replicate.com>
Signed-off-by: Mattt Zmuda <mattt@replicate.com>
Signed-off-by: Mattt Zmuda <mattt@replicate.com>
Signed-off-by: Mattt Zmuda <mattt@replicate.com>
Signed-off-by: Mattt Zmuda <mattt@replicate.com>
Use predictions.get method instead

Signed-off-by: Mattt Zmuda <mattt@replicate.com>
@mattt mattt merged commit 61922f8 into main Nov 5, 2023
@mattt mattt deleted the mattt/refactor-collection branch November 5, 2023 12:54
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant