Skip to content

Rename BaseModel and Collection to Resource and Namespace #188

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

Merged
merged 3 commits into from
Nov 7, 2023

Conversation

mattt
Copy link
Contributor

@mattt mattt commented Nov 7, 2023

This removes some ambiguity with pydantic.BaseModel and Replicate models, and resolves a naming conflict with Replicate model collections.

API consumers are unlikely to interact with these symbols directly, so this change should be largely backward compatible.

mattt added 3 commits November 7, 2023 03:07
Signed-off-by: Mattt Zmuda <mattt@replicate.com>
Move Namespace to resource.py

Signed-off-by: Mattt Zmuda <mattt@replicate.com>
…form

Signed-off-by: Mattt Zmuda <mattt@replicate.com>
@mattt mattt merged commit 7a058fb into main Nov 7, 2023
@mattt mattt deleted the mattt/namespace branch November 7, 2023 11:23
mattt added a commit that referenced this pull request Nov 7, 2023
Related to #188 

API resources define a common `id` field, which requires additional
bookkeeping in `_prepare_model`. However, these fields aren't used, and
either shadow a field on the resource or can be computed. This PR
removes `id` from the base model, adds properties for subclasses that
don't have an `id` field (like `Hardware` and `Collection`), and marks
them as deprecated, for anyone who is relying on that behavior.

---------

Signed-off-by: Mattt Zmuda <mattt@replicate.com>
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.

1 participant