-
Notifications
You must be signed in to change notification settings - Fork 8
feat: add environments #353
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
Conversation
☂️ Python Coverage
Overall Coverage
New Files
Modified Files
|
3391873 to
eddfc31
Compare
f552fe2 to
2942856
Compare
| endpoint = self._ctx.url + self._path | ||
| response = self._ctx.session.put(endpoint, json=attributes) | ||
| result = response.json() | ||
| super().update(**result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would we like for this method to return a new definition of self?
Something like
| super().update(**result) | |
| return self.__class__(**result) |
This sets up an easy transition to a read only self.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with keeping the .update() as is. I'd like to make a followup PR to revert Task.update and ContentItemRepository.update
| id: str, | ||
| guid: str, | ||
| created_time: str, | ||
| updated_time: str, | ||
| title: str, | ||
| name: str, | ||
| description: str | None, | ||
| cluster_name: str | Literal["Kubernetes"], | ||
| environment_type: str | Literal["Kubernetes"], | ||
| matching: Literal["any", "exact", "none"], | ||
| supervisor: str | None, | ||
| python: _Installations | None, | ||
| quarto: _Installations | None, | ||
| r: _Installations | None, | ||
| tensorflow: _Installations | None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these variables be Unpack[_Attrs] so that if typing isn't followed 100% there is some sort of type check?
Something like:
def __init__(self, ctx: Context, path: str, /, **attributes: Unpack[_Attrs]):There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same applies to .update(), .create(), and .find_by() below
|
Closing in favor of #355 |
Adds environment support.
The create, update, and destroy methods are abstracted in the resources module as base classes. This alleviates potential duplication across API bindings. Future changes should utilize these classes instead of reimplementing these methods from scratch.
Closes #307