Skip to content

Commit e731739

Browse files
committed
Fix entity snapshot restoration
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 643dfa24-59f4-4119-9377-0d9e488df141
1 parent c82f23b commit e731739

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • azure-functions-durable/azure/durable_functions/testing

azure-functions-durable/azure/durable_functions/testing/entity.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import inspect
99
from dataclasses import dataclass
1010
from datetime import datetime, timezone
11-
from typing import Any, Callable, TypeAlias
11+
from typing import Any, Callable, TypeAlias, cast
1212

1313
from durabletask.entities import DurableEntity, EntityContext, EntityInstanceId
1414
from durabletask.internal import type_discovery
@@ -247,8 +247,8 @@ def _restore_snapshot(
247247
) -> Any:
248248
if value is None:
249249
return None
250-
value_type: type[Any] = type(value)
251-
return converter.deserialize(encoded_value, value_type)
250+
value_type = cast(type[Any], type(value))
251+
return converter.deserialize(encoded_value, value_type)
252252

253253

254254
def _invoke_entity(

0 commit comments

Comments
 (0)