Skip to content

Commit 8d1f249

Browse files
authored
re-enable pydantic 1.9 (#283)
1 parent 561548e commit 8d1f249

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

postgrest/base_request_builder.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@
1818

1919
from httpx import Headers, QueryParams
2020
from httpx import Response as RequestResponse
21-
from pydantic import BaseModel, field_validator
21+
from pydantic import BaseModel
22+
23+
try:
24+
# >= 2.0.0
25+
from pydantic import field_validator
26+
except ImportError:
27+
# < 2.0.0
28+
from pydantic import validator as field_validator
2229

2330
from .types import CountMethod, Filters, RequestMethod, ReturnMethod
2431
from .utils import AsyncClient, SyncClient, sanitize_param

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ packages = [
2121
python = "^3.8"
2222
httpx = "^0.24.0"
2323
deprecation = "^2.1.0"
24-
pydantic = ">=2.1.0,<3.0"
24+
pydantic = ">=1.9,<3.0"
2525
strenum = "^0.4.9"
2626

2727
[tool.poetry.dev-dependencies]

0 commit comments

Comments
 (0)