@@ -84,7 +84,7 @@ class Pet:
8484 client : Cloudant = None
8585 database : CloudantDatabase = None
8686
87- # pylint: disable=too-many-arguments
87+ # pylint: disable=too-many-positional-arguments too-many- arguments
8888 def __init__ (
8989 self ,
9090 name : str = None ,
@@ -185,13 +185,20 @@ def deserialize(self, data: dict) -> None:
185185 if isinstance (data ["available" ], bool ):
186186 self .available = data ["available" ]
187187 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+ )
189192 self .gender = getattr (Gender , data ["gender" ]) # create enum from string
190193 self .birthday = date .fromisoformat (data ["birthday" ])
191194 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
193198 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
195202
196203 # if there is no id and the data has one, assign it
197204 if not self .id and "_id" in data :
@@ -424,7 +431,9 @@ def init_db(dbname: str = "pets"):
424431 )
425432
426433 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
428437
429438 # Create database if it doesn't exist
430439 try :
0 commit comments