Skip to content

Commit 03c89d9

Browse files
committed
Cleanup
1 parent 887140c commit 03c89d9

17 files changed

+66
-522
lines changed

Makefile

Lines changed: 0 additions & 5 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ informal introduction to the features and their implementation.
9797
- [Worker Shutdown](#worker-shutdown)
9898
- [Testing](#testing-1)
9999
- [Nexus](#nexus)
100-
- [hello](#hello)
101100
- [Workflow Replay](#workflow-replay)
102101
- [Observability](#observability)
103102
- [Metrics](#metrics)

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ keywords = [
1212
]
1313
dependencies = [
1414
"nexus-rpc",
15-
"pdbpp>=0.11.6",
1615
"protobuf>=3.20",
1716
"python-dateutil>=2.8.2,<3 ; python_version < '3.11'",
1817
"types-protobuf>=3.20",
@@ -52,7 +51,6 @@ dev = [
5251
"ruff>=0.5.0,<0.6",
5352
"maturin>=1.8.2",
5453
"pytest-cov>=6.1.1",
55-
"ty>=0.0.0a7",
5654
"httpx>=0.28.1",
5755
"pytest-pretty>=1.3.0",
5856
]
@@ -66,8 +64,8 @@ gen-protos = "uv run python scripts/gen_protos.py"
6664
lint = [
6765
{cmd = "uv run ruff check --select I"},
6866
{cmd = "uv run ruff format --check"},
69-
{cmd = "uv run pyright"},
7067
{ref = "lint-types"},
68+
{cmd = "uv run pyright"},
7169
{ref = "lint-docs"},
7270
]
7371
bridge-lint = { cmd = "cargo clippy -- -D warnings", cwd = "temporalio/bridge" }
@@ -76,7 +74,7 @@ bridge-lint = { cmd = "cargo clippy -- -D warnings", cwd = "temporalio/bridge" }
7674
lint-docs = "uv run pydocstyle --ignore-decorators=overload"
7775
lint-types = "uv run mypy --namespace-packages --check-untyped-defs ."
7876
run-bench = "uv run python scripts/run_bench.py"
79-
test = "uv run pytest --cov temporalio --cov-report xml"
77+
test = "uv run pytest"
8078

8179

8280
[tool.pytest.ini_options]
@@ -89,6 +87,8 @@ testpaths = ["tests"]
8987
timeout = 600
9088
timeout_func_only = true
9189
filterwarnings = [
90+
"error::temporalio.workflow.UnfinishedUpdateHandlersWarning",
91+
"error::temporalio.workflow.UnfinishedSignalHandlersWarning",
9292
"ignore::pytest.PytestDeprecationWarning",
9393
"ignore::DeprecationWarning",
9494
]

temporalio/bridge/sdk-core

Submodule sdk-core updated 108 files

temporalio/client.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -530,11 +530,6 @@ async def start_workflow(
530530
temporalio.workflow._Definition.get_name_and_result_type(workflow)
531531
)
532532

533-
for l in workflow_event_links:
534-
print(
535-
f"🌈@@ worker starting workflow with link: {google.protobuf.json_format.MessageToJson(l)}"
536-
)
537-
538533
return await self._impl.start_workflow(
539534
StartWorkflowInput(
540535
workflow=name,

temporalio/converter.py

Lines changed: 1 addition & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ def _error_to_failure(
908908
failure.child_workflow_execution_failure_info.retry_state = (
909909
temporalio.api.enums.v1.RetryState.ValueType(error.retry_state or 0)
910910
)
911-
# TODO(dan): test coverage for this
911+
# TODO(nexus-prerelease): test coverage for this
912912
elif isinstance(error, temporalio.exceptions.NexusOperationError):
913913
failure.nexus_operation_execution_failure_info.SetInParent()
914914
failure.nexus_operation_execution_failure_info.operation_token = (
@@ -921,44 +921,6 @@ def from_failure(
921921
payload_converter: PayloadConverter,
922922
) -> BaseException:
923923
"""See base class."""
924-
925-
# message Failure {
926-
# string message = 1;
927-
# // The source this Failure originated in, e.g. TypeScriptSDK / JavaSDK
928-
# // In some SDKs this is used to rehydrate the stack trace into an exception object.
929-
# string source = 2;
930-
# string stack_trace = 3;
931-
# // Alternative way to supply `message` and `stack_trace` and possibly other attributes, used for encryption of
932-
# // errors originating in user code which might contain sensitive information.
933-
# // The `encoded_attributes` Payload could represent any serializable object, e.g. JSON object or a `Failure` proto
934-
# // message.
935-
# //
936-
# // SDK authors:
937-
# // - The SDK should provide a default `encodeFailureAttributes` and `decodeFailureAttributes` implementation that:
938-
# // - Uses a JSON object to represent `{ message, stack_trace }`.
939-
# // - Overwrites the original message with "Encoded failure" to indicate that more information could be extracted.
940-
# // - Overwrites the original stack_trace with an empty string.
941-
# // - The resulting JSON object is converted to Payload using the default PayloadConverter and should be processed
942-
# // by the user-provided PayloadCodec
943-
# //
944-
# // - If there's demand, we could allow overriding the default SDK implementation to encode other opaque Failure attributes.
945-
# // (-- api-linter: core::0203::optional=disabled --)
946-
# temporal.api.common.v1.Payload encoded_attributes = 20;
947-
# Failure cause = 4;
948-
# oneof failure_info {
949-
# ApplicationFailureInfo application_failure_info = 5;
950-
# TimeoutFailureInfo timeout_failure_info = 6;
951-
# CanceledFailureInfo canceled_failure_info = 7;
952-
# TerminatedFailureInfo terminated_failure_info = 8;
953-
# ServerFailureInfo server_failure_info = 9;
954-
# ResetWorkflowFailureInfo reset_workflow_failure_info = 10;
955-
# ActivityFailureInfo activity_failure_info = 11;
956-
# ChildWorkflowExecutionFailureInfo child_workflow_execution_failure_info = 12;
957-
# NexusOperationFailureInfo nexus_operation_execution_failure_info = 13;
958-
# NexusHandlerFailureInfo nexus_handler_failure_info = 14;
959-
# }
960-
# }
961-
962924
# If encoded attributes are present and have the fields we expect,
963925
# extract them
964926
if failure.HasField("encoded_attributes"):
@@ -1032,15 +994,6 @@ def from_failure(
1032994
else None,
1033995
)
1034996
elif failure.HasField("child_workflow_execution_failure_info"):
1035-
# message ChildWorkflowExecutionFailureInfo {
1036-
# string namespace = 1;
1037-
# temporal.api.common.v1.WorkflowExecution workflow_execution = 2;
1038-
# temporal.api.common.v1.WorkflowType workflow_type = 3;
1039-
# int64 initiated_event_id = 4;
1040-
# int64 started_event_id = 5;
1041-
# temporal.api.enums.v1.RetryState retry_state = 6;
1042-
# }
1043-
1044997
child_info = failure.child_workflow_execution_failure_info
1045998
err = temporalio.exceptions.ChildWorkflowError(
1046999
failure.message or "Child workflow error",
@@ -1057,15 +1010,6 @@ def from_failure(
10571010
else None,
10581011
)
10591012
elif failure.HasField("nexus_handler_failure_info"):
1060-
# message NexusHandlerFailureInfo {
1061-
# // The Nexus error type as defined in the spec:
1062-
# // https://github.com/nexus-rpc/api/blob/main/SPEC.md#predefined-handler-errors.
1063-
# string type = 1;
1064-
# // Retry behavior, defaults to the retry behavior of the error type as defined in the spec.
1065-
# temporal.api.enums.v1.NexusHandlerErrorRetryBehavior retry_behavior = 2;
1066-
# }
1067-
# TODO(dan): check that handler-side phenomena are correctly turning into this vs nexus_operation_execution_failure_info
1068-
# TODO(dan): What exception should be raised for this vs nexus_operation_execution_failure_info?
10691013
nexus_handler_failure_info = failure.nexus_handler_failure_info
10701014
err = temporalio.exceptions.NexusHandlerError(
10711015
failure.message or "Nexus handler error",
@@ -1075,26 +1019,7 @@ def from_failure(
10751019
temporalio.api.enums.v1.NexusHandlerErrorRetryBehavior.NEXUS_HANDLER_ERROR_RETRY_BEHAVIOR_NON_RETRYABLE: False,
10761020
}.get(nexus_handler_failure_info.retry_behavior),
10771021
)
1078-
print(f"got err {err.__class__} with retryable", err._retryable)
10791022
elif failure.HasField("nexus_operation_execution_failure_info"):
1080-
# message NexusOperationFailureInfo {
1081-
# // The NexusOperationScheduled event ID.
1082-
# int64 scheduled_event_id = 1;
1083-
# // Endpoint name.
1084-
# string endpoint = 2;
1085-
# // Service name.
1086-
# string service = 3;
1087-
# // Operation name.
1088-
# string operation = 4;
1089-
# // Operation ID - may be empty if the operation completed synchronously.
1090-
# //
1091-
# // Deprecated: Renamed to operation_token.
1092-
# string operation_id = 5;
1093-
# // Operation token - may be empty if the operation completed synchronously.
1094-
# string operation_token = 6;
1095-
# }
1096-
# TODO(dan)
1097-
# This is covered by cancellation tests
10981023
nexus_op_failure_info = failure.nexus_operation_execution_failure_info
10991024
err = temporalio.exceptions.NexusOperationError(
11001025
failure.message or "Nexus operation error",

temporalio/exceptions.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,6 @@ def non_retryable(self) -> bool:
127127
"""
128128
return self._non_retryable
129129

130-
@property
131-
def retryable(self) -> bool:
132-
"""Whether the error is retryable.
133-
134-
This is the inverse of :py:attr:`non_retryable`.
135-
"""
136-
return not self._non_retryable
137-
138130
@property
139131
def next_retry_delay(self) -> Optional[timedelta]:
140132
"""Delay before the next activity retry attempt.
@@ -312,15 +304,6 @@ def retry_state(self) -> Optional[RetryState]:
312304
class ChildWorkflowError(FailureError):
313305
"""Error raised on child workflow failure."""
314306

315-
# message ChildWorkflowExecutionFailureInfo {
316-
# string namespace = 1;
317-
# temporal.api.common.v1.WorkflowExecution workflow_execution = 2;
318-
# temporal.api.common.v1.WorkflowType workflow_type = 3;
319-
# int64 initiated_event_id = 4;
320-
# int64 started_event_id = 5;
321-
# temporal.api.enums.v1.RetryState retry_state = 6;
322-
# }
323-
324307
def __init__(
325308
self,
326309
message: str,
@@ -382,14 +365,6 @@ def retry_state(self) -> Optional[RetryState]:
382365
class NexusHandlerError(FailureError):
383366
"""Error raised on Nexus handler failure."""
384367

385-
# message NexusHandlerFailureInfo {
386-
# // The Nexus error type as defined in the spec:
387-
# // https://github.com/nexus-rpc/api/blob/main/SPEC.md#predefined-handler-errors.
388-
# string type = 1;
389-
# // Retry behavior, defaults to the retry behavior of the error type as defined in the spec.
390-
# temporal.api.enums.v1.NexusHandlerErrorRetryBehavior retry_behavior = 2;
391-
# }
392-
393368
def __init__(
394369
self,
395370
message: str,
@@ -406,23 +381,6 @@ def __init__(
406381
class NexusOperationError(FailureError):
407382
"""Error raised on Nexus operation failure."""
408383

409-
# message NexusOperationFailureInfo {
410-
# // The NexusOperationScheduled event ID.
411-
# int64 scheduled_event_id = 1;
412-
# // Endpoint name.
413-
# string endpoint = 2;
414-
# // Service name.
415-
# string service = 3;
416-
# // Operation name.
417-
# string operation = 4;
418-
# // Operation ID - may be empty if the operation completed synchronously.
419-
# //
420-
# // Deprecated: Renamed to operation_token.
421-
# string operation_id = 5;
422-
# // Operation token - may be empty if the operation completed synchronously.
423-
# string operation_token = 6;
424-
# }
425-
426384
def __init__(
427385
self,
428386
message: str,

0 commit comments

Comments
 (0)