33
44from dbally .audit .event_tracker import EventTracker
55from dbally .context ._utils import _does_arg_allow_context
6- from dbally .context .context import BaseCallerContext , CustomContext
6+ from dbally .context .context import BaseCallerContext
77from dbally .iql import syntax
88from dbally .iql ._exceptions import (
99 IQLArgumentParsingError ,
@@ -23,21 +23,17 @@ class IQLProcessor:
2323
2424 Attributes:
2525 source: Raw LLM response containing IQL filter calls.
26- allowed_functions: A mapping (typically a dict) of all filters implemented for a certain View.
27- contexts: A sequence (typically a list) of context objects, each being an instance of
28- a subclass of BaseCallerContext. May contain contexts irrelevant for the currently processed query.
26+ allowed_functions: A mapping (typically a dict) of all filters implemented for a certain View.=
2927 """
3028
3129 source : str
3230 allowed_functions : Mapping [str , "ExposedFunction" ]
33- contexts : Iterable [CustomContext ]
3431 _event_tracker : EventTracker
3532
3633 def __init__ (
3734 self ,
3835 source : str ,
3936 allowed_functions : Iterable [ExposedFunction ],
40- contexts : Optional [Iterable [CustomContext ]] = None ,
4137 event_tracker : Optional [EventTracker ] = None ,
4238 ) -> None :
4339 """
@@ -46,14 +42,11 @@ def __init__(
4642 Args:
4743 source: Raw LLM response containing IQL filter calls.
4844 allowed_functions: An interable (typically a list) of all filters implemented for a certain View.
49- contexts: An iterable (typically a list) of context objects, each being an instance of
50- a subclass of BaseCallerContext.
5145 even_tracker: An EvenTracker instance.
5246 """
5347
5448 self .source = source
5549 self .allowed_functions = {func .name : func for func in allowed_functions }
56- self .contexts = contexts or []
5750 self ._event_tracker = event_tracker or EventTracker ()
5851
5952 async def process (self ) -> syntax .Node :
@@ -148,7 +141,7 @@ def _parse_arg(
148141 if not _does_arg_allow_context (arg_spec ):
149142 raise IQLContextNotAllowedError (arg , self .source , arg_name = arg_spec .name )
150143
151- return parent_func_def .context_class . select_context ( self . contexts )
144+ return parent_func_def .context
152145
153146 if not isinstance (arg , ast .Constant ):
154147 raise IQLArgumentParsingError (arg , self .source )
0 commit comments