jararaca 0.2.32__py3-none-any.whl → 0.2.34__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of jararaca might be problematic. Click here for more details.
- jararaca/persistence/sort_filter.py +26 -17
- {jararaca-0.2.32.dist-info → jararaca-0.2.34.dist-info}/METADATA +1 -1
- {jararaca-0.2.32.dist-info → jararaca-0.2.34.dist-info}/RECORD +7 -7
- pyproject.toml +1 -1
- {jararaca-0.2.32.dist-info → jararaca-0.2.34.dist-info}/LICENSE +0 -0
- {jararaca-0.2.32.dist-info → jararaca-0.2.34.dist-info}/WHEEL +0 -0
- {jararaca-0.2.32.dist-info → jararaca-0.2.34.dist-info}/entry_points.txt +0 -0
|
@@ -69,6 +69,8 @@ class FilterRuleApplier:
|
|
|
69
69
|
if field is None:
|
|
70
70
|
raise ValueError(f"Unsupported field: {filter.field}")
|
|
71
71
|
field_type = field.property.columns[0].type.python_type
|
|
72
|
+
if not filter.value: # Is empty string or empty list
|
|
73
|
+
return query
|
|
72
74
|
|
|
73
75
|
if field_type is str:
|
|
74
76
|
match filter.operator:
|
|
@@ -138,14 +140,29 @@ class FilterRuleApplier:
|
|
|
138
140
|
case _:
|
|
139
141
|
raise ValueError(f"Unsupported bool operator: {filter.operator}")
|
|
140
142
|
elif field_type is int:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
|
|
144
|
+
if isinstance(filter.value, list):
|
|
145
|
+
match filter.operator:
|
|
146
|
+
case "isAnyOf":
|
|
147
|
+
if not len(filter.value):
|
|
148
|
+
return query
|
|
149
|
+
|
|
150
|
+
number_values = [
|
|
151
|
+
int(v) for v in filter.value if re.match(r"^-?\d+$", v)
|
|
152
|
+
]
|
|
153
|
+
return query.filter(field.in_(number_values))
|
|
154
|
+
case _:
|
|
155
|
+
raise ValueError(
|
|
156
|
+
f"Unsupported int operator: {filter.operator} for list"
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
if not re.match(r"^-?\d+$", filter.value):
|
|
145
160
|
raise ValueError(
|
|
146
|
-
f"
|
|
161
|
+
f"Invalid integer value: {filter.value} for field {field}"
|
|
147
162
|
)
|
|
148
|
-
|
|
163
|
+
|
|
164
|
+
number_value = int(filter.value)
|
|
165
|
+
|
|
149
166
|
match filter.operator:
|
|
150
167
|
case "=":
|
|
151
168
|
return query.filter(field == number_value)
|
|
@@ -163,18 +180,10 @@ class FilterRuleApplier:
|
|
|
163
180
|
return query.filter(field == None) # noqa
|
|
164
181
|
case "isNotEmpty":
|
|
165
182
|
return query.filter(field != None) # noqa
|
|
166
|
-
case "isAnyOf":
|
|
167
|
-
if not isinstance(filter.value, list):
|
|
168
|
-
raise ValueError(
|
|
169
|
-
f"Unsupported value type for isAnyOf operator: {type(filter.value)}"
|
|
170
|
-
)
|
|
171
|
-
|
|
172
|
-
number_values = [
|
|
173
|
-
int(v) for v in filter.value if re.match(r"^-?\d+$", v)
|
|
174
|
-
]
|
|
175
|
-
return query.filter(field.in_(number_values))
|
|
176
183
|
case _:
|
|
177
|
-
raise ValueError(
|
|
184
|
+
raise ValueError(
|
|
185
|
+
f"Unsupported int operator: {filter.operator} for single value"
|
|
186
|
+
)
|
|
178
187
|
|
|
179
188
|
raise ValueError(f"Unsupported field type: {field_type}")
|
|
180
189
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
2
2
|
README.md,sha256=mte30I-ZEJJp-Oax-OganNgl6G9GaCZPL6JVFAvZGz4,7034
|
|
3
|
-
pyproject.toml,sha256=
|
|
3
|
+
pyproject.toml,sha256=O8OpHnqXbYMG-InzkdIrT2ZVKOksD0_gi_3FS7f4n-k,1837
|
|
4
4
|
jararaca/__init__.py,sha256=h1lYQMmB8TATPG0GXjIzLZWHbWFhvkAFu-yBjm2W18g,13875
|
|
5
5
|
jararaca/__main__.py,sha256=-O3vsB5lHdqNFjUtoELDF81IYFtR-DSiiFMzRaiSsv4,67
|
|
6
6
|
jararaca/cli.py,sha256=fh7lp7rf5xbV5VaoSYWWehktel6BPcOXMjW7cw4wKms,5693
|
|
@@ -28,7 +28,7 @@ jararaca/persistence/exports.py,sha256=Ghx4yoFaB4QVTb9WxrFYgmcSATXMNvrOvT8ybPNKX
|
|
|
28
28
|
jararaca/persistence/interceptors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
29
|
jararaca/persistence/interceptors/aiosqa_interceptor.py,sha256=H6ZjOdosYGCZUzKjugiXQwJkAbnsL4HnkZLOEQhULEc,1986
|
|
30
30
|
jararaca/persistence/session.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
|
-
jararaca/persistence/sort_filter.py,sha256=
|
|
31
|
+
jararaca/persistence/sort_filter.py,sha256=agggpN0YvNjUr6wJjy69NkaqxoDDW13ys9B3r85OujA,9226
|
|
32
32
|
jararaca/persistence/utilities.py,sha256=v9ckhzti3GKWQrng2I03EO-dxGRGp-sLoVnVNf_UFU4,12478
|
|
33
33
|
jararaca/presentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
34
|
jararaca/presentation/decorators.py,sha256=eL2YCgMSr19m4YCri5PQU46NRxf0QxsqDnz6MqKu0YQ,8389
|
|
@@ -58,8 +58,8 @@ jararaca/tools/app_config/decorators.py,sha256=-ckkMZ1dswOmECdo1rFrZ15UAku--txaN
|
|
|
58
58
|
jararaca/tools/app_config/interceptor.py,sha256=nfFZiS80hrbnL7-XEYrwmp2rwaVYBqxvqu3Y-6o_ov4,2575
|
|
59
59
|
jararaca/tools/metadata.py,sha256=7nlCDYgItNybentPSSCc2MLqN7IpBd0VyQzfjfQycVI,1402
|
|
60
60
|
jararaca/tools/typescript/interface_parser.py,sha256=_dPBRKs_67eiQ8cPWp8q1uGbIPxZ30dypfoqhbBAL_Y,28790
|
|
61
|
-
jararaca-0.2.
|
|
62
|
-
jararaca-0.2.
|
|
63
|
-
jararaca-0.2.
|
|
64
|
-
jararaca-0.2.
|
|
65
|
-
jararaca-0.2.
|
|
61
|
+
jararaca-0.2.34.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
62
|
+
jararaca-0.2.34.dist-info/METADATA,sha256=JjpbgUBOIgNOHWb4nlxfEwulqXDSpewChL8EekIoxys,8552
|
|
63
|
+
jararaca-0.2.34.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
64
|
+
jararaca-0.2.34.dist-info/entry_points.txt,sha256=WIh3aIvz8LwUJZIDfs4EeH3VoFyCGEk7cWJurW38q0I,45
|
|
65
|
+
jararaca-0.2.34.dist-info/RECORD,,
|
pyproject.toml
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|