Skip to content

Commit fc66b80

Browse files
committed
fix annotations for python < 3.10
1 parent 623f714 commit fc66b80

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tests/test_knn_expression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# type: ignore
22
import abc
33
import struct
4-
import time
4+
from typing import Optional
55

66
import pytest_asyncio
77

@@ -30,7 +30,7 @@ class Meta:
3030
class Member(BaseJsonModel, index=True):
3131
name: str
3232
embeddings: list[list[float]] = Field([], vector_options=vector_field_options)
33-
embeddings_score: float | None = None
33+
embeddings_score: Optional[float] = None
3434

3535
await Migrator().run()
3636

tests/test_pydantic_integrations.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import abc
22
import datetime
33
from collections import namedtuple
4+
from typing import Optional
45

56
import pytest
67
import pytest_asyncio
@@ -55,7 +56,7 @@ def test_validator_sets_value_on_init():
5556
value = "bar"
5657

5758
class ModelWithValidator(HashModel):
58-
field: str | None = Field(default=None, index=True)
59+
field: Optional[str] = Field(default=None, index=True)
5960

6061
@field_validator("field", mode="after")
6162
def set_field(cls, v):

0 commit comments

Comments
 (0)