@@ -22,7 +22,7 @@ def check_number_param(val):
2222
2323def check_boolean_param (val ):
2424 data = util .get_data (val )
25- if data == True or data == False :
25+ if data is True or data is False :
2626 return data
2727 raise Exception ("Expected boolean, got: " + json .dumps (data ))
2828
@@ -48,15 +48,15 @@ def doInvoke(ctx, fn_name, data, raw_params):
4848 if isinstance (fn_name , list ) and len (fn_name ) == 1 :
4949 fn_name = fn_name [0 ]
5050
51- if type (fn_name ) != str or not fn_name in invocation_registry :
51+ if not isinstance (fn_name , str ) or fn_name not in invocation_registry :
5252 raise Exception ("Not implemented: " + str (fn_name ))
5353
5454 invocation = invocation_registry [fn_name ]
5555
5656 if "nullable_input" in invocation and util .is_nullable (data ):
5757 return []
5858
59- if not "arity" in invocation :
59+ if "arity" not in invocation :
6060 if raw_params is None or util .is_empty (raw_params ):
6161 res = invocation ["fn" ](ctx , util .arraify (data ))
6262 return util .arraify (res )
@@ -70,7 +70,7 @@ def doInvoke(ctx, fn_name, data, raw_params):
7070 if isinstance (raw_params , list ):
7171 paramsNumber = len (raw_params )
7272
73- if not paramsNumber in invocation ["arity" ]:
73+ if paramsNumber not in invocation ["arity" ]:
7474 raise Exception (fn_name + " wrong arity: got " + str (paramsNumber ))
7575
7676 params = []
@@ -152,7 +152,10 @@ def func(data):
152152
153153 if len (res ) > 1 :
154154 raise Exception (
155- "Unexpected collection" + json .dumps (res ) + "; expected singleton of type " + node_type
155+ "Unexpected collection"
156+ + json .dumps (res )
157+ + "; expected singleton of type "
158+ + node_type
156159 )
157160
158161 if len (res ) == 0 :
0 commit comments