hatchet-sdk 1.15.3__py3-none-any.whl → 1.16.1__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.
Potentially problematic release.
This version of hatchet-sdk might be problematic. Click here for more details.
- hatchet_sdk/__init__.py +4 -0
- hatchet_sdk/client.py +2 -0
- hatchet_sdk/clients/admin.py +3 -1
- hatchet_sdk/clients/dispatcher/action_listener.py +13 -13
- hatchet_sdk/clients/event_ts.py +1 -1
- hatchet_sdk/clients/listeners/pooled_listener.py +4 -4
- hatchet_sdk/clients/rest/__init__.py +8 -0
- hatchet_sdk/clients/rest/api/__init__.py +1 -0
- hatchet_sdk/clients/rest/api/cel_api.py +334 -0
- hatchet_sdk/clients/rest/api/task_api.py +12 -10
- hatchet_sdk/clients/rest/models/__init__.py +7 -0
- hatchet_sdk/clients/rest/models/v1_cancelled_tasks.py +87 -0
- hatchet_sdk/clients/rest/models/v1_cel_debug_error_response.py +93 -0
- hatchet_sdk/clients/rest/models/v1_cel_debug_request.py +108 -0
- hatchet_sdk/clients/rest/models/v1_cel_debug_response.py +100 -0
- hatchet_sdk/clients/rest/models/v1_cel_debug_response_status.py +37 -0
- hatchet_sdk/clients/rest/models/v1_cel_debug_success_response.py +102 -0
- hatchet_sdk/clients/rest/models/v1_replayed_tasks.py +87 -0
- hatchet_sdk/clients/rest/tenacity_utils.py +1 -1
- hatchet_sdk/clients/v1/api_client.py +3 -3
- hatchet_sdk/context/context.py +6 -6
- hatchet_sdk/features/cel.py +99 -0
- hatchet_sdk/features/runs.py +21 -1
- hatchet_sdk/hatchet.py +8 -0
- hatchet_sdk/opentelemetry/instrumentor.py +3 -3
- hatchet_sdk/runnables/contextvars.py +4 -0
- hatchet_sdk/runnables/task.py +133 -0
- hatchet_sdk/runnables/workflow.py +218 -11
- hatchet_sdk/worker/action_listener_process.py +11 -11
- hatchet_sdk/worker/runner/runner.py +39 -21
- hatchet_sdk/worker/runner/utils/capture_logs.py +30 -15
- hatchet_sdk/worker/worker.py +11 -14
- {hatchet_sdk-1.15.3.dist-info → hatchet_sdk-1.16.1.dist-info}/METADATA +1 -1
- {hatchet_sdk-1.15.3.dist-info → hatchet_sdk-1.16.1.dist-info}/RECORD +36 -27
- {hatchet_sdk-1.15.3.dist-info → hatchet_sdk-1.16.1.dist-info}/WHEEL +0 -0
- {hatchet_sdk-1.15.3.dist-info → hatchet_sdk-1.16.1.dist-info}/entry_points.txt +0 -0
hatchet_sdk/__init__.py
CHANGED
|
@@ -152,6 +152,7 @@ from hatchet_sdk.exceptions import (
|
|
|
152
152
|
NonRetryableException,
|
|
153
153
|
TaskRunError,
|
|
154
154
|
)
|
|
155
|
+
from hatchet_sdk.features.cel import CELEvaluationResult, CELFailure, CELSuccess
|
|
155
156
|
from hatchet_sdk.features.runs import BulkCancelReplayOpts, RunFilter
|
|
156
157
|
from hatchet_sdk.hatchet import Hatchet
|
|
157
158
|
from hatchet_sdk.runnables.task import Task
|
|
@@ -180,6 +181,9 @@ __all__ = [
|
|
|
180
181
|
"APIToken",
|
|
181
182
|
"AcceptInviteRequest",
|
|
182
183
|
"BulkCancelReplayOpts",
|
|
184
|
+
"CELEvaluationResult",
|
|
185
|
+
"CELFailure",
|
|
186
|
+
"CELSuccess",
|
|
183
187
|
"ClientConfig",
|
|
184
188
|
"ClientTLSConfig",
|
|
185
189
|
"ConcurrencyExpression",
|
hatchet_sdk/client.py
CHANGED
|
@@ -4,6 +4,7 @@ from hatchet_sdk.clients.events import EventClient
|
|
|
4
4
|
from hatchet_sdk.clients.listeners.run_event_listener import RunEventListenerClient
|
|
5
5
|
from hatchet_sdk.clients.listeners.workflow_listener import PooledWorkflowRunListener
|
|
6
6
|
from hatchet_sdk.config import ClientConfig
|
|
7
|
+
from hatchet_sdk.features.cel import CELClient
|
|
7
8
|
from hatchet_sdk.features.cron import CronClient
|
|
8
9
|
from hatchet_sdk.features.filters import FiltersClient
|
|
9
10
|
from hatchet_sdk.features.logs import LogsClient
|
|
@@ -35,6 +36,7 @@ class Client:
|
|
|
35
36
|
self.log_interceptor = config.logger
|
|
36
37
|
self.debug = debug
|
|
37
38
|
|
|
39
|
+
self.cel = CELClient(self.config)
|
|
38
40
|
self.cron = CronClient(self.config)
|
|
39
41
|
self.filters = FiltersClient(self.config)
|
|
40
42
|
self.logs = LogsClient(self.config)
|
hatchet_sdk/clients/admin.py
CHANGED
|
@@ -23,6 +23,7 @@ from hatchet_sdk.metadata import get_metadata
|
|
|
23
23
|
from hatchet_sdk.rate_limit import RateLimitDuration
|
|
24
24
|
from hatchet_sdk.runnables.contextvars import (
|
|
25
25
|
ctx_action_key,
|
|
26
|
+
ctx_additional_metadata,
|
|
26
27
|
ctx_step_run_id,
|
|
27
28
|
ctx_worker_id,
|
|
28
29
|
ctx_workflow_run_id,
|
|
@@ -278,6 +279,7 @@ class AdminClient:
|
|
|
278
279
|
step_run_id = ctx_step_run_id.get()
|
|
279
280
|
worker_id = ctx_worker_id.get()
|
|
280
281
|
action_key = ctx_action_key.get()
|
|
282
|
+
additional_metadata = ctx_additional_metadata.get() or {}
|
|
281
283
|
spawn_index = workflow_spawn_indices[action_key] if action_key else 0
|
|
282
284
|
|
|
283
285
|
## Increment the spawn_index for the parent workflow
|
|
@@ -296,7 +298,7 @@ class AdminClient:
|
|
|
296
298
|
parent_step_run_id=options.parent_step_run_id or step_run_id,
|
|
297
299
|
child_key=options.child_key,
|
|
298
300
|
child_index=child_index,
|
|
299
|
-
additional_metadata=options.additional_metadata,
|
|
301
|
+
additional_metadata={**additional_metadata, **options.additional_metadata},
|
|
300
302
|
desired_worker_id=desired_worker_id,
|
|
301
303
|
priority=options.priority,
|
|
302
304
|
namespace=options.namespace,
|
|
@@ -140,15 +140,15 @@ class ActionListener:
|
|
|
140
140
|
# todo case on "recvmsg:Connection reset by peer" for updates?
|
|
141
141
|
if self.missed_heartbeats >= 3:
|
|
142
142
|
# we don't reraise the error here, as we don't want to stop the heartbeat thread
|
|
143
|
-
logger.
|
|
144
|
-
f"⛔️ failed heartbeat ({self.missed_heartbeats})
|
|
143
|
+
logger.exception(
|
|
144
|
+
f"⛔️ failed heartbeat ({self.missed_heartbeats})"
|
|
145
145
|
)
|
|
146
146
|
elif self.missed_heartbeats > 1:
|
|
147
147
|
logger.warning(
|
|
148
148
|
f"failed to send heartbeat ({self.missed_heartbeats}): {e.details()}"
|
|
149
149
|
)
|
|
150
150
|
else:
|
|
151
|
-
logger.
|
|
151
|
+
logger.exception("failed to send heartbeat")
|
|
152
152
|
|
|
153
153
|
if self.interrupt is not None:
|
|
154
154
|
self.interrupt.set()
|
|
@@ -195,7 +195,7 @@ class ActionListener:
|
|
|
195
195
|
|
|
196
196
|
if not t.done():
|
|
197
197
|
logger.warning(
|
|
198
|
-
"
|
|
198
|
+
"interrupted read_with_interrupt task of action listener"
|
|
199
199
|
)
|
|
200
200
|
|
|
201
201
|
t.cancel()
|
|
@@ -206,7 +206,7 @@ class ActionListener:
|
|
|
206
206
|
result = t.result()
|
|
207
207
|
|
|
208
208
|
if isinstance(result, UnexpectedEOF):
|
|
209
|
-
logger.debug("
|
|
209
|
+
logger.debug("handling EOF in Action Listener")
|
|
210
210
|
self.retries = self.retries + 1
|
|
211
211
|
break
|
|
212
212
|
|
|
@@ -222,8 +222,8 @@ class ActionListener:
|
|
|
222
222
|
assigned_action.actionPayload
|
|
223
223
|
)
|
|
224
224
|
)
|
|
225
|
-
except (ValueError, json.JSONDecodeError)
|
|
226
|
-
logger.
|
|
225
|
+
except (ValueError, json.JSONDecodeError):
|
|
226
|
+
logger.exception("error decoding payload")
|
|
227
227
|
|
|
228
228
|
action_payload = ActionPayload()
|
|
229
229
|
|
|
@@ -263,9 +263,9 @@ class ActionListener:
|
|
|
263
263
|
# Handle different types of errors
|
|
264
264
|
if e.code() == grpc.StatusCode.CANCELLED:
|
|
265
265
|
# Context cancelled, unsubscribe and close
|
|
266
|
-
logger.debug("
|
|
266
|
+
logger.debug("context cancelled, closing listener")
|
|
267
267
|
elif e.code() == grpc.StatusCode.DEADLINE_EXCEEDED:
|
|
268
|
-
logger.info("
|
|
268
|
+
logger.info("deadline exceeded, retrying subscription")
|
|
269
269
|
elif (
|
|
270
270
|
self.listen_strategy == "v2"
|
|
271
271
|
and e.code() == grpc.StatusCode.UNIMPLEMENTED
|
|
@@ -277,10 +277,10 @@ class ActionListener:
|
|
|
277
277
|
else:
|
|
278
278
|
# TODO retry
|
|
279
279
|
if e.code() == grpc.StatusCode.UNAVAILABLE:
|
|
280
|
-
logger.
|
|
280
|
+
logger.exception("action listener error")
|
|
281
281
|
else:
|
|
282
282
|
# Unknown error, report and break
|
|
283
|
-
logger.
|
|
283
|
+
logger.exception("action listener error")
|
|
284
284
|
|
|
285
285
|
self.retries = self.retries + 1
|
|
286
286
|
|
|
@@ -346,8 +346,8 @@ class ActionListener:
|
|
|
346
346
|
|
|
347
347
|
try:
|
|
348
348
|
self.unregister()
|
|
349
|
-
except Exception
|
|
350
|
-
logger.
|
|
349
|
+
except Exception:
|
|
350
|
+
logger.exception("failed to unregister")
|
|
351
351
|
|
|
352
352
|
if self.interrupt: # type: ignore[truthy-bool]
|
|
353
353
|
self.interrupt.set()
|
hatchet_sdk/clients/event_ts.py
CHANGED
|
@@ -66,7 +66,7 @@ async def read_with_interrupt(
|
|
|
66
66
|
result = cast(TResponse, await listener.read())
|
|
67
67
|
|
|
68
68
|
if result is cygrpc.EOF:
|
|
69
|
-
logger.warning("
|
|
69
|
+
logger.warning("received EOF from engine")
|
|
70
70
|
return UnexpectedEOF()
|
|
71
71
|
|
|
72
72
|
key = key_generator(result) if key_generator else ""
|
|
@@ -103,7 +103,7 @@ class PooledListener(Generic[R, T, L], ABC):
|
|
|
103
103
|
try:
|
|
104
104
|
self.listener = await self._retry_subscribe()
|
|
105
105
|
|
|
106
|
-
logger.debug("
|
|
106
|
+
logger.debug("listener connected.")
|
|
107
107
|
|
|
108
108
|
# spawn an interrupter task
|
|
109
109
|
if self.interrupter is not None and not self.interrupter.done():
|
|
@@ -125,7 +125,7 @@ class PooledListener(Generic[R, T, L], ABC):
|
|
|
125
125
|
|
|
126
126
|
if not t.done():
|
|
127
127
|
logger.warning(
|
|
128
|
-
"
|
|
128
|
+
"interrupted read_with_interrupt task of listener"
|
|
129
129
|
)
|
|
130
130
|
|
|
131
131
|
t.cancel()
|
|
@@ -138,7 +138,7 @@ class PooledListener(Generic[R, T, L], ABC):
|
|
|
138
138
|
|
|
139
139
|
if isinstance(event, UnexpectedEOF):
|
|
140
140
|
logger.debug(
|
|
141
|
-
f"
|
|
141
|
+
f"handling EOF in Pooled Listener {self.__class__.__name__}"
|
|
142
142
|
)
|
|
143
143
|
break
|
|
144
144
|
|
|
@@ -153,7 +153,7 @@ class PooledListener(Generic[R, T, L], ABC):
|
|
|
153
153
|
continue
|
|
154
154
|
|
|
155
155
|
except Exception as e:
|
|
156
|
-
logger.
|
|
156
|
+
logger.exception("error in listener")
|
|
157
157
|
|
|
158
158
|
self.listener = None
|
|
159
159
|
|
|
@@ -18,6 +18,7 @@ __version__ = "1.0.0"
|
|
|
18
18
|
|
|
19
19
|
# import apis into sdk package
|
|
20
20
|
from hatchet_sdk.clients.rest.api.api_token_api import APITokenApi
|
|
21
|
+
from hatchet_sdk.clients.rest.api.cel_api import CELApi
|
|
21
22
|
from hatchet_sdk.clients.rest.api.default_api import DefaultApi
|
|
22
23
|
from hatchet_sdk.clients.rest.api.event_api import EventApi
|
|
23
24
|
from hatchet_sdk.clients.rest.api.filter_api import FilterApi
|
|
@@ -231,6 +232,12 @@ from hatchet_sdk.clients.rest.models.user_tenant_memberships_list import (
|
|
|
231
232
|
)
|
|
232
233
|
from hatchet_sdk.clients.rest.models.user_tenant_public import UserTenantPublic
|
|
233
234
|
from hatchet_sdk.clients.rest.models.v1_cancel_task_request import V1CancelTaskRequest
|
|
235
|
+
from hatchet_sdk.clients.rest.models.v1_cancelled_tasks import V1CancelledTasks
|
|
236
|
+
from hatchet_sdk.clients.rest.models.v1_cel_debug_request import V1CELDebugRequest
|
|
237
|
+
from hatchet_sdk.clients.rest.models.v1_cel_debug_response import V1CELDebugResponse
|
|
238
|
+
from hatchet_sdk.clients.rest.models.v1_cel_debug_response_status import (
|
|
239
|
+
V1CELDebugResponseStatus,
|
|
240
|
+
)
|
|
234
241
|
from hatchet_sdk.clients.rest.models.v1_create_filter_request import (
|
|
235
242
|
V1CreateFilterRequest,
|
|
236
243
|
)
|
|
@@ -247,6 +254,7 @@ from hatchet_sdk.clients.rest.models.v1_log_line import V1LogLine
|
|
|
247
254
|
from hatchet_sdk.clients.rest.models.v1_log_line_level import V1LogLineLevel
|
|
248
255
|
from hatchet_sdk.clients.rest.models.v1_log_line_list import V1LogLineList
|
|
249
256
|
from hatchet_sdk.clients.rest.models.v1_replay_task_request import V1ReplayTaskRequest
|
|
257
|
+
from hatchet_sdk.clients.rest.models.v1_replayed_tasks import V1ReplayedTasks
|
|
250
258
|
from hatchet_sdk.clients.rest.models.v1_task_event import V1TaskEvent
|
|
251
259
|
from hatchet_sdk.clients.rest.models.v1_task_event_list import V1TaskEventList
|
|
252
260
|
from hatchet_sdk.clients.rest.models.v1_task_event_type import V1TaskEventType
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# import apis into api package
|
|
4
4
|
from hatchet_sdk.clients.rest.api.api_token_api import APITokenApi
|
|
5
|
+
from hatchet_sdk.clients.rest.api.cel_api import CELApi
|
|
5
6
|
from hatchet_sdk.clients.rest.api.default_api import DefaultApi
|
|
6
7
|
from hatchet_sdk.clients.rest.api.event_api import EventApi
|
|
7
8
|
from hatchet_sdk.clients.rest.api.filter_api import FilterApi
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Hatchet API
|
|
5
|
+
|
|
6
|
+
The Hatchet API
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
import warnings
|
|
15
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
16
|
+
|
|
17
|
+
from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
|
|
18
|
+
from typing_extensions import Annotated
|
|
19
|
+
|
|
20
|
+
from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized
|
|
21
|
+
from hatchet_sdk.clients.rest.api_response import ApiResponse
|
|
22
|
+
from hatchet_sdk.clients.rest.models.v1_cel_debug_request import V1CELDebugRequest
|
|
23
|
+
from hatchet_sdk.clients.rest.models.v1_cel_debug_response import V1CELDebugResponse
|
|
24
|
+
from hatchet_sdk.clients.rest.rest import RESTResponseType
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class CELApi:
|
|
28
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
29
|
+
Ref: https://openapi-generator.tech
|
|
30
|
+
|
|
31
|
+
Do not edit the class manually.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
def __init__(self, api_client=None) -> None:
|
|
35
|
+
if api_client is None:
|
|
36
|
+
api_client = ApiClient.get_default()
|
|
37
|
+
self.api_client = api_client
|
|
38
|
+
|
|
39
|
+
@validate_call
|
|
40
|
+
def v1_cel_debug(
|
|
41
|
+
self,
|
|
42
|
+
tenant: Annotated[
|
|
43
|
+
str,
|
|
44
|
+
Field(
|
|
45
|
+
min_length=36, strict=True, max_length=36, description="The tenant id"
|
|
46
|
+
),
|
|
47
|
+
],
|
|
48
|
+
v1_cel_debug_request: Annotated[
|
|
49
|
+
V1CELDebugRequest,
|
|
50
|
+
Field(description="The inputs to test the CEL expression against"),
|
|
51
|
+
],
|
|
52
|
+
_request_timeout: Union[
|
|
53
|
+
None,
|
|
54
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
55
|
+
Tuple[
|
|
56
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
57
|
+
],
|
|
58
|
+
] = None,
|
|
59
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
60
|
+
_content_type: Optional[StrictStr] = None,
|
|
61
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
62
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
63
|
+
) -> V1CELDebugResponse:
|
|
64
|
+
"""Debug a CEL expression
|
|
65
|
+
|
|
66
|
+
Evaluate a CEL expression against provided input data.
|
|
67
|
+
|
|
68
|
+
:param tenant: The tenant id (required)
|
|
69
|
+
:type tenant: str
|
|
70
|
+
:param v1_cel_debug_request: The inputs to test the CEL expression against (required)
|
|
71
|
+
:type v1_cel_debug_request: V1CELDebugRequest
|
|
72
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
73
|
+
number provided, it will be total request
|
|
74
|
+
timeout. It can also be a pair (tuple) of
|
|
75
|
+
(connection, read) timeouts.
|
|
76
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
77
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
78
|
+
request; this effectively ignores the
|
|
79
|
+
authentication in the spec for a single request.
|
|
80
|
+
:type _request_auth: dict, optional
|
|
81
|
+
:param _content_type: force content-type for the request.
|
|
82
|
+
:type _content_type: str, Optional
|
|
83
|
+
:param _headers: set to override the headers for a single
|
|
84
|
+
request; this effectively ignores the headers
|
|
85
|
+
in the spec for a single request.
|
|
86
|
+
:type _headers: dict, optional
|
|
87
|
+
:param _host_index: set to override the host_index for a single
|
|
88
|
+
request; this effectively ignores the host_index
|
|
89
|
+
in the spec for a single request.
|
|
90
|
+
:type _host_index: int, optional
|
|
91
|
+
:return: Returns the result object.
|
|
92
|
+
""" # noqa: E501
|
|
93
|
+
|
|
94
|
+
_param = self._v1_cel_debug_serialize(
|
|
95
|
+
tenant=tenant,
|
|
96
|
+
v1_cel_debug_request=v1_cel_debug_request,
|
|
97
|
+
_request_auth=_request_auth,
|
|
98
|
+
_content_type=_content_type,
|
|
99
|
+
_headers=_headers,
|
|
100
|
+
_host_index=_host_index,
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
104
|
+
"200": "V1CELDebugResponse",
|
|
105
|
+
"400": "APIErrors",
|
|
106
|
+
"403": "APIErrors",
|
|
107
|
+
}
|
|
108
|
+
response_data = self.api_client.call_api(
|
|
109
|
+
*_param, _request_timeout=_request_timeout
|
|
110
|
+
)
|
|
111
|
+
response_data.read()
|
|
112
|
+
return self.api_client.response_deserialize(
|
|
113
|
+
response_data=response_data,
|
|
114
|
+
response_types_map=_response_types_map,
|
|
115
|
+
).data
|
|
116
|
+
|
|
117
|
+
@validate_call
|
|
118
|
+
def v1_cel_debug_with_http_info(
|
|
119
|
+
self,
|
|
120
|
+
tenant: Annotated[
|
|
121
|
+
str,
|
|
122
|
+
Field(
|
|
123
|
+
min_length=36, strict=True, max_length=36, description="The tenant id"
|
|
124
|
+
),
|
|
125
|
+
],
|
|
126
|
+
v1_cel_debug_request: Annotated[
|
|
127
|
+
V1CELDebugRequest,
|
|
128
|
+
Field(description="The inputs to test the CEL expression against"),
|
|
129
|
+
],
|
|
130
|
+
_request_timeout: Union[
|
|
131
|
+
None,
|
|
132
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
133
|
+
Tuple[
|
|
134
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
135
|
+
],
|
|
136
|
+
] = None,
|
|
137
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
138
|
+
_content_type: Optional[StrictStr] = None,
|
|
139
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
140
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
141
|
+
) -> ApiResponse[V1CELDebugResponse]:
|
|
142
|
+
"""Debug a CEL expression
|
|
143
|
+
|
|
144
|
+
Evaluate a CEL expression against provided input data.
|
|
145
|
+
|
|
146
|
+
:param tenant: The tenant id (required)
|
|
147
|
+
:type tenant: str
|
|
148
|
+
:param v1_cel_debug_request: The inputs to test the CEL expression against (required)
|
|
149
|
+
:type v1_cel_debug_request: V1CELDebugRequest
|
|
150
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
151
|
+
number provided, it will be total request
|
|
152
|
+
timeout. It can also be a pair (tuple) of
|
|
153
|
+
(connection, read) timeouts.
|
|
154
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
155
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
156
|
+
request; this effectively ignores the
|
|
157
|
+
authentication in the spec for a single request.
|
|
158
|
+
:type _request_auth: dict, optional
|
|
159
|
+
:param _content_type: force content-type for the request.
|
|
160
|
+
:type _content_type: str, Optional
|
|
161
|
+
:param _headers: set to override the headers for a single
|
|
162
|
+
request; this effectively ignores the headers
|
|
163
|
+
in the spec for a single request.
|
|
164
|
+
:type _headers: dict, optional
|
|
165
|
+
:param _host_index: set to override the host_index for a single
|
|
166
|
+
request; this effectively ignores the host_index
|
|
167
|
+
in the spec for a single request.
|
|
168
|
+
:type _host_index: int, optional
|
|
169
|
+
:return: Returns the result object.
|
|
170
|
+
""" # noqa: E501
|
|
171
|
+
|
|
172
|
+
_param = self._v1_cel_debug_serialize(
|
|
173
|
+
tenant=tenant,
|
|
174
|
+
v1_cel_debug_request=v1_cel_debug_request,
|
|
175
|
+
_request_auth=_request_auth,
|
|
176
|
+
_content_type=_content_type,
|
|
177
|
+
_headers=_headers,
|
|
178
|
+
_host_index=_host_index,
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
182
|
+
"200": "V1CELDebugResponse",
|
|
183
|
+
"400": "APIErrors",
|
|
184
|
+
"403": "APIErrors",
|
|
185
|
+
}
|
|
186
|
+
response_data = self.api_client.call_api(
|
|
187
|
+
*_param, _request_timeout=_request_timeout
|
|
188
|
+
)
|
|
189
|
+
response_data.read()
|
|
190
|
+
return self.api_client.response_deserialize(
|
|
191
|
+
response_data=response_data,
|
|
192
|
+
response_types_map=_response_types_map,
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
@validate_call
|
|
196
|
+
def v1_cel_debug_without_preload_content(
|
|
197
|
+
self,
|
|
198
|
+
tenant: Annotated[
|
|
199
|
+
str,
|
|
200
|
+
Field(
|
|
201
|
+
min_length=36, strict=True, max_length=36, description="The tenant id"
|
|
202
|
+
),
|
|
203
|
+
],
|
|
204
|
+
v1_cel_debug_request: Annotated[
|
|
205
|
+
V1CELDebugRequest,
|
|
206
|
+
Field(description="The inputs to test the CEL expression against"),
|
|
207
|
+
],
|
|
208
|
+
_request_timeout: Union[
|
|
209
|
+
None,
|
|
210
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
211
|
+
Tuple[
|
|
212
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
213
|
+
],
|
|
214
|
+
] = None,
|
|
215
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
216
|
+
_content_type: Optional[StrictStr] = None,
|
|
217
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
218
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
219
|
+
) -> RESTResponseType:
|
|
220
|
+
"""Debug a CEL expression
|
|
221
|
+
|
|
222
|
+
Evaluate a CEL expression against provided input data.
|
|
223
|
+
|
|
224
|
+
:param tenant: The tenant id (required)
|
|
225
|
+
:type tenant: str
|
|
226
|
+
:param v1_cel_debug_request: The inputs to test the CEL expression against (required)
|
|
227
|
+
:type v1_cel_debug_request: V1CELDebugRequest
|
|
228
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
229
|
+
number provided, it will be total request
|
|
230
|
+
timeout. It can also be a pair (tuple) of
|
|
231
|
+
(connection, read) timeouts.
|
|
232
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
233
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
234
|
+
request; this effectively ignores the
|
|
235
|
+
authentication in the spec for a single request.
|
|
236
|
+
:type _request_auth: dict, optional
|
|
237
|
+
:param _content_type: force content-type for the request.
|
|
238
|
+
:type _content_type: str, Optional
|
|
239
|
+
:param _headers: set to override the headers for a single
|
|
240
|
+
request; this effectively ignores the headers
|
|
241
|
+
in the spec for a single request.
|
|
242
|
+
:type _headers: dict, optional
|
|
243
|
+
:param _host_index: set to override the host_index for a single
|
|
244
|
+
request; this effectively ignores the host_index
|
|
245
|
+
in the spec for a single request.
|
|
246
|
+
:type _host_index: int, optional
|
|
247
|
+
:return: Returns the result object.
|
|
248
|
+
""" # noqa: E501
|
|
249
|
+
|
|
250
|
+
_param = self._v1_cel_debug_serialize(
|
|
251
|
+
tenant=tenant,
|
|
252
|
+
v1_cel_debug_request=v1_cel_debug_request,
|
|
253
|
+
_request_auth=_request_auth,
|
|
254
|
+
_content_type=_content_type,
|
|
255
|
+
_headers=_headers,
|
|
256
|
+
_host_index=_host_index,
|
|
257
|
+
)
|
|
258
|
+
|
|
259
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
260
|
+
"200": "V1CELDebugResponse",
|
|
261
|
+
"400": "APIErrors",
|
|
262
|
+
"403": "APIErrors",
|
|
263
|
+
}
|
|
264
|
+
response_data = self.api_client.call_api(
|
|
265
|
+
*_param, _request_timeout=_request_timeout
|
|
266
|
+
)
|
|
267
|
+
return response_data.response
|
|
268
|
+
|
|
269
|
+
def _v1_cel_debug_serialize(
|
|
270
|
+
self,
|
|
271
|
+
tenant,
|
|
272
|
+
v1_cel_debug_request,
|
|
273
|
+
_request_auth,
|
|
274
|
+
_content_type,
|
|
275
|
+
_headers,
|
|
276
|
+
_host_index,
|
|
277
|
+
) -> RequestSerialized:
|
|
278
|
+
|
|
279
|
+
_host = None
|
|
280
|
+
|
|
281
|
+
_collection_formats: Dict[str, str] = {}
|
|
282
|
+
|
|
283
|
+
_path_params: Dict[str, str] = {}
|
|
284
|
+
_query_params: List[Tuple[str, str]] = []
|
|
285
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
286
|
+
_form_params: List[Tuple[str, str]] = []
|
|
287
|
+
_files: Dict[
|
|
288
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
289
|
+
] = {}
|
|
290
|
+
_body_params: Optional[bytes] = None
|
|
291
|
+
|
|
292
|
+
# process the path parameters
|
|
293
|
+
if tenant is not None:
|
|
294
|
+
_path_params["tenant"] = tenant
|
|
295
|
+
# process the query parameters
|
|
296
|
+
# process the header parameters
|
|
297
|
+
# process the form parameters
|
|
298
|
+
# process the body parameter
|
|
299
|
+
if v1_cel_debug_request is not None:
|
|
300
|
+
_body_params = v1_cel_debug_request
|
|
301
|
+
|
|
302
|
+
# set the HTTP header `Accept`
|
|
303
|
+
if "Accept" not in _header_params:
|
|
304
|
+
_header_params["Accept"] = self.api_client.select_header_accept(
|
|
305
|
+
["application/json"]
|
|
306
|
+
)
|
|
307
|
+
|
|
308
|
+
# set the HTTP header `Content-Type`
|
|
309
|
+
if _content_type:
|
|
310
|
+
_header_params["Content-Type"] = _content_type
|
|
311
|
+
else:
|
|
312
|
+
_default_content_type = self.api_client.select_header_content_type(
|
|
313
|
+
["application/json"]
|
|
314
|
+
)
|
|
315
|
+
if _default_content_type is not None:
|
|
316
|
+
_header_params["Content-Type"] = _default_content_type
|
|
317
|
+
|
|
318
|
+
# authentication setting
|
|
319
|
+
_auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
|
|
320
|
+
|
|
321
|
+
return self.api_client.param_serialize(
|
|
322
|
+
method="POST",
|
|
323
|
+
resource_path="/api/v1/stable/tenants/{tenant}/cel/debug",
|
|
324
|
+
path_params=_path_params,
|
|
325
|
+
query_params=_query_params,
|
|
326
|
+
header_params=_header_params,
|
|
327
|
+
body=_body_params,
|
|
328
|
+
post_params=_form_params,
|
|
329
|
+
files=_files,
|
|
330
|
+
auth_settings=_auth_settings,
|
|
331
|
+
collection_formats=_collection_formats,
|
|
332
|
+
_host=_host,
|
|
333
|
+
_request_auth=_request_auth,
|
|
334
|
+
)
|
|
@@ -21,8 +21,10 @@ from typing_extensions import Annotated
|
|
|
21
21
|
from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized
|
|
22
22
|
from hatchet_sdk.clients.rest.api_response import ApiResponse
|
|
23
23
|
from hatchet_sdk.clients.rest.models.v1_cancel_task_request import V1CancelTaskRequest
|
|
24
|
+
from hatchet_sdk.clients.rest.models.v1_cancelled_tasks import V1CancelledTasks
|
|
24
25
|
from hatchet_sdk.clients.rest.models.v1_dag_children import V1DagChildren
|
|
25
26
|
from hatchet_sdk.clients.rest.models.v1_replay_task_request import V1ReplayTaskRequest
|
|
27
|
+
from hatchet_sdk.clients.rest.models.v1_replayed_tasks import V1ReplayedTasks
|
|
26
28
|
from hatchet_sdk.clients.rest.models.v1_task_event_list import V1TaskEventList
|
|
27
29
|
from hatchet_sdk.clients.rest.models.v1_task_point_metrics import V1TaskPointMetrics
|
|
28
30
|
from hatchet_sdk.clients.rest.models.v1_task_run_metric import V1TaskRunMetric
|
|
@@ -361,7 +363,7 @@ class TaskApi:
|
|
|
361
363
|
_content_type: Optional[StrictStr] = None,
|
|
362
364
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
363
365
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
364
|
-
) ->
|
|
366
|
+
) -> V1CancelledTasks:
|
|
365
367
|
"""Cancel tasks
|
|
366
368
|
|
|
367
369
|
Cancel tasks
|
|
@@ -402,7 +404,7 @@ class TaskApi:
|
|
|
402
404
|
)
|
|
403
405
|
|
|
404
406
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
405
|
-
"200":
|
|
407
|
+
"200": "V1CancelledTasks",
|
|
406
408
|
"400": "APIErrors",
|
|
407
409
|
"403": "APIErrors",
|
|
408
410
|
"404": "APIErrors",
|
|
@@ -440,7 +442,7 @@ class TaskApi:
|
|
|
440
442
|
_content_type: Optional[StrictStr] = None,
|
|
441
443
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
442
444
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
443
|
-
) -> ApiResponse[
|
|
445
|
+
) -> ApiResponse[V1CancelledTasks]:
|
|
444
446
|
"""Cancel tasks
|
|
445
447
|
|
|
446
448
|
Cancel tasks
|
|
@@ -481,7 +483,7 @@ class TaskApi:
|
|
|
481
483
|
)
|
|
482
484
|
|
|
483
485
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
484
|
-
"200":
|
|
486
|
+
"200": "V1CancelledTasks",
|
|
485
487
|
"400": "APIErrors",
|
|
486
488
|
"403": "APIErrors",
|
|
487
489
|
"404": "APIErrors",
|
|
@@ -560,7 +562,7 @@ class TaskApi:
|
|
|
560
562
|
)
|
|
561
563
|
|
|
562
564
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
563
|
-
"200":
|
|
565
|
+
"200": "V1CancelledTasks",
|
|
564
566
|
"400": "APIErrors",
|
|
565
567
|
"403": "APIErrors",
|
|
566
568
|
"404": "APIErrors",
|
|
@@ -2003,7 +2005,7 @@ class TaskApi:
|
|
|
2003
2005
|
_content_type: Optional[StrictStr] = None,
|
|
2004
2006
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
2005
2007
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
2006
|
-
) ->
|
|
2008
|
+
) -> V1ReplayedTasks:
|
|
2007
2009
|
"""Replay tasks
|
|
2008
2010
|
|
|
2009
2011
|
Replay tasks
|
|
@@ -2044,7 +2046,7 @@ class TaskApi:
|
|
|
2044
2046
|
)
|
|
2045
2047
|
|
|
2046
2048
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
2047
|
-
"200":
|
|
2049
|
+
"200": "V1ReplayedTasks",
|
|
2048
2050
|
"400": "APIErrors",
|
|
2049
2051
|
"403": "APIErrors",
|
|
2050
2052
|
"404": "APIErrors",
|
|
@@ -2082,7 +2084,7 @@ class TaskApi:
|
|
|
2082
2084
|
_content_type: Optional[StrictStr] = None,
|
|
2083
2085
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
2084
2086
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
2085
|
-
) -> ApiResponse[
|
|
2087
|
+
) -> ApiResponse[V1ReplayedTasks]:
|
|
2086
2088
|
"""Replay tasks
|
|
2087
2089
|
|
|
2088
2090
|
Replay tasks
|
|
@@ -2123,7 +2125,7 @@ class TaskApi:
|
|
|
2123
2125
|
)
|
|
2124
2126
|
|
|
2125
2127
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
2126
|
-
"200":
|
|
2128
|
+
"200": "V1ReplayedTasks",
|
|
2127
2129
|
"400": "APIErrors",
|
|
2128
2130
|
"403": "APIErrors",
|
|
2129
2131
|
"404": "APIErrors",
|
|
@@ -2202,7 +2204,7 @@ class TaskApi:
|
|
|
2202
2204
|
)
|
|
2203
2205
|
|
|
2204
2206
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
2205
|
-
"200":
|
|
2207
|
+
"200": "V1ReplayedTasks",
|
|
2206
2208
|
"400": "APIErrors",
|
|
2207
2209
|
"403": "APIErrors",
|
|
2208
2210
|
"404": "APIErrors",
|
|
@@ -195,6 +195,12 @@ from hatchet_sdk.clients.rest.models.user_tenant_memberships_list import (
|
|
|
195
195
|
)
|
|
196
196
|
from hatchet_sdk.clients.rest.models.user_tenant_public import UserTenantPublic
|
|
197
197
|
from hatchet_sdk.clients.rest.models.v1_cancel_task_request import V1CancelTaskRequest
|
|
198
|
+
from hatchet_sdk.clients.rest.models.v1_cancelled_tasks import V1CancelledTasks
|
|
199
|
+
from hatchet_sdk.clients.rest.models.v1_cel_debug_request import V1CELDebugRequest
|
|
200
|
+
from hatchet_sdk.clients.rest.models.v1_cel_debug_response import V1CELDebugResponse
|
|
201
|
+
from hatchet_sdk.clients.rest.models.v1_cel_debug_response_status import (
|
|
202
|
+
V1CELDebugResponseStatus,
|
|
203
|
+
)
|
|
198
204
|
from hatchet_sdk.clients.rest.models.v1_create_filter_request import (
|
|
199
205
|
V1CreateFilterRequest,
|
|
200
206
|
)
|
|
@@ -211,6 +217,7 @@ from hatchet_sdk.clients.rest.models.v1_log_line import V1LogLine
|
|
|
211
217
|
from hatchet_sdk.clients.rest.models.v1_log_line_level import V1LogLineLevel
|
|
212
218
|
from hatchet_sdk.clients.rest.models.v1_log_line_list import V1LogLineList
|
|
213
219
|
from hatchet_sdk.clients.rest.models.v1_replay_task_request import V1ReplayTaskRequest
|
|
220
|
+
from hatchet_sdk.clients.rest.models.v1_replayed_tasks import V1ReplayedTasks
|
|
214
221
|
from hatchet_sdk.clients.rest.models.v1_task_event import V1TaskEvent
|
|
215
222
|
from hatchet_sdk.clients.rest.models.v1_task_event_list import V1TaskEventList
|
|
216
223
|
from hatchet_sdk.clients.rest.models.v1_task_event_type import V1TaskEventType
|