Skip to content

Commit 3c92c2f

Browse files
committed
feat: The comparator is greater than or less than the supported string comparison
1 parent 6805d76 commit 3c92c2f

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

apps/application/flow/compare/ge_compare.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,8 @@ def compare(self, source_value, compare, target_value):
2121
try:
2222
return float(source_value) >= float(target_value)
2323
except Exception as e:
24+
try:
25+
return str(source_value) >= str(target_value)
26+
except Exception as _:
27+
pass
2428
return False

apps/application/flow/compare/gt_compare.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,8 @@ def compare(self, source_value, compare, target_value):
2121
try:
2222
return float(source_value) > float(target_value)
2323
except Exception as e:
24+
try:
25+
return str(source_value) > str(target_value)
26+
except Exception as _:
27+
pass
2428
return False

apps/application/flow/compare/le_compare.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,8 @@ def compare(self, source_value, compare, target_value):
2121
try:
2222
return float(source_value) <= float(target_value)
2323
except Exception as e:
24+
try:
25+
return str(source_value) <= str(target_value)
26+
except Exception as _:
27+
pass
2428
return False

apps/application/flow/compare/lt_compare.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,8 @@ def compare(self, source_value, compare, target_value):
2121
try:
2222
return float(source_value) < float(target_value)
2323
except Exception as e:
24+
try:
25+
return str(source_value) < str(target_value)
26+
except Exception as _:
27+
pass
2428
return False

0 commit comments

Comments
 (0)