From e4fbde3cea8a5febda828b12927a3759d430606d Mon Sep 17 00:00:00 2001 From: LV-426 Date: Mon, 6 Oct 2014 18:49:14 +0300 Subject: handle empty filter maps --- src-py/neo4j_util.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src-py/neo4j_util.py') diff --git a/src-py/neo4j_util.py b/src-py/neo4j_util.py index 929324fb..c340e15a 100644 --- a/src-py/neo4j_util.py +++ b/src-py/neo4j_util.py @@ -54,7 +54,12 @@ def where_clause_from_filter_attr_map(filter_attr_map, node_param_name="n"): convert a filter attribute map to a parameterized Cypher where clause, eg. in: { 'att_foo': [ 'a', 'b' ], 'att_goo': [1,2] } out: where n.att_foo in {att_foo} and n.att_goo in {att_goo} ... + + @param filter_attr_map: may be None or empty """ + if not filter_attr_map: + return "" + filter_arr = [] for k in filter_attr_map.keys(): # create a cypher query parameter place holder for each attr set -- cgit v1.3.1