Skip to content

Commit 258e662

Browse files
authored
Upgrade to Pydantic V2 (#66)
authored-by: M1N0RM1N3R <M1N0RM1N3R@users.noreply.github.com>
1 parent a986fd3 commit 258e662

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "surrealdb"
3-
version = "0.3.1"
3+
version = "0.3.2"
44
description = "The official SurrealDB library for Python."
55
readme = "README.md"
66
authors = ["SurrealDB"]
@@ -24,7 +24,7 @@ classifiers = [
2424
[tool.poetry.dependencies]
2525
python = "^3.7"
2626
httpx = ">=0.23.0"
27-
pydantic = "^1.10.6"
27+
pydantic = "^2.1.0"
2828
websockets = "^10.4"
2929

3030
[tool.poetry.dev-dependencies]

surrealdb/ws.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def validate_params(cls, value): # pylint: disable=no-self-argument
9494
class Config:
9595
"""Represents the configuration of the RPC request."""
9696

97-
allow_mutation = False
97+
frozen = True
9898

9999

100100
class ResponseSuccess(pydantic.BaseModel):
@@ -112,10 +112,10 @@ class Config:
112112
"""Represents the configuration of the RPC request.
113113
114114
Attributes:
115-
allow_mutation: Whether to allow mutation.
115+
frozen: Whether to prohibit mutation.
116116
"""
117117

118-
allow_mutation = False
118+
frozen = True
119119

120120

121121
class ResponseError(pydantic.BaseModel):
@@ -133,10 +133,10 @@ class Config:
133133
"""Represents the configuration of the RPC request.
134134
135135
Attributes:
136-
allow_mutation: Whether to allow mutation.
136+
frozen: Whether to prohibit mutation.
137137
"""
138138

139-
allow_mutation = False
139+
frozen = True
140140

141141

142142
def _validate_response(

0 commit comments

Comments
 (0)