Skip to content

Commit bfc5b36

Browse files
committed
Made less than / more than better
1 parent 717d7ae commit bfc5b36

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ liquidpy==0.8.2
55
flask[async]==3.1.0
66
waitress==3.0.2
77
python-dateutil==2.9.0.post0
8-
shufflepy==0.0.91
8+
shufflepy==0.1.0
99

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='shuffle_sdk',
5-
version='0.0.24',
5+
version='0.0.25',
66
description='The SDK used for Shuffle',
77
py_modules=["shuffle_sdk"],
88
license='MIT',
@@ -21,7 +21,7 @@
2121
"waitress==3.0.2",
2222
"python-dateutil==2.9.0.post0",
2323
"PyJWT==2.10.1",
24-
"shufflepy==0.0.91",
24+
"shufflepy==0.1.0",
2525
],
2626
classifiers=[
2727
'Programming Language :: Python :: 3',

shuffle_sdk/shuffle_sdk.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,6 +1877,20 @@ def validate_condition(self, sourcevalue, check, destinationvalue):
18771877
except Exception as e:
18781878
self.logger.info(f"[WARNING] Failed to check if larger than as list: {e}")
18791879

1880+
try:
1881+
if not sourcevalue.isdigit() and destinationvalue.isdigit():
1882+
if len(str(sourcevalue)) > int(destinationvalue):
1883+
return True
1884+
except Exception as e:
1885+
self.logger.info(f"[WARNING] Failed to check if larger than as string: {e}")
1886+
1887+
try:
1888+
if not destinationvalue.isdigit() and sourcevalue.isdigit():
1889+
if int(sourcevalue) > len(str(destinationvalue)):
1890+
return True
1891+
except Exception as e:
1892+
self.logger.info(f"[WARNING] Failed to check if larger than as string: {e}")
1893+
18801894

18811895
# FIXME: This will be buggy if using < and <= operators in the future.
18821896
elif check.lower() == "smaller than" or check.lower() == "less than" or check == "<" or check == "<=":
@@ -1902,6 +1916,22 @@ def validate_condition(self, sourcevalue, check, destinationvalue):
19021916
except Exception as e:
19031917
self.logger.info(f"[WARNING] Failed to check if smaller than as list: {e}")
19041918

1919+
try:
1920+
if not sourcevalue.isdigit() and destinationvalue.isdigit():
1921+
if len(str(sourcevalue)) < int(destinationvalue):
1922+
return True
1923+
1924+
except Exception as e:
1925+
self.logger.info(f"[WARNING] Failed to check if smaller than as string: {e}")
1926+
1927+
try:
1928+
if sourcevalue.isdigit() and not destinationvalue.isdigit():
1929+
if int(sourcevalue) < len(str(destinationvalue)):
1930+
return True
1931+
1932+
except Exception as e:
1933+
self.logger.info(f"[WARNING] Failed to check if smaller than as string: {e}")
1934+
19051935
elif check.lower() == "re" or check.lower() == "matches regex":
19061936
try:
19071937
found = re.search(str(destinationvalue), str(sourcevalue))

0 commit comments

Comments
 (0)