Copilot commented on code in PR #2372:
URL: https://github.com/apache/age/pull/2372#discussion_r3066077751


##########
drivers/python/pyproject.toml:
##########
@@ -37,7 +37,9 @@ classifiers = [
 ]
 dependencies = [
     "psycopg",
-    "antlr4-python3-runtime==4.11.1",
+    # ANTLR4 runtime is format-compatible within major versions;
+    # tested on 4.11.1–4.13.2 with Python 3.9–3.14.
+    "antlr4-python3-runtime>=4.11.1,<5.0",

Review Comment:
   The added comment says the runtime was tested with Python 3.9–3.14, but the 
`classifiers` list does not include Python 3.9 (while `requires-python` is 
`>=3.9`). Consider either adding the `Programming Language :: Python :: 3.9` 
classifier or adjusting the comment to match the supported/tested versions to 
avoid confusing package metadata.



##########
drivers/python/test_agtypes.py:
##########
@@ -127,6 +127,168 @@ def test_path(self):
         self.assertEqual(vertexEnd.label,  "Person")
         self.assertEqual(vertexEnd["name"],  "Joe")
 
+    def test_vertex_large_array_properties(self):
+        """Issue #2367: Parser should handle vertices with large array 
properties."""
+        vertexExp = (
+            '{"id": 1125899906842625, "label": "TestNode", '
+            '"properties": {"name": "test", '
+            '"tags": ["tag1", "tag2", "tag3", "tag4", "tag5", "tag6", "tag7", '
+            '"tag8", "tag9", "tag10", "tag11", "tag12"]}}::vertex'
+        )
+        vertex = self.parse(vertexExp)
+        self.assertEqual(vertex.id, 1125899906842625)
+        self.assertEqual(vertex.label, "TestNode")
+        self.assertEqual(vertex["name"], "test")
+        self.assertEqual(len(vertex["tags"]), 12)
+        self.assertEqual(vertex["tags"][0], "tag1")
+        self.assertEqual(vertex["tags"][11], "tag12")
+
+    def test_vertex_special_characters_in_properties(self):
+        """Issue #2367: Parser should handle properties with special 
characters."""
+        vertexExp = (
+            '{"id": 1125899906842626, "label": "TestNode", '
+            '"properties": {"name": "test", '
+            '"description": "A long description with unicode chars"}}::vertex'
+        )
+        vertex = self.parse(vertexExp)
+        self.assertEqual(vertex.id, 1125899906842626)
+        self.assertEqual(vertex["name"], "test")
+        self.assertIn("unicode", vertex["description"])

Review Comment:
   `test_vertex_special_characters_in_properties` claims to cover “special 
characters”, but the test string only contains plain ASCII text (no escaped 
quotes/backslashes/newlines and no non-ASCII unicode). This makes the test less 
representative of the reported failure mode in #2367. Consider updating the 
`description` value to include actual special/escaped characters (and at least 
one non-ASCII code point) so the test meaningfully exercises the parser edge 
case.
   ```suggestion
           expected_description = 'Quoted "text", path C:\\tmp\\file, 
line1\nline2, café 雪'
           vertexExp = (
               '{"id": 1125899906842626, "label": "TestNode", '
               '"properties": {"name": "test", '
               '"description": "Quoted \\"text\\", path C:\\\\tmp\\\\file, 
line1\\nline2, café 雪"}}::vertex'
           )
           vertex = self.parse(vertexExp)
           self.assertEqual(vertex.id, 1125899906842626)
           self.assertEqual(vertex["name"], "test")
           self.assertEqual(vertex["description"], expected_description)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to