Skip to content

Commit

Permalink
ci fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nskobov committed Dec 7, 2023
1 parent db3af56 commit e6e70b2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions panther_analysis_tool/analysis_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
from panther_analysis_tool.backend.client import Client as BackendClient
from panther_analysis_tool.backend.client import (
GetRuleBodyParams,
GetRuleBodyResponse,
TranspileFiltersParams,
TranspileToPythonParams,
)
Expand Down Expand Up @@ -454,12 +453,12 @@ def get_simple_detections_as_python(
return enriched_specs if enriched_specs else specs


def lookup_base_detection(id: str, backend: Optional[BackendClient] = None) -> Dict[str, Any]:
def lookup_base_detection(the_id: str, backend: Optional[BackendClient] = None) -> Dict[str, Any]:
"""Attempts to lookup base detection via its id"""
out = {}
if backend is not None:
try:
params = GetRuleBodyParams(id=id)
params = GetRuleBodyParams(id=the_id)
response = backend.get_rule_body(params)
if response.status_code == 200:
out["body"] = response.data.body
Expand All @@ -470,7 +469,7 @@ def lookup_base_detection(id: str, backend: Optional[BackendClient] = None) -> D
except (BackendError, BaseException) as be_err: # pylint: disable=broad-except
logging.warning(
"Error getting base detection %s: %s",
id,
the_id,
be_err,
)
return out
Expand Down
4 changes: 2 additions & 2 deletions panther_analysis_tool/backend/public_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ def bulk_validate(self, params: BulkUploadParams) -> BulkUploadValidateStatusRes
# This function was generated in whole or in part by GitHub Copilot.
def get_rule_body(self, params: GetRuleBodyParams) -> BackendResponse[GetRuleBodyResponse]:
query: DocumentNode = self._requests.get_rule_body()
input = {"input": params.id}
res = self._safe_execute(query, variable_values=input)
params = {"input": params.id}
res = self._safe_execute(query, variable_values=params)
data = res.data.get("rulePythonBody", {}) # type: ignore

return BackendResponse(
Expand Down
3 changes: 1 addition & 2 deletions panther_analysis_tool/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
add_path_to_filename,
convert_unicode,
is_correlation_rule,
is_derived_detection,
is_simple_detection,
)
from panther_analysis_tool.validation import (
Expand Down Expand Up @@ -893,7 +892,7 @@ def setup_data_models(
return log_type_to_data_model, invalid_specs


def setup_run_tests( # pylint: disable=too-many-locals,too-many-arguments
def setup_run_tests( # pylint: disable=too-many-locals,too-many-arguments,too-many-statements
log_type_to_data_model: Dict[str, DataModel],
analysis: List[ClassifiedAnalysis],
minimum_tests: int,
Expand Down

0 comments on commit e6e70b2

Please sign in to comment.