nebius/SWE-bench-extra huggingface dataset:
Repository: 15five/scim2-filter-parser

Issue:
Return NamedTuple rather than tuple.
It would be nice to return a NamedTuple instead of a tuple here: 

https://github.com/15five/scim2-filter-parser/blob/7ddc216f8c3dd1cdb2152944187e8f7f5ee07be2/src/scim2_filter_parser/transpilers/sql.py#L148

This way parts of each path could be accessed by name rather than by index in the tuple.

Comments:

Patch:
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 12a5d4f..178f172 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,10 @@
 CHANGE LOG
 ==========
 
+0.3.5
+-----
+- Update the sql.Transpiler to collect namedtuples rather than tuples for attr paths
+
 0.3.4
 -----
 - Update tox.ini and clean up linting errors
diff --git a/setup.py b/setup.py
index bbf57bf..bd16f70 100644
--- a/setup.py
+++ b/setup.py
@@ -14,7 +14,7 @@ def long_description():
 
 setup(
     name='scim2-filter-parser',
-    version='0.3.4',
+    version='0.3.5',
     description='A customizable parser/transpiler for SCIM2.0 filters',
     url='https://github.com/15five/scim2-filter-parser',
     maintainer='Paul Logston',
diff --git a/src/scim2_filter_parser/transpilers/sql.py b/src/scim2_filter_parser/transpilers/sql.py
index 6254f1e..2107758 100644
--- a/src/scim2_filter_parser/transpilers/sql.py
+++ b/src/scim2_filter_parser/transpilers/sql.py
@@ -4,9 +4,12 @@ clause based on a SCIM filter.
 """
 import ast
 import string
+import collections
 
 from .. import ast as scim2ast
 
+AttrPath = collections.namedtuple('AttrPath', ['attr_name', 'sub_attr', 'uri'])
+
 
 class Transpiler(ast.NodeTransformer):
     """
@@ -145,7 +148,7 @@ class Transpiler(ast.NodeTransformer):
 
         # Convert attr_name to another value based on map.
         # Otherwise, return None.
-        attr_path_tuple = (attr_name_value, sub_attr_value, uri_value)
+        attr_path_tuple = AttrPath(attr_name_value, sub_attr_value, uri_value)
         self.attr_paths.append(attr_path_tuple)
         return self.attr_map.get(attr_path_tuple)
 


Test patch:
diff --git a/tests/test_transpiler.py b/tests/test_transpiler.py
index b8e1bb4..280c2d3 100644
--- a/tests/test_transpiler.py
+++ b/tests/test_transpiler.py
@@ -36,6 +36,16 @@ class RFCExamples(TestCase):
         self.assertEqual(expected_sql, sql, query)
         self.assertEqual(expected_params, params, query)
 
+    def test_attr_paths_are_created(self):
+        query = 'userName eq "bjensen"'
+        tokens = self.lexer.tokenize(query)
+        ast = self.parser.parse(tokens)
+        self.transpiler.transpile(ast)
+
+        self.assertEqual(len(self.transpiler.attr_paths), 1)
+        for path in self.transpiler.attr_paths:
+            self.assertTrue(isinstance(path, transpile_sql.AttrPath))
+
     def test_username_eq(self):
         query = 'userName eq "bjensen"'
         sql = "username = {a}"
Repository: 15five/scim2-filter-parser

Issue:
Issue when using multiple "or" or "and"
Hi,

I am facing an issue, where the query having two or more "and" or more than two "or" is failing.
Have a look at examples below: - 

1)```"displayName co \"username\" or nickName co \"username\" or userName co \"username\""```
   ```"displayName co \"username\" and nickName co \"username\" and userName co \"username\""```

the two queries fails giving ,
```scim2_filter_parser.parser.SCIMParserError: Parsing error at: Token(type='OR', value='or', lineno=1, index=52)```
 
notice above queries are having either only "or" or "and".

2)```"displayName co \"username\" and nickName co \"username\" or userName co \"username\""```
but this query works.


Comments:

Patch:
diff --git a/src/scim2_filter_parser/parser.py b/src/scim2_filter_parser/parser.py
index 516f65d..12c693e 100644
--- a/src/scim2_filter_parser/parser.py
+++ b/src/scim2_filter_parser/parser.py
@@ -110,9 +110,8 @@ class SCIMParser(Parser):
     #       which takes precedence over "or"
     #   3.  Attribute operators
     precedence = (
-        ('nonassoc', OR),  # noqa F821
-        ('nonassoc', AND), # noqa F821
-        ('nonassoc', NOT), # noqa F821
+        ('left', OR, AND),  # noqa F821
+        ('right', NOT), # noqa F821
     )
 
     # FILTER    = attrExp / logExp / valuePath / *1"not" "(" FILTER ")"


Test patch:
diff --git a/tests/test_parser.py b/tests/test_parser.py
index 4ff562c..19aa198 100644
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -47,6 +47,24 @@ class BuggyQueries(TestCase):
         with self.assertRaises(parser.SCIMParserError):
             self.parser.parse(token_stream)
 
+    def test_g17_1_log_exp_order(self):
+        query = 'displayName co "username"  or nickName co "username"  or userName co "username"'
+
+        tokens = self.lexer.tokenize(query)
+        self.parser.parse(tokens)  # Should not raise error
+
+    def test_g17_2_log_exp_order(self):
+        query = 'displayName co "username" and nickName co "username" and userName co "username"'
+
+        tokens = self.lexer.tokenize(query)
+        self.parser.parse(tokens)  # Should not raise error
+
+    def test_g17_3_log_exp_order(self):
+        query = 'displayName co "username" and nickName co "username"  or userName co "username"'
+
+        tokens = self.lexer.tokenize(query)
+        self.parser.parse(tokens)  # Should not raise error
+
 
 class CommandLine(TestCase):
     def setUp(self):