From 3fad820e992a38601597e0435e08f41f19677967 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Mon, 22 Sep 2025 18:18:37 +0800 Subject: [PATCH] feat: The comparator is greater than or less than the supported string comparison (#4081) --- apps/application/flow/compare/ge_compare.py | 4 ++++ apps/application/flow/compare/gt_compare.py | 4 ++++ apps/application/flow/compare/le_compare.py | 4 ++++ apps/application/flow/compare/lt_compare.py | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/apps/application/flow/compare/ge_compare.py b/apps/application/flow/compare/ge_compare.py index d40c348ae..84a223bee 100644 --- a/apps/application/flow/compare/ge_compare.py +++ b/apps/application/flow/compare/ge_compare.py @@ -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 diff --git a/apps/application/flow/compare/gt_compare.py b/apps/application/flow/compare/gt_compare.py index 2f9cf60e2..2307aaae4 100644 --- a/apps/application/flow/compare/gt_compare.py +++ b/apps/application/flow/compare/gt_compare.py @@ -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 diff --git a/apps/application/flow/compare/le_compare.py b/apps/application/flow/compare/le_compare.py index 66f419430..0b1710a25 100644 --- a/apps/application/flow/compare/le_compare.py +++ b/apps/application/flow/compare/le_compare.py @@ -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 diff --git a/apps/application/flow/compare/lt_compare.py b/apps/application/flow/compare/lt_compare.py index 803884251..c5ff3d6f6 100644 --- a/apps/application/flow/compare/lt_compare.py +++ b/apps/application/flow/compare/lt_compare.py @@ -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