File tree Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,6 @@ disable=
8787 attribute-defined-outside-init, # TODO: Fix scope
8888 protected-access, # TODO: Fix access
8989 abstract-method, # TODO: Fix abstract methods
90- unidiomatic-typecheck, # TODO: Fix typechecks
9190 wrong-import-order, # TODO: Fix import order
9291 no-else-return, # TODO: Remove unnecessary elses
9392 useless-object-inheritance, # TODO: Remove unnecessary imports
Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ def _compilation_job_config(
176176 input_model_config = {
177177 "S3Uri" : self .model_data ,
178178 "DataInputConfig" : input_shape
179- if type (input_shape ) != dict
179+ if not isinstance (input_shape , dict )
180180 else json .dumps (input_shape ),
181181 "Framework" : framework ,
182182 }
Original file line number Diff line number Diff line change @@ -83,23 +83,23 @@ def sanitize(vpc_config):
8383 """
8484 if vpc_config is None :
8585 return vpc_config
86- elif type (vpc_config ) is not dict :
86+ elif not isinstance (vpc_config , dict ) :
8787 raise ValueError ("vpc_config is not a dict: {}" .format (vpc_config ))
8888 elif not vpc_config :
8989 raise ValueError ("vpc_config is empty" )
9090
9191 subnets = vpc_config .get (SUBNETS_KEY )
9292 if subnets is None :
9393 raise ValueError ("vpc_config is missing key: {}" .format (SUBNETS_KEY ))
94- if type (subnets ) is not list :
94+ if not isinstance (subnets , list ) :
9595 raise ValueError ("vpc_config value for {} is not a list: {}" .format (SUBNETS_KEY , subnets ))
9696 elif not subnets :
9797 raise ValueError ("vpc_config value for {} is empty" .format (SUBNETS_KEY ))
9898
9999 security_group_ids = vpc_config .get (SECURITY_GROUP_IDS_KEY )
100100 if security_group_ids is None :
101101 raise ValueError ("vpc_config is missing key: {}" .format (SECURITY_GROUP_IDS_KEY ))
102- if type (security_group_ids ) is not list :
102+ if not isinstance (security_group_ids , list ) :
103103 raise ValueError (
104104 "vpc_config value for {} is not a list: {}" .format (
105105 SECURITY_GROUP_IDS_KEY , security_group_ids
You can’t perform that action at this time.
0 commit comments