feat: The comparator is greater than or less than the supported string comparison (#4081)

This commit is contained in:
shaohuzhang1 2025-09-22 18:18:37 +08:00 committed by GitHub
parent ccf6d86dea
commit 3fad820e99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 16 additions and 0 deletions

View File

@ -21,4 +21,8 @@ class GECompare(Compare):
try:
return float(source_value) >= float(target_value)
except Exception as e:
try:
return str(source_value) >= str(target_value)
except Exception as _:
pass
return False

View File

@ -21,4 +21,8 @@ class GTCompare(Compare):
try:
return float(source_value) > float(target_value)
except Exception as e:
try:
return str(source_value) > str(target_value)
except Exception as _:
pass
return False

View File

@ -21,4 +21,8 @@ class LECompare(Compare):
try:
return float(source_value) <= float(target_value)
except Exception as e:
try:
return str(source_value) <= str(target_value)
except Exception as _:
pass
return False

View File

@ -21,4 +21,8 @@ class LTCompare(Compare):
try:
return float(source_value) < float(target_value)
except Exception as e:
try:
return str(source_value) < str(target_value)
except Exception as _:
pass
return False