Skip to content

Commit 8be76d4

Browse files
elena-kolevskaDruid-of-Luhnfamartingdependabot[bot]hhunter-ms
authored
Update release 1.15 branch from master (#767)
* Removes support for 3.8 and adds 3.13 to test version matrix (#763) Signed-off-by: Elena Kolevska <[email protected]> * Updates protos and fixes grpc-tools for protos generation (#766) * Updates protos and fixes grpc-tools for protos generation Signed-off-by: Elena Kolevska <[email protected]> * bumps grpcio tools version Signed-off-by: Elena Kolevska <[email protected]> --------- Signed-off-by: Elena Kolevska <[email protected]> * Add DaprInternalError.as_json_safe_dict for actors (#765) The FastAPI and Flask extensions for actors serialise the value of any raised DaprInternalError to JSON, which fails if the error contains bytes in its `_raw_response_bytes` field. This change adds a new `as_json_safe_dict` method and uses it in place of the `as_dict` method in the FastAPI and Flask extensions. Two unit tests for the `as_json_safe_dict` method are included. Signed-off-by: Billy Brown <[email protected]> Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> * workflows: update durabletask dependency (#757) * Bump codecov/codecov-action from 4 to 5 (#753) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v4...v5) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Elena Kolevska <[email protected]> * update durabletask to use fork Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> * add purge workflow function Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> * support reuse id policy Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> * support set custom status Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> * Update ext/dapr-ext-workflow/dapr/ext/workflow/dapr_workflow_client.py Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> * Update ext/dapr-ext-workflow/dapr/ext/workflow/dapr_workflow_client.py Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> * Update ext/dapr-ext-workflow/tests/test_workflow_client.py Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> * Update ext/dapr-ext-workflow/dapr/ext/workflow/dapr_workflow_client.py Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> * update test, grpc version and lint Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> * Adds missing arguments in FakeTaskHubGrpcClient Signed-off-by: Elena Kolevska <[email protected]> * linter Signed-off-by: Elena Kolevska <[email protected]> * remove alpha for workflow stable release (#760) Signed-off-by: Hannah Hunter <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> * Replace deprecated tox.ini option (#762) This option was replaced in 2020, deprecated, and eventually removed in tox 4. The correct option already appears elseware in this tox.ini file. This fix is necessary to run `tox -e doc` per the README.md instructions on tox 4. Signed-off-by: Eric Searcy <[email protected]> Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> * Add Actor Mocks (#750) * Moved files to new branch to avoid weird git bug Signed-off-by: Lorenzo Curcio <[email protected]> * requested documentation changes Signed-off-by: Lorenzo Curcio <[email protected]> * forgot to move file back to starting point Signed-off-by: Lorenzo Curcio <[email protected]> * result of ruff format Signed-off-by: Lorenzo Curcio <[email protected]> * fixed minor formatting issues, fixed type issues Signed-off-by: Lorenzo Curcio <[email protected]> * minor test fix Signed-off-by: Lorenzo Curcio <[email protected]> * fixes try_add_state Signed-off-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * Revert "fixes try_add_state" This reverts commit 254ad17. Signed-off-by: Lorenzo Curcio <[email protected]> * Update dapr/actor/runtime/mock_state_manager.py Fixing bug in try_add_state as mentioned in PR #756 Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * Update dapr/actor/runtime/mock_actor.py Whoops missed this Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * Update daprdocs/content/en/python-sdk-docs/python-actor.md Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * Update daprdocs/content/en/python-sdk-docs/python-actor.md Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * Update daprdocs/content/en/python-sdk-docs/python-actor.md Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * Update daprdocs/content/en/python-sdk-docs/python-actor.md Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * Update daprdocs/content/en/python-sdk-docs/python-actor.md Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * Update daprdocs/content/en/python-sdk-docs/python-actor.md Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * Update daprdocs/content/en/python-sdk-docs/python-actor.md Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * minor error in docs Signed-off-by: Lorenzo Curcio <[email protected]> * fixed and added more unit tests. Added example Signed-off-by: Lorenzo Curcio <[email protected]> * unittest fix Signed-off-by: Lorenzo Curcio <[email protected]> * Update examples/demo_actor/README.md Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * concentrated some tests Signed-off-by: Lorenzo Curcio <[email protected]> * removed unnecessary type hint Signed-off-by: Lorenzo Curcio <[email protected]> * Update daprdocs/content/en/python-sdk-docs/python-actor.md didnt see this earlier whoops Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * Update examples/demo_actor/README.md Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * documentation changes Signed-off-by: Lorenzo Curcio <[email protected]> * now requires #type: ignore Signed-off-by: Lorenzo Curcio <[email protected]> * small docs change Signed-off-by: Elena Kolevska <[email protected]> * examples test fix Signed-off-by: Elena Kolevska <[email protected]> --------- Signed-off-by: Lorenzo Curcio <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> Co-authored-by: Elena Kolevska <[email protected]> Co-authored-by: Lorenzo Curcio <[email protected]> Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> * Fixes try_add_state in actor state manger (#756) Signed-off-by: Elena Kolevska <[email protected]> * Integration test for http invocation (#758) Signed-off-by: Elena Kolevska <[email protected]> * fixes missing state store in test (#759) Signed-off-by: Elena Kolevska <[email protected]> * Mark workflows API functions as deprecated (#749) * workflows, remove deprecated functions Signed-off-by: Fabian Martinez <[email protected]> * revert changes to example Signed-off-by: Fabian Martinez <[email protected]> * update warning messages Signed-off-by: Fabian Martinez <[email protected]> * Typos Signed-off-by: Elena Kolevska <[email protected]> * fixes linter Signed-off-by: Elena Kolevska <[email protected]> * Apply suggestions from code review Signed-off-by: Elena Kolevska <[email protected]> * Apply suggestions from code review Signed-off-by: Elena Kolevska <[email protected]> --------- Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> Co-authored-by: Elena Kolevska <[email protected]> Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> * Removes support for 3.8 and adds 3.13 to test version matrix (#763) Signed-off-by: Elena Kolevska <[email protected]> * Updates dapr email to dapr.io (#764) Signed-off-by: Elena Kolevska <[email protected]> * Reverts grpc bump Signed-off-by: Elena Kolevska <[email protected]> * Updates protos and fixes grpc-tools for protos generation (#766) * Updates protos and fixes grpc-tools for protos generation Signed-off-by: Elena Kolevska <[email protected]> * bumps grpcio tools version Signed-off-by: Elena Kolevska <[email protected]> --------- Signed-off-by: Elena Kolevska <[email protected]> * Bump dapr/durabletask version Signed-off-by: Elena Kolevska <[email protected]> --------- Signed-off-by: Elena Kolevska <[email protected]> Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Hannah Hunter <[email protected]> Signed-off-by: Eric Searcy <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Elena Kolevska <[email protected]> Co-authored-by: Elena Kolevska <[email protected]> Co-authored-by: Hannah Hunter <[email protected]> Co-authored-by: Eric Searcy <[email protected]> Co-authored-by: Lorenzo Curcio <[email protected]> Co-authored-by: Lorenzo Curcio <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> --------- Signed-off-by: Elena Kolevska <[email protected]> Signed-off-by: Billy Brown <[email protected]> Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Hannah Hunter <[email protected]> Signed-off-by: Eric Searcy <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> Co-authored-by: Billy Brown <[email protected]> Co-authored-by: Fabian Martinez <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Hannah Hunter <[email protected]> Co-authored-by: Eric Searcy <[email protected]> Co-authored-by: Lorenzo Curcio <[email protected]> Co-authored-by: Lorenzo Curcio <[email protected]>
1 parent 53431ab commit 8be76d4

File tree

21 files changed

+273
-162
lines changed

21 files changed

+273
-162
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ The generated files will be found in `docs/_build`.
137137
## Generate gRPC Protobuf client
138138

139139
```sh
140-
pip3 install -r dev-requirements.txt
141-
140+
pip3 install -r tools/requirements.txt
142141
./tools/regen_grpcclient.sh
143142
```
144143

dapr/clients/exceptions.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
See the License for the specific language governing permissions and
1313
limitations under the License.
1414
"""
15+
import base64
1516
import json
1617
from typing import Optional
1718

@@ -44,6 +45,17 @@ def as_dict(self):
4445
'raw_response_bytes': self._raw_response_bytes,
4546
}
4647

48+
def as_json_safe_dict(self):
49+
error_dict = self.as_dict()
50+
51+
if self._raw_response_bytes is not None:
52+
# Encode bytes to base64 for JSON compatibility
53+
error_dict['raw_response_bytes'] = base64.b64encode(self._raw_response_bytes).decode(
54+
'utf-8'
55+
)
56+
57+
return error_dict
58+
4759

4860
class StatusDetails:
4961
def __init__(self):

dapr/proto/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ source <env_name>/bin/activate
1212
Run the following commands:
1313

1414
```sh
15-
pip3 install -r dev-requirements.txt
15+
pip3 install -r tools/requirements.txt
1616
./tools/regen_grpcclient.sh
1717
```
1818

dapr/proto/common/v1/common_pb2.py

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dapr/proto/runtime/v1/appcallback_pb2.py

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dapr/proto/runtime/v1/dapr_pb2.py

Lines changed: 104 additions & 90 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dapr/proto/runtime/v1/dapr_pb2.pyi

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3261,8 +3261,8 @@ class DeleteJobResponse(google.protobuf.message.Message):
32613261
global___DeleteJobResponse = DeleteJobResponse
32623262

32633263
@typing_extensions.final
3264-
class ConversationAlpha1Request(google.protobuf.message.Message):
3265-
"""ConversationAlpha1Request is the request object for Conversation."""
3264+
class ConversationRequest(google.protobuf.message.Message):
3265+
"""ConversationRequest is the request object for Conversation."""
32663266

32673267
DESCRIPTOR: google.protobuf.descriptor.Descriptor
32683268

@@ -3308,7 +3308,7 @@ class ConversationAlpha1Request(google.protobuf.message.Message):
33083308
SCRUBPII_FIELD_NUMBER: builtins.int
33093309
TEMPERATURE_FIELD_NUMBER: builtins.int
33103310
name: builtins.str
3311-
"""The name of Coverstaion component"""
3311+
"""The name of Conversation component"""
33123312
contextID: builtins.str
33133313
"""The ID of an existing chat (like in ChatGPT)"""
33143314
@property
@@ -3344,7 +3344,7 @@ class ConversationAlpha1Request(google.protobuf.message.Message):
33443344
@typing.overload
33453345
def WhichOneof(self, oneof_group: typing_extensions.Literal["_temperature", b"_temperature"]) -> typing_extensions.Literal["temperature"] | None: ...
33463346

3347-
global___ConversationAlpha1Request = ConversationAlpha1Request
3347+
global___ConversationRequest = ConversationRequest
33483348

33493349
@typing_extensions.final
33503350
class ConversationInput(google.protobuf.message.Message):
@@ -3376,8 +3376,8 @@ class ConversationInput(google.protobuf.message.Message):
33763376
global___ConversationInput = ConversationInput
33773377

33783378
@typing_extensions.final
3379-
class ConversationAlpha1Result(google.protobuf.message.Message):
3380-
"""ConversationAlpha1Result is the result for one input."""
3379+
class ConversationResult(google.protobuf.message.Message):
3380+
"""ConversationResult is the result for one input."""
33813381

33823382
DESCRIPTOR: google.protobuf.descriptor.Descriptor
33833383

@@ -3414,11 +3414,11 @@ class ConversationAlpha1Result(google.protobuf.message.Message):
34143414
) -> None: ...
34153415
def ClearField(self, field_name: typing_extensions.Literal["parameters", b"parameters", "result", b"result"]) -> None: ...
34163416

3417-
global___ConversationAlpha1Result = ConversationAlpha1Result
3417+
global___ConversationResult = ConversationResult
34183418

34193419
@typing_extensions.final
3420-
class ConversationAlpha1Response(google.protobuf.message.Message):
3421-
"""ConversationAlpha1Response is the response for Conversation."""
3420+
class ConversationResponse(google.protobuf.message.Message):
3421+
"""ConversationResponse is the response for Conversation."""
34223422

34233423
DESCRIPTOR: google.protobuf.descriptor.Descriptor
34243424

@@ -3427,16 +3427,16 @@ class ConversationAlpha1Response(google.protobuf.message.Message):
34273427
contextID: builtins.str
34283428
"""The ID of an existing chat (like in ChatGPT)"""
34293429
@property
3430-
def outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ConversationAlpha1Result]:
3430+
def outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ConversationResult]:
34313431
"""An array of results."""
34323432
def __init__(
34333433
self,
34343434
*,
34353435
contextID: builtins.str | None = ...,
3436-
outputs: collections.abc.Iterable[global___ConversationAlpha1Result] | None = ...,
3436+
outputs: collections.abc.Iterable[global___ConversationResult] | None = ...,
34373437
) -> None: ...
34383438
def HasField(self, field_name: typing_extensions.Literal["_contextID", b"_contextID", "contextID", b"contextID"]) -> builtins.bool: ...
34393439
def ClearField(self, field_name: typing_extensions.Literal["_contextID", b"_contextID", "contextID", b"contextID", "outputs", b"outputs"]) -> None: ...
34403440
def WhichOneof(self, oneof_group: typing_extensions.Literal["_contextID", b"_contextID"]) -> typing_extensions.Literal["contextID"] | None: ...
34413441

3442-
global___ConversationAlpha1Response = ConversationAlpha1Response
3442+
global___ConversationResponse = ConversationResponse

dapr/proto/runtime/v1/dapr_pb2_grpc.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ def __init__(self, channel):
309309
)
310310
self.ConverseAlpha1 = channel.unary_unary(
311311
'/dapr.proto.runtime.v1.Dapr/ConverseAlpha1',
312-
request_serializer=dapr_dot_proto_dot_runtime_dot_v1_dot_dapr__pb2.ConversationAlpha1Request.SerializeToString,
313-
response_deserializer=dapr_dot_proto_dot_runtime_dot_v1_dot_dapr__pb2.ConversationAlpha1Response.FromString,
312+
request_serializer=dapr_dot_proto_dot_runtime_dot_v1_dot_dapr__pb2.ConversationRequest.SerializeToString,
313+
response_deserializer=dapr_dot_proto_dot_runtime_dot_v1_dot_dapr__pb2.ConversationResponse.FromString,
314314
)
315315

316316

@@ -1028,8 +1028,8 @@ def add_DaprServicer_to_server(servicer, server):
10281028
),
10291029
'ConverseAlpha1': grpc.unary_unary_rpc_method_handler(
10301030
servicer.ConverseAlpha1,
1031-
request_deserializer=dapr_dot_proto_dot_runtime_dot_v1_dot_dapr__pb2.ConversationAlpha1Request.FromString,
1032-
response_serializer=dapr_dot_proto_dot_runtime_dot_v1_dot_dapr__pb2.ConversationAlpha1Response.SerializeToString,
1031+
request_deserializer=dapr_dot_proto_dot_runtime_dot_v1_dot_dapr__pb2.ConversationRequest.FromString,
1032+
response_serializer=dapr_dot_proto_dot_runtime_dot_v1_dot_dapr__pb2.ConversationResponse.SerializeToString,
10331033
),
10341034
}
10351035
generic_handler = grpc.method_handlers_generic_handler(
@@ -2040,7 +2040,7 @@ def ConverseAlpha1(request,
20402040
timeout=None,
20412041
metadata=None):
20422042
return grpc.experimental.unary_unary(request, target, '/dapr.proto.runtime.v1.Dapr/ConverseAlpha1',
2043-
dapr_dot_proto_dot_runtime_dot_v1_dot_dapr__pb2.ConversationAlpha1Request.SerializeToString,
2044-
dapr_dot_proto_dot_runtime_dot_v1_dot_dapr__pb2.ConversationAlpha1Response.FromString,
2043+
dapr_dot_proto_dot_runtime_dot_v1_dot_dapr__pb2.ConversationRequest.SerializeToString,
2044+
dapr_dot_proto_dot_runtime_dot_v1_dot_dapr__pb2.ConversationResponse.FromString,
20452045
options, channel_credentials,
20462046
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ Flask>=1.1
1515
# needed for auto fix
1616
ruff===0.2.2
1717
# needed for dapr-ext-workflow
18-
durabletask>=0.1.1a1
18+
durabletask-dapr >= 0.2.0a4

examples/workflow/monitor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def send_alert(ctx, message: str):
6969
except Exception:
7070
pass
7171
if not status or status.runtime_status.name != 'RUNNING':
72+
# TODO update to use reuse_id_policy
7273
instance_id = wf_client.schedule_new_workflow(
7374
workflow=status_monitor_workflow,
7475
input=JobStatus(job_id=job_id, is_healthy=True),

0 commit comments

Comments
 (0)