-
Notifications
You must be signed in to change notification settings - Fork 41
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
[IO-1461][IO-1820] Code Documentation + exception refactoring + mypy checking #701
Conversation
IO-1461 Docblock document Query.where
Add a docblock with:
|
IO-1820 Include params and returns in docblocks in darwin.future
Some functions in darwin-py Expand to include params and returns, e.g. From
|
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.
Yep, a lot of it, but good stuff.
@@ -16,10 +16,13 @@ def remove_dataset( | |||
The client to use to make the request | |||
id : int | |||
The name of the dataset to create | |||
team_slug : str |
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.
Good catch
@@ -43,6 +45,30 @@ def from_exception(cls, exc: Exception) -> "DarwinException": | |||
|
|||
return instance | |||
|
|||
@classmethod |
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.
Could've sworn we already had this!
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.
we do in the old code version, I just copied it across and modified a little
@@ -14,7 +14,7 @@ def _collect(self) -> List[Stage]: | |||
raise ValueError("Must specify workflow_id to query stages") | |||
workflow_id: UUID = self.meta_params["workflow_id"] | |||
meta_params = self.meta_params | |||
workflow, exceptions = get_workflow(self.client, str(workflow_id)) | |||
workflow = get_workflow(self.client, str(workflow_id)) |
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.
Maybe need handling of the exceptions here? Consideration point
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.
good point, I'll add something in. At least a print on failed validations
Problem
Some undocumented code and dogfooding issues have accrued
Solution
fix the following:
The List[Exception] Paradigm now only exists for things that parse multiple objects. It should raise on other issues like exceptions from underlying http request, but will attempt to parse all objects before failing.
Changelog
Added documentation and dogfooding refactors to futures code