You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2018/02/09 19:31:22 UTC

[08/28] tinkerpop git commit: TINKERPOP-1857 Added support for empty lists and sets in python GLV test runner

TINKERPOP-1857 Added support for empty lists and sets in python GLV test runner


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/ac7ef327
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ac7ef327
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ac7ef327

Branch: refs/heads/TINKERPOP-1857
Commit: ac7ef32712ce85f415779a9c755d6607f4373330
Parents: 3298bca
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Dec 28 16:42:30 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Feb 9 14:30:58 2018 -0500

----------------------------------------------------------------------
 gremlin-python/src/main/jython/radish/feature_steps.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ac7ef327/gremlin-python/src/main/jython/radish/feature_steps.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/radish/feature_steps.py b/gremlin-python/src/main/jython/radish/feature_steps.py
index b61d5e0..c0574d0 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -154,9 +154,9 @@ def _convert(val, ctx):
     elif isinstance(val, unicode):                                      # convert annoying python 2.x unicode nonsense
         return _convert(val.encode('utf-8'), ctx)
     elif isinstance(val, str) and re.match("^l\[.*\]$", val):           # parse list
-        return list(map((lambda x: _convert(x, ctx)), val[2:-1].split(",")))
+        return [] if val == "l[]" else list(map((lambda x: _convert(x, ctx)), val[2:-1].split(",")))
     elif isinstance(val, str) and re.match("^s\[.*\]$", val):           # parse set
-        return set(map((lambda x: _convert(x, ctx)), val[2:-1].split(",")))
+        return set() if val == "s[]" else set(map((lambda x: _convert(x, ctx)), val[2:-1].split(",")))
     elif isinstance(val, str) and re.match("^d\[.*\]\.[ilfdm]$", val):  # parse numeric
         return float(val[2:-3]) if val[2:-3].__contains__(".") else long(val[2:-3])
     elif isinstance(val, str) and re.match("^v\[.*\]\.id$", val):       # parse vertex id