Skip to content

Commit 8027341

Browse files
committed
sanity checks
1 parent dd372ab commit 8027341

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

examples/notebook/notebook_execution.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,12 @@
5555
)
5656

5757
query_executions_response = client.query_executions(query_request)
58+
59+
# Cancel execution
60+
cancel_execution_response = client.cancel_executions(["your_execution_id"])
61+
62+
# Retry execution
63+
retry_execution_response = client.retry_executions(["your_execution_id"])
64+
65+
# Create execution from existing one
66+
run_new = client.create_executions_from_existing(["your_execution_id"])

nisystemlink/clients/notebook/_notebook_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ def query_executions(
304304

305305
@response_handler(_simple_response_handler)
306306
@post("ninbexecution/v1/retry-executions")
307-
def retry_executions(self, ids: List[str]) -> None:
307+
def retry_executions(self, ids: List[str]) -> dict:
308308
"""Retries existing executions based on failed, canceled or timed-out executions.
309309
310310
Args:
@@ -321,7 +321,7 @@ def retry_executions(self, ids: List[str]) -> None:
321321

322322
@response_handler(_simple_response_handler)
323323
@post("ninbexecution/v1/cancel-executions")
324-
def cancel_executions(self, ids: List[str]) -> None:
324+
def cancel_executions(self, ids: List[str]) -> dict:
325325
"""Cancel queued and in-progress executions.
326326
327327
Args:

nisystemlink/clients/notebook/models/_execution.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class Execution(JsonModel):
149149
last_updated_timestamp: datetime
150150
"""Timestamp of when the notebook execution was last updated."""
151151

152-
last_updated_by: str
152+
last_updated_by: Optional[str] = None
153153
""""The user ID of the user who last updated the execution."""
154154

155155
retry_count: int
@@ -167,7 +167,7 @@ class Execution(JsonModel):
167167
report_settings: ReportSettings
168168
"""Settings of the Report"""
169169

170-
result: Optional[Dict[str, Optional[str]]] = None
170+
result: Optional[Dict[str, Optional[object]]] = None
171171
"""Result of the execution. This is used only when status is SUCCEEDED."""
172172

173173
source: Source

0 commit comments

Comments
 (0)