Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions python/restate/serde.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def from_dict(a,b): # pylint: disable=too-few-public-methods,unused-argument
return to_dict, from_dict

PydanticBaseModel = try_import_pydantic_base_model()
# pylint: disable=C0103
DaciteToDict, DaciteFromDict = try_import_from_dacite()

T = typing.TypeVar('T')
Expand Down
5 changes: 4 additions & 1 deletion python/restate/server_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import asyncio
import contextvars
import copy
from random import Random
from datetime import timedelta
import inspect
Expand Down Expand Up @@ -612,10 +613,12 @@ def run_typed(
**kwargs: P.kwargs,
) -> RestateDurableFuture[T]:
if isinstance(options.serde, DefaultSerde):
# Copy options, as we're going to mutate type_hint and serde
options = copy.copy(options)
if options.type_hint is None:
signature = inspect.signature(action, eval_str=True)
options.type_hint = signature.return_annotation
options.serde = options.serde.with_maybe_type(options.type_hint)
options.serde = typing.cast(DefaultSerde, options.serde).with_maybe_type(options.type_hint)
handle = self.vm.sys_run(name)
update_restate_context_is_replaying(self.vm)

Expand Down