3
3
4
4
from dbally .audit .event_tracker import EventTracker
5
5
from dbally .context ._utils import _does_arg_allow_context
6
- from dbally .context .context import BaseCallerContext , CustomContext
6
+ from dbally .context .context import BaseCallerContext
7
7
from dbally .iql import syntax
8
8
from dbally .iql ._exceptions import (
9
9
IQLArgumentParsingError ,
@@ -23,21 +23,17 @@ class IQLProcessor:
23
23
24
24
Attributes:
25
25
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.=
29
27
"""
30
28
31
29
source : str
32
30
allowed_functions : Mapping [str , "ExposedFunction" ]
33
- contexts : Iterable [CustomContext ]
34
31
_event_tracker : EventTracker
35
32
36
33
def __init__ (
37
34
self ,
38
35
source : str ,
39
36
allowed_functions : Iterable [ExposedFunction ],
40
- contexts : Optional [Iterable [CustomContext ]] = None ,
41
37
event_tracker : Optional [EventTracker ] = None ,
42
38
) -> None :
43
39
"""
@@ -46,14 +42,11 @@ def __init__(
46
42
Args:
47
43
source: Raw LLM response containing IQL filter calls.
48
44
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.
51
45
even_tracker: An EvenTracker instance.
52
46
"""
53
47
54
48
self .source = source
55
49
self .allowed_functions = {func .name : func for func in allowed_functions }
56
- self .contexts = contexts or []
57
50
self ._event_tracker = event_tracker or EventTracker ()
58
51
59
52
async def process (self ) -> syntax .Node :
@@ -148,7 +141,7 @@ def _parse_arg(
148
141
if not _does_arg_allow_context (arg_spec ):
149
142
raise IQLContextNotAllowedError (arg , self .source , arg_name = arg_spec .name )
150
143
151
- return parent_func_def .context_class . select_context ( self . contexts )
144
+ return parent_func_def .context
152
145
153
146
if not isinstance (arg , ast .Constant ):
154
147
raise IQLArgumentParsingError (arg , self .source )
0 commit comments