Skip to content

Commit dc34a3e

Browse files
committed
Merge branch 'main' into feat--improved-py-cancellation
2 parents f3cd76b + 4d03047 commit dc34a3e

File tree

271 files changed

+2365
-2641
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

271 files changed

+2365
-2641
lines changed

sdks/python/apply_patches.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,20 @@ def prepend_import(content: str, import_statement: str) -> str:
88
if import_statement in content:
99
return content
1010

11+
future_import_pattern = r"^from __future__ import [^\n]+\n"
12+
future_imports = re.findall(future_import_pattern, content, re.MULTILINE)
13+
content = re.sub(future_import_pattern, "", content, flags=re.MULTILINE)
14+
1115
match = re.search(r"^import\s+|^from\s+", content, re.MULTILINE)
1216
insert_position = match.start() if match else 0
1317

18+
future_block = "".join(future_imports)
1419
return (
15-
content[:insert_position] + import_statement + "\n" + content[insert_position:]
20+
content[:insert_position]
21+
+ future_block
22+
+ import_statement
23+
+ "\n"
24+
+ content[insert_position:]
1625
)
1726

1827

sdks/python/generate.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ cp $tmp_dir/hatchet_sdk/clients/rest/api/__init__.py $dst_dir/api/__init__.py
5656
rm -rf $tmp_dir
5757

5858

59-
MIN_GRPCIO_VERSION=$(grep -A 1 'grpcio =' pyproject.toml | grep 'version' | sed -E 's/.*">=([0-9]+\.[0-9]+\.[0-9]+).*/\1/' | sort -V | head -n 1
60-
)
59+
MIN_GRPCIO_VERSION=$(grep '^grpcio = ' pyproject.toml | cut -d'"' -f2 | tr -d '^')
6160

6261
poetry add "grpcio@$MIN_GRPCIO_VERSION" "grpcio-tools@$MIN_GRPCIO_VERSION"
6362

sdks/python/hatchet_sdk/clients/dispatcher/action_listener.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ async def heartbeat(self) -> None:
107107

108108
try:
109109
logger.debug("sending heartbeat")
110-
await self.aio_client.Heartbeat(
110+
# fixme: figure out how to get typing right here
111+
await self.aio_client.Heartbeat( # type: ignore[misc]
111112
HeartbeatRequest(
112113
worker_id=self.worker_id,
113114
heartbeat_at=proto_timestamp_now(),

sdks/python/hatchet_sdk/clients/dispatcher/dispatcher.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ async def get_action_listener(
6868

6969
response = cast(
7070
WorkerRegisterResponse,
71-
await self.aio_client.Register(
71+
# fixme: figure out how to get typing right here
72+
await self.aio_client.Register( # type: ignore[misc]
7273
WorkerRegisterRequest(
7374
worker_name=req.worker_name,
7475
actions=req.actions,
@@ -146,7 +147,8 @@ async def _try_send_step_action_event(
146147

147148
return cast(
148149
grpc.aio.UnaryUnaryCall[StepActionEvent, ActionEventResponse],
149-
await send_step_action_event(
150+
# fixme: figure out how to get typing right here
151+
await send_step_action_event( # type: ignore[misc]
150152
event,
151153
metadata=get_metadata(self.token),
152154
),
@@ -220,7 +222,8 @@ async def async_upsert_worker_labels(
220222
else:
221223
worker_labels[key] = WorkerLabels(str_value=str(value))
222224

223-
await self.aio_client.UpsertWorkerLabels(
225+
# fixme: figure out how to get typing right here
226+
await self.aio_client.UpsertWorkerLabels( # type: ignore[misc]
224227
UpsertWorkerLabelsRequest(worker_id=worker_id, labels=worker_labels),
225228
timeout=DEFAULT_REGISTER_TIMEOUT,
226229
metadata=get_metadata(self.token),

sdks/python/hatchet_sdk/clients/rest/__init__.py

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,30 @@
33
# flake8: noqa
44

55
"""
6-
Hatchet API
6+
Hatchet API
77
8-
The Hatchet API
8+
The Hatchet API
99
10-
The version of the OpenAPI document: 1.0.0
11-
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
The version of the OpenAPI document: 1.0.0
11+
Generated by OpenAPI Generator (https://openapi-generator.tech)
1212
13-
Do not edit the class manually.
13+
Do not edit the class manually.
1414
""" # noqa: E501
1515

16-
1716
__version__ = "1.0.0"
1817

1918
# import apis into sdk package
2019
from hatchet_sdk.clients.rest.api.api_token_api import APITokenApi
2120
from hatchet_sdk.clients.rest.api.cel_api import CELApi
22-
from hatchet_sdk.clients.rest.api.default_api import DefaultApi
2321
from hatchet_sdk.clients.rest.api.event_api import EventApi
2422
from hatchet_sdk.clients.rest.api.filter_api import FilterApi
2523
from hatchet_sdk.clients.rest.api.github_api import GithubApi
2624
from hatchet_sdk.clients.rest.api.healthcheck_api import HealthcheckApi
2725
from hatchet_sdk.clients.rest.api.log_api import LogApi
2826
from hatchet_sdk.clients.rest.api.metadata_api import MetadataApi
2927
from hatchet_sdk.clients.rest.api.rate_limits_api import RateLimitsApi
30-
from hatchet_sdk.clients.rest.api.slack_api import SlackApi
3128
from hatchet_sdk.clients.rest.api.sns_api import SNSApi
29+
from hatchet_sdk.clients.rest.api.slack_api import SlackApi
3230
from hatchet_sdk.clients.rest.api.step_run_api import StepRunApi
3331
from hatchet_sdk.clients.rest.api.task_api import TaskApi
3432
from hatchet_sdk.clients.rest.api.tenant_api import TenantApi
@@ -38,20 +36,18 @@
3836
from hatchet_sdk.clients.rest.api.workflow_api import WorkflowApi
3937
from hatchet_sdk.clients.rest.api.workflow_run_api import WorkflowRunApi
4038
from hatchet_sdk.clients.rest.api.workflow_runs_api import WorkflowRunsApi
41-
from hatchet_sdk.clients.rest.api_client import ApiClient
39+
from hatchet_sdk.clients.rest.api.default_api import DefaultApi
4240

4341
# import ApiClient
4442
from hatchet_sdk.clients.rest.api_response import ApiResponse
43+
from hatchet_sdk.clients.rest.api_client import ApiClient
4544
from hatchet_sdk.clients.rest.configuration import Configuration
46-
from hatchet_sdk.clients.rest.exceptions import (
47-
ApiAttributeError,
48-
ApiException,
49-
ApiKeyError,
50-
ApiTypeError,
51-
ApiValueError,
52-
OpenApiException,
53-
)
54-
from hatchet_sdk.clients.rest.models.accept_invite_request import AcceptInviteRequest
45+
from hatchet_sdk.clients.rest.exceptions import OpenApiException
46+
from hatchet_sdk.clients.rest.exceptions import ApiTypeError
47+
from hatchet_sdk.clients.rest.exceptions import ApiValueError
48+
from hatchet_sdk.clients.rest.exceptions import ApiKeyError
49+
from hatchet_sdk.clients.rest.exceptions import ApiAttributeError
50+
from hatchet_sdk.clients.rest.exceptions import ApiException
5551

5652
# import models into sdk package
5753
from hatchet_sdk.clients.rest.models.api_error import APIError
@@ -62,6 +58,7 @@
6258
from hatchet_sdk.clients.rest.models.api_meta_posthog import APIMetaPosthog
6359
from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta
6460
from hatchet_sdk.clients.rest.models.api_token import APIToken
61+
from hatchet_sdk.clients.rest.models.accept_invite_request import AcceptInviteRequest
6562
from hatchet_sdk.clients.rest.models.bulk_create_event_request import (
6663
BulkCreateEventRequest,
6764
)
@@ -131,8 +128,8 @@
131128
from hatchet_sdk.clients.rest.models.list_pull_requests_response import (
132129
ListPullRequestsResponse,
133130
)
134-
from hatchet_sdk.clients.rest.models.list_slack_webhooks import ListSlackWebhooks
135131
from hatchet_sdk.clients.rest.models.list_sns_integrations import ListSNSIntegrations
132+
from hatchet_sdk.clients.rest.models.list_slack_webhooks import ListSlackWebhooks
136133
from hatchet_sdk.clients.rest.models.log_line import LogLine
137134
from hatchet_sdk.clients.rest.models.log_line_level import LogLineLevel
138135
from hatchet_sdk.clients.rest.models.log_line_list import LogLineList
@@ -163,6 +160,7 @@
163160
ReplayWorkflowRunsResponse,
164161
)
165162
from hatchet_sdk.clients.rest.models.rerun_step_run_request import RerunStepRunRequest
163+
from hatchet_sdk.clients.rest.models.sns_integration import SNSIntegration
166164
from hatchet_sdk.clients.rest.models.schedule_workflow_run_request import (
167165
ScheduleWorkflowRunRequest,
168166
)
@@ -200,7 +198,6 @@
200198
)
201199
from hatchet_sdk.clients.rest.models.semaphore_slots import SemaphoreSlots
202200
from hatchet_sdk.clients.rest.models.slack_webhook import SlackWebhook
203-
from hatchet_sdk.clients.rest.models.sns_integration import SNSIntegration
204201
from hatchet_sdk.clients.rest.models.step import Step
205202
from hatchet_sdk.clients.rest.models.step_run import StepRun
206203
from hatchet_sdk.clients.rest.models.step_run_archive import StepRunArchive
@@ -268,13 +265,13 @@
268265
UserTenantMembershipsList,
269266
)
270267
from hatchet_sdk.clients.rest.models.user_tenant_public import UserTenantPublic
271-
from hatchet_sdk.clients.rest.models.v1_cancel_task_request import V1CancelTaskRequest
272-
from hatchet_sdk.clients.rest.models.v1_cancelled_tasks import V1CancelledTasks
273268
from hatchet_sdk.clients.rest.models.v1_cel_debug_request import V1CELDebugRequest
274269
from hatchet_sdk.clients.rest.models.v1_cel_debug_response import V1CELDebugResponse
275270
from hatchet_sdk.clients.rest.models.v1_cel_debug_response_status import (
276271
V1CELDebugResponseStatus,
277272
)
273+
from hatchet_sdk.clients.rest.models.v1_cancel_task_request import V1CancelTaskRequest
274+
from hatchet_sdk.clients.rest.models.v1_cancelled_tasks import V1CancelledTasks
278275
from hatchet_sdk.clients.rest.models.v1_create_filter_request import (
279276
V1CreateFilterRequest,
280277
)

sdks/python/hatchet_sdk/clients/rest/api/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@
33
# import apis into api package
44
from hatchet_sdk.clients.rest.api.api_token_api import APITokenApi
55
from hatchet_sdk.clients.rest.api.cel_api import CELApi
6-
from hatchet_sdk.clients.rest.api.default_api import DefaultApi
76
from hatchet_sdk.clients.rest.api.event_api import EventApi
87
from hatchet_sdk.clients.rest.api.filter_api import FilterApi
98
from hatchet_sdk.clients.rest.api.github_api import GithubApi
109
from hatchet_sdk.clients.rest.api.healthcheck_api import HealthcheckApi
1110
from hatchet_sdk.clients.rest.api.log_api import LogApi
1211
from hatchet_sdk.clients.rest.api.metadata_api import MetadataApi
1312
from hatchet_sdk.clients.rest.api.rate_limits_api import RateLimitsApi
14-
from hatchet_sdk.clients.rest.api.slack_api import SlackApi
1513
from hatchet_sdk.clients.rest.api.sns_api import SNSApi
14+
from hatchet_sdk.clients.rest.api.slack_api import SlackApi
1615
from hatchet_sdk.clients.rest.api.step_run_api import StepRunApi
1716
from hatchet_sdk.clients.rest.api.task_api import TaskApi
1817
from hatchet_sdk.clients.rest.api.tenant_api import TenantApi
@@ -22,3 +21,4 @@
2221
from hatchet_sdk.clients.rest.api.workflow_api import WorkflowApi
2322
from hatchet_sdk.clients.rest.api.workflow_run_api import WorkflowRunApi
2423
from hatchet_sdk.clients.rest.api.workflow_runs_api import WorkflowRunsApi
24+
from hatchet_sdk.clients.rest.api.default_api import DefaultApi

sdks/python/hatchet_sdk/clients/rest/api/api_token_api.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
# coding: utf-8
22

33
"""
4-
Hatchet API
4+
Hatchet API
55
6-
The Hatchet API
6+
The Hatchet API
77
8-
The version of the OpenAPI document: 1.0.0
9-
Generated by OpenAPI Generator (https://openapi-generator.tech)
8+
The version of the OpenAPI document: 1.0.0
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
11-
Do not edit the class manually.
11+
Do not edit the class manually.
1212
""" # noqa: E501
1313

1414
import warnings
15+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
1516
from typing import Any, Dict, List, Optional, Tuple, Union
16-
17-
from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
1817
from typing_extensions import Annotated
1918

20-
from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized
21-
from hatchet_sdk.clients.rest.api_response import ApiResponse
19+
from pydantic import Field
20+
from typing import Optional
21+
from typing_extensions import Annotated
2222
from hatchet_sdk.clients.rest.models.create_api_token_request import (
2323
CreateAPITokenRequest,
2424
)
@@ -28,6 +28,9 @@
2828
from hatchet_sdk.clients.rest.models.list_api_tokens_response import (
2929
ListAPITokensResponse,
3030
)
31+
32+
from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized
33+
from hatchet_sdk.clients.rest.api_response import ApiResponse
3134
from hatchet_sdk.clients.rest.rest import RESTResponseType
3235

3336

sdks/python/hatchet_sdk/clients/rest/api/cel_api.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
# coding: utf-8
22

33
"""
4-
Hatchet API
4+
Hatchet API
55
6-
The Hatchet API
6+
The Hatchet API
77
8-
The version of the OpenAPI document: 1.0.0
9-
Generated by OpenAPI Generator (https://openapi-generator.tech)
8+
The version of the OpenAPI document: 1.0.0
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
11-
Do not edit the class manually.
11+
Do not edit the class manually.
1212
""" # noqa: E501
1313

1414
import warnings
15+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
1516
from typing import Any, Dict, List, Optional, Tuple, Union
17+
from typing_extensions import Annotated
1618

17-
from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
19+
from pydantic import Field
1820
from typing_extensions import Annotated
21+
from hatchet_sdk.clients.rest.models.v1_cel_debug_request import V1CELDebugRequest
22+
from hatchet_sdk.clients.rest.models.v1_cel_debug_response import V1CELDebugResponse
1923

2024
from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized
2125
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
2426
from hatchet_sdk.clients.rest.rest import RESTResponseType
2527

2628

sdks/python/hatchet_sdk/clients/rest/api/default_api.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
# coding: utf-8
22

33
"""
4-
Hatchet API
4+
Hatchet API
55
6-
The Hatchet API
6+
The Hatchet API
77
8-
The version of the OpenAPI document: 1.0.0
9-
Generated by OpenAPI Generator (https://openapi-generator.tech)
8+
The version of the OpenAPI document: 1.0.0
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
11-
Do not edit the class manually.
11+
Do not edit the class manually.
1212
""" # noqa: E501
1313

1414
import warnings
15+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
1516
from typing import Any, Dict, List, Optional, Tuple, Union
16-
17-
from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
1817
from typing_extensions import Annotated
1918

20-
from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized
21-
from hatchet_sdk.clients.rest.api_response import ApiResponse
19+
from pydantic import Field
20+
from typing import Optional
21+
from typing_extensions import Annotated
2222
from hatchet_sdk.clients.rest.models.info_get_version200_response import (
2323
InfoGetVersion200Response,
2424
)
@@ -36,6 +36,9 @@
3636
from hatchet_sdk.clients.rest.models.webhook_worker_request_list_response import (
3737
WebhookWorkerRequestListResponse,
3838
)
39+
40+
from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized
41+
from hatchet_sdk.clients.rest.api_response import ApiResponse
3942
from hatchet_sdk.clients.rest.rest import RESTResponseType
4043

4144

sdks/python/hatchet_sdk/clients/rest/api/event_api.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
# coding: utf-8
22

33
"""
4-
Hatchet API
4+
Hatchet API
55
6-
The Hatchet API
6+
The Hatchet API
77
8-
The version of the OpenAPI document: 1.0.0
9-
Generated by OpenAPI Generator (https://openapi-generator.tech)
8+
The version of the OpenAPI document: 1.0.0
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
11-
Do not edit the class manually.
11+
Do not edit the class manually.
1212
""" # noqa: E501
1313

1414
import warnings
15-
from datetime import datetime
15+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
1616
from typing import Any, Dict, List, Optional, Tuple, Union
17-
18-
from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
1917
from typing_extensions import Annotated
2018

21-
from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized
22-
from hatchet_sdk.clients.rest.api_response import ApiResponse
19+
from datetime import datetime
20+
from pydantic import Field, StrictInt, StrictStr
21+
from typing import List, Optional
22+
from typing_extensions import Annotated
2323
from hatchet_sdk.clients.rest.models.bulk_create_event_request import (
2424
BulkCreateEventRequest,
2525
)
@@ -42,6 +42,9 @@
4242
from hatchet_sdk.clients.rest.models.v1_event_list import V1EventList
4343
from hatchet_sdk.clients.rest.models.v1_task_status import V1TaskStatus
4444
from hatchet_sdk.clients.rest.models.workflow_run_status import WorkflowRunStatus
45+
46+
from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized
47+
from hatchet_sdk.clients.rest.api_response import ApiResponse
4548
from hatchet_sdk.clients.rest.rest import RESTResponseType
4649

4750

0 commit comments

Comments
 (0)