feat: The comparator is greater than or less than the supported string comparison (#4081)
parent
ccf6d86dea
commit
3fad820e99
|
|
@ -21,4 +21,8 @@ class GECompare(Compare):
|
||||||
try:
|
try:
|
||||||
return float(source_value) >= float(target_value)
|
return float(source_value) >= float(target_value)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
try:
|
||||||
|
return str(source_value) >= str(target_value)
|
||||||
|
except Exception as _:
|
||||||
|
pass
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
|
|
@ -21,4 +21,8 @@ class GTCompare(Compare):
|
||||||
try:
|
try:
|
||||||
return float(source_value) > float(target_value)
|
return float(source_value) > float(target_value)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
try:
|
||||||
|
return str(source_value) > str(target_value)
|
||||||
|
except Exception as _:
|
||||||
|
pass
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
|
|
@ -21,4 +21,8 @@ class LECompare(Compare):
|
||||||
try:
|
try:
|
||||||
return float(source_value) <= float(target_value)
|
return float(source_value) <= float(target_value)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
try:
|
||||||
|
return str(source_value) <= str(target_value)
|
||||||
|
except Exception as _:
|
||||||
|
pass
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
|
|
@ -21,4 +21,8 @@ class LTCompare(Compare):
|
||||||
try:
|
try:
|
||||||
return float(source_value) < float(target_value)
|
return float(source_value) < float(target_value)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
try:
|
||||||
|
return str(source_value) < str(target_value)
|
||||||
|
except Exception as _:
|
||||||
|
pass
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue