10
10
if TYPE_CHECKING :
11
11
from contentctl .input .director import DirectorOutputDto
12
12
13
-
14
13
from contentctl .objects .config import All , Changes , Selected , test_common
15
14
from contentctl .objects .data_source import DataSource
16
15
from contentctl .objects .detection import Detection
17
- from contentctl .objects .lookup import Lookup , Lookup_Type
16
+ from contentctl .objects .lookup import CSVLookup , Lookup
18
17
from contentctl .objects .macro import Macro
19
18
from contentctl .objects .security_content_object import SecurityContentObject
20
19
@@ -150,8 +149,7 @@ def getChanges(self, target_branch: str) -> List[Detection]:
150
149
# Filter to find the Lookup Object the references this CSV
151
150
matched = list (
152
151
filter (
153
- lambda x : x .lookup_type == Lookup_Type .csv
154
- and x .filename is not None
152
+ lambda x : isinstance (x , CSVLookup )
155
153
and x .filename == decoded_path ,
156
154
self .director .lookups ,
157
155
)
@@ -162,7 +160,7 @@ def getChanges(self, target_branch: str) -> List[Detection]:
162
160
)
163
161
elif len (matched ) > 1 :
164
162
raise Exception (
165
- f"More than 1 Lookup reference the modified CSV file '{ decoded_path } ': { [l .file_path for l in matched ]} "
163
+ f"More than 1 Lookup reference the modified CSV file '{ decoded_path } ': { [match .file_path for match in matched ]} "
166
164
)
167
165
else :
168
166
updatedLookup = matched [0 ]
@@ -195,7 +193,7 @@ def getChanges(self, target_branch: str) -> List[Detection]:
195
193
# If a detection has at least one dependency on changed content,
196
194
# then we must test it again
197
195
198
- changed_macros_and_lookups_and_datasources : set [SecurityContentObject ] = (
196
+ changed_macros_and_lookups_and_datasources : set [Macro | Lookup | DataSource ] = (
199
197
updated_macros .union (updated_lookups , updated_datasources )
200
198
)
201
199
0 commit comments