Skip to content

Commit

Permalink
add excpetion_handler option to Graphcore.query
Browse files Browse the repository at this point in the history
  • Loading branch information
dwiel committed Apr 15, 2016
1 parent fd22758 commit 1efd094
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions graphcore/graphcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from . import call_graph
from .query_planner import QueryPlanner
from .equality_mixin import HashMixin, EqualityMixin
from .result_set import default_exception_handler


class QuerySearchIterator(object):
Expand Down Expand Up @@ -399,7 +400,8 @@ def optimize(self, query_search):
from .optimize_constrain_sql_queries import constrain_sql_queries
constrain_sql_queries(query_search.call_graph)

def query(self, query, limit=None):
def query(self, query, limit=None,
exception_handler=default_exception_handler):
query_search = QuerySearch(self, query)

query_search.backward()
Expand All @@ -412,7 +414,9 @@ def query(self, query, limit=None):
)
query_plan = query_planner.plan_query()

return query_plan.execute(limit=limit)
return query_plan.execute(
limit=limit, exception_handler=exception_handler
)

def explain(self, query):
query_search = QuerySearch(self, query)
Expand Down

0 comments on commit 1efd094

Please sign in to comment.