Skip to content

Commit 694cef3

Browse files
Allow keywords as unquoted strings
2 parents f10408c + 2e5fee5 commit 694cef3

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,9 @@ Even more queries can be found [here](https://colab.research.google.com/github/R
338338

339339
# Latest updates
340340

341+
## Version 2.0.3
342+
- Some unquoted strings (like document, binary, pi, etc) were not properly recognized and could not be used as variable names or for unquoted object lookup. This is now fixed.
343+
341344
## Version 2.0.2
342345
- Add MongoDB connection (mongodb-collection()). Requires including .withMongo() when creating the RumbleSession.
343346

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "jsoniq"
7-
version = "2.0.2"
7+
version = "2.0.3"
88
description = "Python edition of RumbleDB, a JSONiq engine"
99
requires-python = ">=3.11"
1010
dependencies = [

src/jsoniq/jars/rumbledb-2.0.0.jar

-148 KB
Binary file not shown.

tests/test_bugfix_keywords.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from jsoniq import RumbleSession
2+
from unittest import TestCase
3+
import json
4+
class TryTesting(TestCase):
5+
def test1(self):
6+
# The syntax to start a session is similar to that of Spark.
7+
# A RumbleSession is a SparkSession that additionally knows about RumbleDB.
8+
# All attributes and methods of SparkSession are also available on RumbleSession.
9+
rumble = RumbleSession.builder.appName("PyRumbleExample").getOrCreate();
10+
# A more complex, standalone query
11+
12+
seq = rumble.jsoniq("""
13+
let $node := { "binary" : "af12" }
14+
return $node.binary
15+
""");
16+
17+
expected = ('af12',)
18+
19+
self.assertTrue(json.dumps(seq.json()) == json.dumps(expected))

0 commit comments

Comments
 (0)