Skip to content

Commit 1dedd97

Browse files
committed
feedback
1 parent 8027341 commit 1dedd97

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

nisystemlink/clients/notebook/_notebook_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from . import models
2121

2222

23-
def _query_executions_response_handler(response: Response) -> List[models.Execution]:
23+
def __query_executions_response_handler(response: Response) -> List[models.Execution]:
2424
if response is None:
2525
return []
2626

@@ -70,7 +70,7 @@ def get_notebook(self, id: str) -> models.NotebookMetadata:
7070
...
7171

7272
@put("ninotebook/v1/notebook/{id}")
73-
def _update_notebook(
73+
def __update_notebook(
7474
self,
7575
id: Path,
7676
metadata: Part = None,
@@ -117,7 +117,7 @@ def update_notebook(
117117
metadata_str = metadata.json()
118118
metadata_io = io.BytesIO(metadata_str.encode("utf-8"))
119119

120-
return self._update_notebook(
120+
return self.__update_notebook(
121121
id=id,
122122
metadata=metadata_io,
123123
content=content,
@@ -252,9 +252,9 @@ def get_execution_by_id(self, id: str) -> models.Execution:
252252
"""
253253
...
254254

255-
@response_handler(_query_executions_response_handler)
255+
@response_handler(__query_executions_response_handler)
256256
@post("ninbexecution/v1/query-executions")
257-
def _query_executions(
257+
def __query_executions(
258258
self, query: models._QueryExecutionsRequest
259259
) -> List[models.QueryExecutionResponse]:
260260
"""Query executions of Jupyter notebooks.
@@ -300,7 +300,7 @@ def query_executions(
300300

301301
query_request = models._QueryExecutionsRequest(**query_params)
302302

303-
return self._query_executions(query=query_request)
303+
return self.__query_executions(query=query_request)
304304

305305
@response_handler(_simple_response_handler)
306306
@post("ninbexecution/v1/retry-executions")

nisystemlink/clients/notebook/models/_execution.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -111,33 +111,33 @@ class ExecutionErrorCode(str, Enum):
111111
class Execution(JsonModel):
112112
"""Information about an execution of a Jupyter notebook that has the cachedResult field added."""
113113

114-
id: str
114+
id: Optional[str] = None
115115
"""The ID of the execution."""
116116

117-
notebook_id: str
117+
notebook_id: Optional[str] = None
118118
"""The ID of the executed notebook."""
119119

120-
organization_id: str = Field(alias="orgId")
120+
organization_id: Optional[str] = Field(alias="orgId")
121121
"""The org ID of the user creating the request."""
122122

123-
user_id: str
123+
user_id: Optional[str] = None
124124
"""The user ID of the user creating the request."""
125125

126126
parameters: Optional[Dict[str, Any]] = None
127127
"""The input parameters for this execution of the notebook. The keys are strings and the values can be of any
128128
valid JSON type."""
129129

130-
workspace_id: str
130+
workspace_id: Optional[str] = None
131131
"""The ID of the workspace this execution belongs to."""
132132

133-
timeout: int
133+
timeout: Optional[int] = None
134134
"""The number of seconds the execution runs before it aborts if uncompleted. The timer starts once status is
135135
IN_PROGRESS. 0 means infinite."""
136136

137-
status: ExecutionStatus
137+
status: Optional[ExecutionStatus] = None
138138
"""Status of an execution."""
139139

140-
queued_at: datetime
140+
queued_at: Optional[datetime] = None
141141
"""Timestamp of when the notebook execution was queued."""
142142

143143
started_at: Optional[datetime] = None
@@ -146,35 +146,35 @@ class Execution(JsonModel):
146146
completed_at: Optional[datetime] = None
147147
"""Timestamp of when the notebook execution was completed."""
148148

149-
last_updated_timestamp: datetime
149+
last_updated_timestamp: Optional[datetime] = None
150150
"""Timestamp of when the notebook execution was last updated."""
151151

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

155-
retry_count: int
155+
retry_count: Optional[int]
156156
"""The number of manually retried attempts of the notebook execution."""
157157

158158
exception: Optional[str] = None
159159
"""Exception that occured during the execution. This is used only when status is FAILED."""
160160

161-
error_code: ExecutionErrorCode
161+
error_code: Optional[ExecutionErrorCode] = None
162162
"""Execution error code."""
163163

164164
report_id: Optional[str] = None
165165
"""The ID of the report this execution generates."""
166166

167-
report_settings: ReportSettings
167+
report_settings: Optional[ReportSettings] = None
168168
"""Settings of the Report"""
169169

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

173-
source: Source
173+
source: Optional[Source] = None
174174
"""An object that defines properties set by routine service"""
175175

176-
priority: ExecutionPriority
176+
priority: Optional[ExecutionPriority] = None
177177
"""Execution priority. Can be one of Low, Medium or High."""
178178

179-
resource_profile: ExecutionResourceProfile
179+
resource_profile: Optional[ExecutionResourceProfile] = None
180180
"""Resource profile of the execution."""

0 commit comments

Comments
 (0)