Skip to content

Commit 068f300

Browse files
committed
Get rid of IPV4Address
1 parent 66cbe5c commit 068f300

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

tests/contrib/test_pydantic.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1+
import datetime
12
import uuid
2-
from datetime import datetime, timedelta
3-
from ipaddress import IPv4Address
43
from typing import List
54

65
from pydantic import BaseModel
@@ -12,8 +11,7 @@
1211

1312

1413
class MyPydanticModel(BaseModel):
15-
some_ip: IPv4Address
16-
some_date: datetime
14+
some_date: datetime.datetime
1715

1816

1917
@activity.defn
@@ -28,7 +26,7 @@ class MyWorkflow:
2826
async def run(self, models: List[MyPydanticModel]) -> List[MyPydanticModel]:
2927
workflow.logger.info("Got models in workflow: %s" % models)
3028
return await workflow.execute_activity(
31-
my_activity, models, start_to_close_timeout=timedelta(minutes=1)
29+
my_activity, models, start_to_close_timeout=datetime.timedelta(minutes=1)
3230
)
3331

3432

@@ -41,12 +39,10 @@ async def test_workflow_with_pydantic_model(client: Client):
4139

4240
orig_models = [
4341
MyPydanticModel(
44-
some_ip=IPv4Address("127.0.0.1"),
45-
some_date=datetime(2000, 1, 2, 3, 4, 5),
42+
some_date=datetime.datetime(2000, 1, 2, 3, 4, 5),
4643
),
4744
MyPydanticModel(
48-
some_ip=IPv4Address("127.0.0.2"),
49-
some_date=datetime(2001, 2, 3, 4, 5, 6),
45+
some_date=datetime.datetime(2001, 2, 3, 4, 5, 6),
5046
),
5147
]
5248

0 commit comments

Comments
 (0)