@@ -114,23 +114,17 @@ def _adql_sanitize_op_val(op_val):
114114 returns "<operator> <value>" if operator is provided.
115115 Defaults to "= <value>" otherwise.
116116 """
117- supported_operators = {"=" , ">" , "<" , "<=" , ">=" , "!=" , "like" , "between" , "in" }
117+ supported_operators = {"=" , ">" , "<" , "<=" , ">=" , "!=" , "like" , "between" , "in" ,
118+ "not like" , "not in" }
118119
119120 if not isinstance (op_val , str ):
120121 return f"= { op_val } "
121122
122123 op_val = op_val .strip ()
123- parts = op_val .split (" " , 1 )
124-
125- if len (parts ) == 1 :
126- for s in supported_operators :
127- if op_val .startswith (s ):
128- operator , value = s , op_val .split (s , 1 )[- 1 ]
129- return f"{ operator } { value } "
130-
131- if len (parts ) == 2 and parts [0 ].lower () in supported_operators :
132- operator , value = parts
133- return f"{ operator } { value } "
124+ for s in supported_operators :
125+ if op_val .lower ().startswith (s ):
126+ operator , value = s , op_val [len (s ):].strip ()
127+ return f"{ operator } { value } "
134128
135129 # Default case: no operator. Assign "="
136130 value = op_val if (op_val .startswith ("'" ) and op_val .endswith ("'" )) else f"'{ op_val } '"
0 commit comments