dnastack-client-library 3.1.159__py3-none-any.whl → 3.1.162__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dnastack/cli/commands/workbench/runs/commands.py +14 -0
- dnastack/client/explorer/client.py +8 -13
- dnastack/client/workbench/ewes/models.py +7 -3
- dnastack/constants.py +1 -1
- dnastack/http/session.py +15 -6
- {dnastack_client_library-3.1.159.dist-info → dnastack_client_library-3.1.162.dist-info}/METADATA +1 -1
- {dnastack_client_library-3.1.159.dist-info → dnastack_client_library-3.1.162.dist-info}/RECORD +11 -11
- {dnastack_client_library-3.1.159.dist-info → dnastack_client_library-3.1.162.dist-info}/WHEEL +0 -0
- {dnastack_client_library-3.1.159.dist-info → dnastack_client_library-3.1.162.dist-info}/entry_points.txt +0 -0
- {dnastack_client_library-3.1.159.dist-info → dnastack_client_library-3.1.162.dist-info}/licenses/LICENSE +0 -0
- {dnastack_client_library-3.1.159.dist-info → dnastack_client_library-3.1.162.dist-info}/top_level.txt +0 -0
|
@@ -473,6 +473,13 @@ def init_runs_commands(group: Group):
|
|
|
473
473
|
help='If specified, the command will print the request without actually submitting the workflow.',
|
|
474
474
|
type=bool,
|
|
475
475
|
),
|
|
476
|
+
ArgumentSpec(
|
|
477
|
+
name='run_requests',
|
|
478
|
+
arg_names=['--run-request'],
|
|
479
|
+
help='Optional way to specify a complete run request for one or more runs. ',
|
|
480
|
+
type=JsonLike,
|
|
481
|
+
multiple=True
|
|
482
|
+
),
|
|
476
483
|
ArgumentSpec(
|
|
477
484
|
name='sample_ids',
|
|
478
485
|
arg_names=['--samples'],
|
|
@@ -496,6 +503,7 @@ def init_runs_commands(group: Group):
|
|
|
496
503
|
workflow_params: JsonLike,
|
|
497
504
|
input_overrides,
|
|
498
505
|
dry_run: bool,
|
|
506
|
+
run_requests: JsonLike,
|
|
499
507
|
sample_ids: Optional[str]):
|
|
500
508
|
"""
|
|
501
509
|
Submit one or more workflows for execution
|
|
@@ -579,6 +587,12 @@ def init_runs_commands(group: Group):
|
|
|
579
587
|
samples=parse_samples()
|
|
580
588
|
)
|
|
581
589
|
|
|
590
|
+
for run_request in run_requests:
|
|
591
|
+
parsed_value = run_request.parsed_value() if run_request else None
|
|
592
|
+
parsed_run_request = ExtendedRunRequest(**parsed_value)
|
|
593
|
+
batch_request.run_requests.append(parsed_run_request)
|
|
594
|
+
|
|
595
|
+
|
|
582
596
|
for workflow_param in workflow_params:
|
|
583
597
|
run_request = ExtendedRunRequest(
|
|
584
598
|
workflow_params=workflow_param.parsed_value() if workflow_param else None
|
|
@@ -91,11 +91,9 @@ class ExplorerClient(BaseServiceClient):
|
|
|
91
91
|
f"Not authorized to access question '{question_id}'"
|
|
92
92
|
)
|
|
93
93
|
elif status_code == 404:
|
|
94
|
-
raise ClientError(f"Question '{question_id}' not found")
|
|
94
|
+
raise ClientError(e.response, e.trace, f"Question '{question_id}' not found")
|
|
95
95
|
else:
|
|
96
|
-
raise ClientError(
|
|
97
|
-
f"Failed to retrieve question '{question_id}': {e.response.text}"
|
|
98
|
-
)
|
|
96
|
+
raise ClientError(e.response, e.trace, f"Failed to retrieve question '{question_id}'")
|
|
99
97
|
|
|
100
98
|
def ask_federated_question(
|
|
101
99
|
self,
|
|
@@ -179,9 +177,8 @@ class FederatedQuestionListResultLoader(ResultLoader):
|
|
|
179
177
|
"Not authorized to list federated questions"
|
|
180
178
|
)
|
|
181
179
|
else:
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
)
|
|
180
|
+
|
|
181
|
+
raise ClientError(e.response, e.trace, "Failed to load federated questions")
|
|
185
182
|
|
|
186
183
|
|
|
187
184
|
class FederatedQuestionQueryResultLoader(ResultLoader):
|
|
@@ -247,10 +244,8 @@ class FederatedQuestionQueryResultLoader(ResultLoader):
|
|
|
247
244
|
"Not authorized to ask federated questions"
|
|
248
245
|
)
|
|
249
246
|
elif status_code == 400:
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
)
|
|
247
|
+
|
|
248
|
+
raise ClientError(e.response, e.trace, "Invalid question parameters")
|
|
253
249
|
else:
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
)
|
|
250
|
+
|
|
251
|
+
raise ClientError(e.response, e.trace, "Failed to execute federated question")
|
|
@@ -86,6 +86,8 @@ class Log(BaseModel):
|
|
|
86
86
|
exit_code: Optional[int]
|
|
87
87
|
state: Optional[State]
|
|
88
88
|
|
|
89
|
+
class RunDependency(BaseModel):
|
|
90
|
+
run_id: str
|
|
89
91
|
|
|
90
92
|
class ExtendedRunRequest(BaseModel):
|
|
91
93
|
workflow_url: Optional[str]
|
|
@@ -99,6 +101,7 @@ class ExtendedRunRequest(BaseModel):
|
|
|
99
101
|
submitted_by: Optional[str]
|
|
100
102
|
workflow_params: Optional[Dict]
|
|
101
103
|
workflow_engine_parameters: Optional[Dict]
|
|
104
|
+
dependencies: Optional[Dict[str, RunDependency]]
|
|
102
105
|
tags: Optional[Dict]
|
|
103
106
|
|
|
104
107
|
|
|
@@ -124,6 +127,8 @@ class RunEvent(BaseModel):
|
|
|
124
127
|
created_at: datetime
|
|
125
128
|
metadata: RunEventMetadata
|
|
126
129
|
|
|
130
|
+
class ExtendedRunEvents(BaseModel):
|
|
131
|
+
events: Optional[List[RunEvent]]
|
|
127
132
|
|
|
128
133
|
class ExtendedRun(BaseModel):
|
|
129
134
|
run_id: str
|
|
@@ -136,12 +141,11 @@ class ExtendedRun(BaseModel):
|
|
|
136
141
|
task_logs: Optional[List[Log]]
|
|
137
142
|
task_logs_url: Optional[str]
|
|
138
143
|
outputs: Optional[Dict]
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
class ExtendedRunEvents(BaseModel):
|
|
144
|
+
dependencies: Optional[Dict[str, RunDependency]]
|
|
142
145
|
events: Optional[List[RunEvent]]
|
|
143
146
|
|
|
144
147
|
|
|
148
|
+
|
|
145
149
|
class MinimalExtendedRun(BaseModel):
|
|
146
150
|
run_id: Optional[str]
|
|
147
151
|
state: Optional[State]
|
dnastack/constants.py
CHANGED
dnastack/http/session.py
CHANGED
|
@@ -23,8 +23,8 @@ class AuthenticationError(RuntimeError):
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
class HttpError(RuntimeError):
|
|
26
|
-
def __init__(self, response: Response, trace_context: Optional[Span] = None):
|
|
27
|
-
super(HttpError, self).__init__(response, trace_context)
|
|
26
|
+
def __init__(self, response: Response, trace_context: Optional[Span] = None, message: Optional[str] = None):
|
|
27
|
+
super(HttpError, self).__init__(response, trace_context, message)
|
|
28
28
|
|
|
29
29
|
@property
|
|
30
30
|
def response(self) -> Response:
|
|
@@ -33,19 +33,26 @@ class HttpError(RuntimeError):
|
|
|
33
33
|
@property
|
|
34
34
|
def trace(self) -> Span:
|
|
35
35
|
return self.args[1]
|
|
36
|
+
|
|
37
|
+
@property
|
|
38
|
+
def message(self) -> Optional[str]:
|
|
39
|
+
return self.args[2] if len(self.args) > 2 else None
|
|
36
40
|
|
|
37
41
|
def __str__(self):
|
|
38
42
|
response: Response = self.response
|
|
39
43
|
|
|
40
44
|
error_feedback = f'HTTP {response.status_code}'
|
|
41
45
|
|
|
42
|
-
# Prepare the error feedback.
|
|
43
46
|
response_text = response.text.strip()
|
|
44
47
|
if len(response_text) == 0:
|
|
45
48
|
error_feedback = f'{error_feedback} (empty response)'
|
|
46
49
|
else:
|
|
47
50
|
error_feedback = f'{error_feedback}: {response_text}'
|
|
48
51
|
|
|
52
|
+
custom_message = self.message
|
|
53
|
+
if custom_message:
|
|
54
|
+
error_feedback = f'{custom_message} - {error_feedback}'
|
|
55
|
+
|
|
49
56
|
trace: Span = self.trace
|
|
50
57
|
if trace:
|
|
51
58
|
error_feedback = f'[{trace.trace_id},{trace.span_id}] {error_feedback}'
|
|
@@ -68,6 +75,7 @@ class JsonPatch(BaseModel):
|
|
|
68
75
|
|
|
69
76
|
|
|
70
77
|
class RetryHistoryEntry(BaseModel):
|
|
78
|
+
url: str
|
|
71
79
|
authenticator_index: int
|
|
72
80
|
with_reauthentication: bool
|
|
73
81
|
with_next_authenticator: bool
|
|
@@ -153,7 +161,7 @@ class HttpSession(AbstractContextManager):
|
|
|
153
161
|
authenticator_index: int = 0,
|
|
154
162
|
retry_history: Optional[List[RetryHistoryEntry]] = None,
|
|
155
163
|
trace_context: Optional[Span] = None,
|
|
156
|
-
**kwargs) -> Response:
|
|
164
|
+
**kwargs) -> Response | None | Any:
|
|
157
165
|
trace_context = trace_context or Span(origin=self)
|
|
158
166
|
|
|
159
167
|
retry_history = retry_history or list()
|
|
@@ -317,7 +325,8 @@ class HttpSession(AbstractContextManager):
|
|
|
317
325
|
def _raise_http_error(self,
|
|
318
326
|
response: Response,
|
|
319
327
|
authenticator: Authenticator,
|
|
320
|
-
trace_context: Span
|
|
328
|
+
trace_context: Span,
|
|
329
|
+
message: Optional[str] = None):
|
|
321
330
|
trace_logger = trace_context.create_span_logger(self.__logger) if trace_context else self.__logger
|
|
322
331
|
|
|
323
332
|
if isinstance(authenticator, OAuth2Authenticator):
|
|
@@ -344,7 +353,7 @@ class HttpSession(AbstractContextManager):
|
|
|
344
353
|
else:
|
|
345
354
|
trace_logger.error('The authenticator is not available or supported for extracting additional info.')
|
|
346
355
|
|
|
347
|
-
raise (ClientError if response.status_code < 500 else ServerError)(response, trace_context=trace_context)
|
|
356
|
+
raise (ClientError if response.status_code < 500 else ServerError)(response, trace_context=trace_context, message=message)
|
|
348
357
|
|
|
349
358
|
def __del__(self):
|
|
350
359
|
self.close()
|
{dnastack_client_library-3.1.159.dist-info → dnastack_client_library-3.1.162.dist-info}/RECORD
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
dnastack/__init__.py,sha256=mslf7se8vBSK_HkqWTGPdibeVhT4xyKXgzQBV7dEK1M,333
|
|
2
2
|
dnastack/__main__.py,sha256=EKmtIs4TBseQJi-OT_U6LqRyKLiyrGTBuTQg9zE-G2I,4376
|
|
3
|
-
dnastack/constants.py,sha256=
|
|
3
|
+
dnastack/constants.py,sha256=6P579Aw9VUw8nJ_eFzwu-eQjSXMo09xI9vmHC62W9wM,114
|
|
4
4
|
dnastack/feature_flags.py,sha256=RK_V_Ovncoe6NeTheAA_frP-kYkZC1fDlTbbup2KYG4,1419
|
|
5
5
|
dnastack/json_path.py,sha256=TyghhDf7nGQmnsUWBhenU_fKsE_Ez-HLVER6HgH5-hU,2700
|
|
6
6
|
dnastack/omics_cli.py,sha256=ZppKZTHv_XjUUZyRIzSkx0Ug5ODAYrCOTsU0ezCOVrA,3694
|
|
@@ -75,7 +75,7 @@ dnastack/cli/commands/workbench/instruments/commands.py,sha256=MOC1hkZzhwTtcYRk0
|
|
|
75
75
|
dnastack/cli/commands/workbench/namespaces/__init__.py,sha256=D4b8BMxuVb7tuQ8ZY-vQracVp-wPv7RrIHhOe9DeAvA,309
|
|
76
76
|
dnastack/cli/commands/workbench/namespaces/commands.py,sha256=36WHG4h6U69_32tnTWvTFRzNtRvTCbF-u0P4U5qsCoc,887
|
|
77
77
|
dnastack/cli/commands/workbench/runs/__init__.py,sha256=krxeV0LGOsgl0yW6e_cynwGJb8PClrWvvt8icHwSHXw,600
|
|
78
|
-
dnastack/cli/commands/workbench/runs/commands.py,sha256=
|
|
78
|
+
dnastack/cli/commands/workbench/runs/commands.py,sha256=KS1DUMI2uQpX5hMOyFNrFliKsg7hF3uhsS5TEzMj6ro,25761
|
|
79
79
|
dnastack/cli/commands/workbench/runs/events.py,sha256=eJL8zApopJKGumZlDlFGxNbToCgnzKltanbUUeXjUw8,1244
|
|
80
80
|
dnastack/cli/commands/workbench/runs/tasks.py,sha256=aYLgSAAv3XqN36gLw-YeJ4_gQ-csiFp7bF4yLEX1QMw,1719
|
|
81
81
|
dnastack/cli/commands/workbench/runs/utils.py,sha256=5ROpUn9JIG5J6oHNQjDIPUHjLvKOuddYOesDL3PTT24,233
|
|
@@ -125,7 +125,7 @@ dnastack/client/datasources/__init__.py,sha256=HxDIHuQX8KMWr3o70ucL3x79pXKaIHbBq
|
|
|
125
125
|
dnastack/client/datasources/client.py,sha256=jfVzCSKuQJsggbvfJVbftYJ0hd6gAPsBZMgvINOgjRE,4671
|
|
126
126
|
dnastack/client/datasources/model.py,sha256=dV9Sf05ivIq0ubwIIYK3kSv1xJ_TtjxvVp_ddI9aHEk,214
|
|
127
127
|
dnastack/client/explorer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
128
|
-
dnastack/client/explorer/client.py,sha256=
|
|
128
|
+
dnastack/client/explorer/client.py,sha256=_YisPn9jQUSk-O-8E9Vncn_jALLRvu7etYC-1KK3vKY,9416
|
|
129
129
|
dnastack/client/explorer/models.py,sha256=vrltbcb4qAx6z1oGXG8ufw2kZ36dDiwU5QGqOomYp6c,3126
|
|
130
130
|
dnastack/client/service_registry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
131
131
|
dnastack/client/service_registry/client.py,sha256=r7D8CnPJLbNkc03g2PYHt880Ba1oPW2d8B0ShP0p4Eo,1131
|
|
@@ -138,7 +138,7 @@ dnastack/client/workbench/base_client.py,sha256=KlkSO1c32bKhojfco8NcVBVSY5x_PZAC
|
|
|
138
138
|
dnastack/client/workbench/models.py,sha256=RBo7wmWMSDkgiFZHaWh2ehKeTM8ERywug1bMGKDOm0k,446
|
|
139
139
|
dnastack/client/workbench/ewes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
140
140
|
dnastack/client/workbench/ewes/client.py,sha256=yIqjwyyY9q0NrxpTX6LrnlnjavHoa6Fo073O3Lokkaw,15637
|
|
141
|
-
dnastack/client/workbench/ewes/models.py,sha256=
|
|
141
|
+
dnastack/client/workbench/ewes/models.py,sha256=MBSkYxFW8nX9OlzijJxzZ3I7zCUFHM83PXF4zXbnZeY,8404
|
|
142
142
|
dnastack/client/workbench/samples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
143
143
|
dnastack/client/workbench/samples/client.py,sha256=2X34SYTjV6n4yZz0q7Kaa4NPWDHRi2ut0uJWL3zXZWA,5901
|
|
144
144
|
dnastack/client/workbench/samples/models.py,sha256=g_04aDltLVRVCstOGkINqJNo1XSKB2aXWwnMfDEhC0Y,1466
|
|
@@ -179,7 +179,7 @@ dnastack/context/manager.py,sha256=4Z_KhDhIClkUOiT605yi9SwehdqiJwYth4T3G3Lb4rM,1
|
|
|
179
179
|
dnastack/context/models.py,sha256=BXSJZSwiopNZ_l2nY8uzofoYebLYwu0BLbirSBIY110,671
|
|
180
180
|
dnastack/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
181
181
|
dnastack/http/client_factory.py,sha256=HdRZpTEnFQcHEdVbdYl7AbCcRUv3K3kVyznIxEWIqvA,650
|
|
182
|
-
dnastack/http/session.py,sha256=
|
|
182
|
+
dnastack/http/session.py,sha256=LAVJW6RzURnHf0lpl3GYQjAzPb9QB9PESOyB7nKesTw,15413
|
|
183
183
|
dnastack/http/session_info.py,sha256=I0m8Z17MCtsWgMCmlzhtOzsXZfUddBAXp0XSOLWfgrM,9366
|
|
184
184
|
dnastack/http/authenticators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
185
185
|
dnastack/http/authenticators/abstract.py,sha256=b5zXqSdCasiy6Bz5LYTr7e_p7l4__Mq5shgTV6bBGnk,9241
|
|
@@ -194,9 +194,9 @@ dnastack/http/authenticators/oauth2_adapter/device_code_flow.py,sha256=dXI5CyUcs
|
|
|
194
194
|
dnastack/http/authenticators/oauth2_adapter/factory.py,sha256=ZtNXOklWEim-26ooNoPp3ji_hRg1vf4fHHnY94F0wLI,1087
|
|
195
195
|
dnastack/http/authenticators/oauth2_adapter/models.py,sha256=iY7asrSElyjubInrGV5rJKKZAxJWeq7csnaj-EqMq00,943
|
|
196
196
|
dnastack/http/authenticators/oauth2_adapter/token_exchange.py,sha256=nSuAsSKWa_UNqHSbPMOEk4komaFITYAnE04Sk5WOrLc,6332
|
|
197
|
-
dnastack_client_library-3.1.
|
|
198
|
-
dnastack_client_library-3.1.
|
|
199
|
-
dnastack_client_library-3.1.
|
|
200
|
-
dnastack_client_library-3.1.
|
|
201
|
-
dnastack_client_library-3.1.
|
|
202
|
-
dnastack_client_library-3.1.
|
|
197
|
+
dnastack_client_library-3.1.162.dist-info/licenses/LICENSE,sha256=uwybO-wUbQhxkosgjhJlxmYATMy-AzoULFO9FUedE34,11580
|
|
198
|
+
dnastack_client_library-3.1.162.dist-info/METADATA,sha256=hE05Y8wAcmuy8xIoXPuktKrh5pqISri-tDkdQ8Guv0s,1766
|
|
199
|
+
dnastack_client_library-3.1.162.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
200
|
+
dnastack_client_library-3.1.162.dist-info/entry_points.txt,sha256=Y6OeicsiyGn3-8D-SiV4NiKlJgXfkSqK88kFBR6R1rY,89
|
|
201
|
+
dnastack_client_library-3.1.162.dist-info/top_level.txt,sha256=P2RgRyqJ7hfNy1wLVRoVLJYEppUVkCX3syGK9zBqkt8,9
|
|
202
|
+
dnastack_client_library-3.1.162.dist-info/RECORD,,
|
{dnastack_client_library-3.1.159.dist-info → dnastack_client_library-3.1.162.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|