Skip to content

Commit f5b6c49

Browse files
committed
Don't restrict date instances
1 parent 4a29c92 commit f5b6c49

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

temporalio/worker/workflow_sandbox/_restrictions.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from __future__ import annotations
88

99
import dataclasses
10+
import datetime
1011
import functools
1112
import inspect
1213
import logging
@@ -17,7 +18,6 @@
1718
import warnings
1819
from copy import copy, deepcopy
1920
from dataclasses import dataclass
20-
from datetime import datetime
2121
from typing import (
2222
Any,
2323
Callable,
@@ -952,7 +952,18 @@ def r_op(obj: Any, other: Any) -> Any:
952952

953953
def _is_restrictable(v: Any) -> bool:
954954
return v is not None and not isinstance(
955-
v, (bool, int, float, complex, str, bytes, bytearray, datetime)
955+
v,
956+
(
957+
bool,
958+
int,
959+
float,
960+
complex,
961+
str,
962+
bytes,
963+
bytearray,
964+
datetime.date,
965+
datetime.datetime,
966+
),
956967
)
957968

958969

0 commit comments

Comments
 (0)