Skip to content

Commit 37bf652

Browse files
committed
readme fixes
1 parent 1098942 commit 37bf652

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Check out this example of modeling customer data with Redis OM. First, we create
9393
import datetime
9494
from typing import Optional
9595

96-
from pydantic.v1 import EmailStr
96+
from pydantic import EmailStr
9797

9898
from redis_om import HashModel
9999

@@ -104,7 +104,7 @@ class Customer(HashModel):
104104
email: EmailStr
105105
join_date: datetime.date
106106
age: int
107-
bio: Optional[str]
107+
bio: Optional[str] = None
108108
```
109109

110110
Now that we have a `Customer` model, let's use it to save customer data to Redis.
@@ -113,7 +113,7 @@ Now that we have a `Customer` model, let's use it to save customer data to Redis
113113
import datetime
114114
from typing import Optional
115115

116-
from pydantic.v1 import EmailStr
116+
from pydantic import EmailStr
117117

118118
from redis_om import HashModel
119119

@@ -124,7 +124,7 @@ class Customer(HashModel):
124124
email: EmailStr
125125
join_date: datetime.date
126126
age: int
127-
bio: Optional[str]
127+
bio: Optional[str] = None
128128

129129

130130
# First, we create a new `Customer` object:
@@ -168,7 +168,7 @@ For example, because we used the `EmailStr` type for the `email` field, we'll ge
168168
import datetime
169169
from typing import Optional
170170

171-
from pydantic.v1 import EmailStr, ValidationError
171+
from pydantic import EmailStr, ValidationError
172172

173173
from redis_om import HashModel
174174

@@ -179,7 +179,7 @@ class Customer(HashModel):
179179
email: EmailStr
180180
join_date: datetime.date
181181
age: int
182-
bio: Optional[str]
182+
bio: Optional[str] = None
183183

184184

185185
try:
@@ -222,7 +222,7 @@ To show how this works, we'll make a small change to the `Customer` model we def
222222
import datetime
223223
from typing import Optional
224224

225-
from pydantic.v1 import EmailStr
225+
from pydantic import EmailStr
226226

227227
from redis_om import (
228228
Field,
@@ -237,7 +237,7 @@ class Customer(HashModel):
237237
email: EmailStr
238238
join_date: datetime.date
239239
age: int = Field(index=True)
240-
bio: Optional[str]
240+
bio: Optional[str] = None
241241

242242

243243
# Now, if we use this model with a Redis deployment that has the
@@ -287,7 +287,7 @@ from redis_om import (
287287

288288
class Address(EmbeddedJsonModel):
289289
address_line_1: str
290-
address_line_2: Optional[str]
290+
address_line_2: Optional[str] = None
291291
city: str = Field(index=True)
292292
state: str = Field(index=True)
293293
country: str

0 commit comments

Comments
 (0)