44import math
55
66
7- def unescape_value (value ) :
7+ def unescape_value (value : str ) -> str :
88 """Unescape the value for display."""
99 if value .startswith ("'" ) and value .endswith ("'" ):
1010 return value [1 :- 1 ].replace ("''" , "'" ) # Remove single quotes
1111 return value
1212
1313
14- def parse_to_float (val ) :
14+ def parse_to_float (val : str ) -> float :
1515 if isinstance (val , str ):
1616 v = val .replace ("'" , "" ) # Remove single quotes
1717 try :
@@ -21,7 +21,7 @@ def parse_to_float(val):
2121 return val # already a float
2222
2323
24- def sort_key (val ) :
24+ def sort_key (val : str ) -> tuple [ int ] | tuple [ int , float ] :
2525 x = parse_to_float (val )
2626 if math .isnan (x ):
2727 return (3 ,)
@@ -33,7 +33,7 @@ def sort_key(val):
3333 return (1 , x )
3434
3535
36- def custom_sorted (values ) :
36+ def custom_sorted (values : list [ Any ]) -> list [ Any ] :
3737 if "'inf'" in values or "'-inf'" in values or "'nan'" in values :
3838 # Sort using the custom key
3939 return sorted (values , key = sort_key )
@@ -181,7 +181,7 @@ def custom_sorted(values):
181181statement ok
182182CREATE SECRET airport_testing (
183183 type airport,
184- auth_token 'example_token' ,
184+ auth_token uuid() ,
185185 scope 'grpc://localhost:50003/');
186186
187187# Reset the test server
@@ -243,3 +243,11 @@ def custom_sorted(values):
243243 print ("----" , file = f )
244244 print (unescape_value (value ), file = f )
245245 print ("" , file = f )
246+
247+ print (
248+ """# Reset the test server
249+ statement ok
250+ CALL airport_action('grpc://localhost:50003/', 'reset');
251+ """ ,
252+ file = f ,
253+ )
0 commit comments