ransacklib 1.1.0.dev15__tar.gz → 2.0.0a2__tar.gz
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.
- {ransacklib-1.1.0.dev15/ransacklib.egg-info → ransacklib-2.0.0a2}/PKG-INFO +1 -1
- {ransacklib-1.1.0.dev15 → ransacklib-2.0.0a2}/pyproject.toml +1 -1
- {ransacklib-1.1.0.dev15 → ransacklib-2.0.0a2}/ransack/operator.py +12 -0
- {ransacklib-1.1.0.dev15 → ransacklib-2.0.0a2/ransacklib.egg-info}/PKG-INFO +1 -1
- {ransacklib-1.1.0.dev15 → ransacklib-2.0.0a2}/tests/test_postgres.py +2 -0
- {ransacklib-1.1.0.dev15 → ransacklib-2.0.0a2}/tests/test_transformer.py +1 -12
- {ransacklib-1.1.0.dev15 → ransacklib-2.0.0a2}/LICENSE +0 -0
- {ransacklib-1.1.0.dev15 → ransacklib-2.0.0a2}/README.rst +0 -0
- {ransacklib-1.1.0.dev15 → ransacklib-2.0.0a2}/ransack/__init__.py +0 -0
- {ransacklib-1.1.0.dev15 → ransacklib-2.0.0a2}/ransack/exceptions.py +0 -0
- {ransacklib-1.1.0.dev15 → ransacklib-2.0.0a2}/ransack/function.py +0 -0
- {ransacklib-1.1.0.dev15 → ransacklib-2.0.0a2}/ransack/parser.py +0 -0
- {ransacklib-1.1.0.dev15 → ransacklib-2.0.0a2}/ransack/py.typed +0 -0
- {ransacklib-1.1.0.dev15 → ransacklib-2.0.0a2}/ransack/transformer.py +0 -0
- {ransacklib-1.1.0.dev15 → ransacklib-2.0.0a2}/ransack/types.py +0 -0
- {ransacklib-1.1.0.dev15 → ransacklib-2.0.0a2}/ransacklib.egg-info/SOURCES.txt +0 -0
- {ransacklib-1.1.0.dev15 → ransacklib-2.0.0a2}/ransacklib.egg-info/dependency_links.txt +0 -0
- {ransacklib-1.1.0.dev15 → ransacklib-2.0.0a2}/ransacklib.egg-info/requires.txt +0 -0
- {ransacklib-1.1.0.dev15 → ransacklib-2.0.0a2}/ransacklib.egg-info/top_level.txt +0 -0
- {ransacklib-1.1.0.dev15 → ransacklib-2.0.0a2}/setup.cfg +0 -0
- {ransacklib-1.1.0.dev15 → ransacklib-2.0.0a2}/tests/test_operator.py +0 -0
- {ransacklib-1.1.0.dev15 → ransacklib-2.0.0a2}/tests/test_parser.py +0 -0
|
@@ -807,6 +807,18 @@ def _operator_map_sql(op, l_sql, r_sql, t1, t2) -> tuple[str, typing.Any, bool]:
|
|
|
807
807
|
def find_comp(operator, d, lhs_type, rhs_type):
|
|
808
808
|
for (lhs_expected, rhs_expected), value in d[operator].items():
|
|
809
809
|
if _matches(lhs_type, lhs_expected) and _matches(rhs_type, rhs_expected):
|
|
810
|
+
if (
|
|
811
|
+
(
|
|
812
|
+
isinstance(lhs_expected, (List, Range))
|
|
813
|
+
and isinstance(rhs_expected, (List, Range))
|
|
814
|
+
)
|
|
815
|
+
and lhs_expected.element_type is Any
|
|
816
|
+
and rhs_expected.element_type is Any
|
|
817
|
+
and lhs_type.element_type is not Empty
|
|
818
|
+
and rhs_type.element_type is not Empty
|
|
819
|
+
and lhs_type.element_type != rhs_type.element_type
|
|
820
|
+
):
|
|
821
|
+
continue
|
|
810
822
|
return value
|
|
811
823
|
raise KeyError
|
|
812
824
|
|
|
@@ -1292,6 +1292,8 @@ def test_complex_expressions(
|
|
|
1292
1292
|
'"abc"..123',
|
|
1293
1293
|
"01:00:00..5",
|
|
1294
1294
|
"not_there", # Unknown column.
|
|
1295
|
+
"[1, 2, 3] . ['a', 'b', 'c']", # Operator not found for given types.
|
|
1296
|
+
"['example.com'] in [192.168.0.0/16]",
|
|
1295
1297
|
],
|
|
1296
1298
|
)
|
|
1297
1299
|
def test_invalid_cases(expr):
|
|
@@ -6,13 +6,7 @@ from lark import Token
|
|
|
6
6
|
|
|
7
7
|
from ransack.exceptions import RansackError, ShapeError
|
|
8
8
|
from ransack.parser import Parser
|
|
9
|
-
from ransack.transformer import
|
|
10
|
-
ExpressionTransformer,
|
|
11
|
-
Filter,
|
|
12
|
-
SQLInterpreter,
|
|
13
|
-
TokenWrapper,
|
|
14
|
-
get_values,
|
|
15
|
-
)
|
|
9
|
+
from ransack.transformer import ExpressionTransformer, Filter, TokenWrapper, get_values
|
|
16
10
|
|
|
17
11
|
|
|
18
12
|
@pytest.fixture
|
|
@@ -30,11 +24,6 @@ def expr_transformer():
|
|
|
30
24
|
return ExpressionTransformer()
|
|
31
25
|
|
|
32
26
|
|
|
33
|
-
@pytest.fixture
|
|
34
|
-
def sql():
|
|
35
|
-
return SQLInterpreter()
|
|
36
|
-
|
|
37
|
-
|
|
38
27
|
sample_data = {
|
|
39
28
|
"Category": ["Intrusion.UserCompromise"],
|
|
40
29
|
"ConnCount": 1,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|