diff options
| author | LV-426 <lv-426@taproot.org.il> | 2014-10-06 18:49:14 +0300 |
|---|---|---|
| committer | LV-426 <lv-426@taproot.org.il> | 2014-10-06 18:50:14 +0300 |
| commit | e4fbde3cea8a5febda828b12927a3759d430606d (patch) | |
| tree | ef08079b73cebd000463534ae03c4164414c0cde /src-py/neo4j_util.py | |
| parent | eef0c89ed89293ca89ba8b5f42b7100c46682fd7 (diff) | |
handle empty filter maps
Diffstat (limited to 'src-py/neo4j_util.py')
| -rw-r--r-- | src-py/neo4j_util.py | 5 |
1 files changed, 5 insertions, 0 deletions
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 |
