Skip to content

Commit

Permalink
Clean up dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
robinedwards committed Mar 17, 2017
1 parent 1d7a383 commit b7ec887
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions neomodel/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,25 +307,23 @@ def build_additional_match(self, ident, node_set):
"""
handle additional matches supplied by 'has()' calls
"""
# TODO add support for labels
source_ident = ident

for key, value in node_set.must_match.items():
label = ':' + value['node_class'].__label__
if isinstance(value, dict):
label = ':' + value['node_class'].__label__
stmt = _rel_helper(lhs=source_ident, rhs=label, ident='', **value)
self._ast['where'].append(stmt)
elif isinstance(value, tuple):
rel_manager, ns = value
self.add_node_set(ns, key)
else:
raise ValueError("Expecting dict got: " + repr(value))

for key, val in node_set.dont_match.items():
label = ':' + val['node_class'].__label__
if isinstance(val, dict):
label = ':' + val['node_class'].__label__
stmt = _rel_helper(lhs=source_ident, rhs=label, ident='', **val)
self._ast['where'].append('NOT ' + stmt)
else:
raise ValueError("WTF? " + repr(val))
raise ValueError("Expecting dict got: " + repr(val))

def _register_place_holder(self, key):
if key in self._place_holder_registry:
Expand Down

0 comments on commit b7ec887

Please sign in to comment.