Commit ad5f77d4 authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

[server/querier] remove useless indirection QuerierHelper._annotate

parent 23081860ea60
......@@ -480,10 +480,8 @@ class QuerierHelper(object):
def set_schema(self, schema):
self.schema = schema
self.clear_caches()
rqlhelper = self._repo.vreg.rqlhelper
self._annotate = rqlhelper.annotate
# rql planner
self._planner = SSPlanner(schema, rqlhelper)
self._planner = SSPlanner(schema, self._repo.vreg.rqlhelper)
# sql generation annotator
self.sqlgen_annotate = SQLGenAnnotator(schema).annotate
......@@ -549,7 +547,7 @@ class QuerierHelper(object):
# Rewrite computed relations
rewriter = RQLRelationRewriter(cnx)
rewriter.rewrite(rqlst, args)
self._annotate(rqlst)
self._repo.vreg.rqlhelper.annotate(rqlst)
if args:
# different SQL generated when some argument is None or not (IS
# NULL). This should be considered when computing sql cache key
......
......@@ -523,9 +523,8 @@ class SecurityTC(BaseSecurityTC):
with self.new_access(u'iaminusersgrouponly').repo_cnx() as cnx:
rqlst = self.repo.vreg.rqlhelper.parse('Any X WHERE X is_instance_of Societe')
self.repo.vreg.solutions(cnx, rqlst, {})
querier = cnx.repo.querier
querier._annotate(rqlst)
plan = querier.plan_factory(rqlst, {}, cnx)
self.repo.vreg.rqlhelper.annotate(rqlst)
plan = cnx.repo.querier.plan_factory(rqlst, {}, cnx)
plan.preprocess(rqlst)
self.assertEqual(
rqlst.as_string(),
......
......@@ -602,12 +602,11 @@ class RewriteFullTC(CubicWebTC):
def process(self, rql, args=None):
if args is None:
args = {}
querier = self.repo.querier
union = parse(rql) # self.vreg.parse(rql, annotate=True)
with self.admin_access.repo_cnx() as cnx:
self.vreg.solutions(cnx, union, args)
querier._annotate(union)
plan = querier.plan_factory(union, args, cnx)
self.vreg.rqlhelper.annotate(union)
plan = self.repo.querier.plan_factory(union, args, cnx)
plan.preprocess(union)
return union
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment