Skip to content

Commit

Permalink
Update TimesketchSearchEventCollector to use the new TimesketchEvents…
Browse files Browse the repository at this point in the history
… container (#955)

* Add TimesketchEvents to containers.py

* Update containers.py

* Update containers.py

Fix pandas -> pd

* Update containers.py

fix import order

* Update TimesketchSearchEventCollector to use the new TimesketchEvents container
  • Loading branch information
itsmvd authored Jan 16, 2025
1 parent defb3b9 commit a7d3bf0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions dftimewolf/lib/collectors/timesketch.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,13 @@ def _OutputSearchResults(self, data_frame: pd.DataFrame) -> None:

if self.output_format == 'pandas':
self.StoreContainer(
containers.DataFrame(
containers.TimesketchEvents(
name=self.search_name,
description=self.search_description,
data_frame=data_frame))
data_frame=data_frame,
query=self.query_string,
sketch_id=self.sketch_id
))
else:
with tempfile.NamedTemporaryFile(
mode='w',
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/collectors/timesketch.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def testProcessPandas(self, mock_get_search_results, _mock_get_api_client):
token_password='test_token')
self._ProcessModule()

state_containers = self._module.GetContainers(containers.DataFrame)
state_containers = self._module.GetContainers(containers.TimesketchEvents)
self.assertEqual(len(state_containers), 1)
pd.testing.assert_frame_equal(
state_containers[0].data_frame, pd.DataFrame([1, 2]))
Expand Down

0 comments on commit a7d3bf0

Please sign in to comment.