@@ -84,7 +84,7 @@ class Pet:
84
84
client : Cloudant = None
85
85
database : CloudantDatabase = None
86
86
87
- # pylint: disable=too-many-arguments
87
+ # pylint: disable=too-many-positional-arguments too-many- arguments
88
88
def __init__ (
89
89
self ,
90
90
name : str = None ,
@@ -185,13 +185,20 @@ def deserialize(self, data: dict) -> None:
185
185
if isinstance (data ["available" ], bool ):
186
186
self .available = data ["available" ]
187
187
else :
188
- raise DataValidationError ("Invalid type for boolean [available]: " + str (type (data ["available" ])))
188
+ raise DataValidationError (
189
+ "Invalid type for boolean [available]: "
190
+ + str (type (data ["available" ]))
191
+ )
189
192
self .gender = getattr (Gender , data ["gender" ]) # create enum from string
190
193
self .birthday = date .fromisoformat (data ["birthday" ])
191
194
except KeyError as error :
192
- raise DataValidationError ("Invalid pet: missing " + error .args [0 ]) from error
195
+ raise DataValidationError (
196
+ "Invalid pet: missing " + error .args [0 ]
197
+ ) from error
193
198
except TypeError as error :
194
- raise DataValidationError ("Invalid pet: body of request contained bad or no data" ) from error
199
+ raise DataValidationError (
200
+ "Invalid pet: body of request contained bad or no data"
201
+ ) from error
195
202
196
203
# if there is no id and the data has one, assign it
197
204
if not self .id and "_id" in data :
@@ -424,7 +431,9 @@ def init_db(dbname: str = "pets"):
424
431
)
425
432
426
433
except ConnectionError as exc :
427
- raise DatabaseConnectionError ("Cloudant service could not be reached" ) from exc
434
+ raise DatabaseConnectionError (
435
+ "Cloudant service could not be reached"
436
+ ) from exc
428
437
429
438
# Create database if it doesn't exist
430
439
try :
0 commit comments