Skip to content

Commit

Permalink
Merge pull request #1 from itsmvd/itsmvd-dfiq-llm
Browse files Browse the repository at this point in the history
Add TimesketchEvents to containers.py
  • Loading branch information
itsmvd authored Jan 14, 2025
2 parents 582248b + 6d3f14a commit a509f2a
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion dftimewolf/lib/containers/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from __future__ import annotations

import datetime
import pandas as pd

from typing import Optional, Union, List, TYPE_CHECKING, Dict, Any

Expand Down Expand Up @@ -395,7 +396,7 @@ class DataFrame(interface.AttributeContainer):

def __init__(
self,
data_frame: "pandas.DataFrame",
data_frame: pd.DataFrame,
description: str,
name: str,
source: Optional[str] = None,
Expand Down Expand Up @@ -883,3 +884,29 @@ def __init__(
)
self.sketch_url = sketch_url
self.results = results


class TimesketchEvents(DataFrame):
"""Attribute container for Timesketch events."""

CONTAINER_TYPE = "timesketch_events"

def __init__(
self,
data_frame: pd.DataFrame,
query: str,
sketch_id: int,
description: str,
name: str,
source: Optional[str] = "Timesketch",
):
"""Initializes the TimesketchEvents container."""
super().__init__(data_frame, description, name, source)
self.query = query
self.sketch_id = sketch_id

def __str__(self) -> str:
return (
f"<TimesketchEvents(query:{self.query}, "
f"sketch_id:{self.sketch_id}, rows:{len(self.data_frame)})>"
)

0 comments on commit a509f2a

Please sign in to comment.