Skip to content

Commit 137427d

Browse files
committed
fix: Resolve kql method signature conflict between SentinelMixin and KustoMixin
1 parent 6f91006 commit 137427d

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

graphistry/plugins/kusto.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import time
22
import pandas as pd
3-
from typing import Any, List, Optional, TYPE_CHECKING, Union, overload, Literal
3+
from typing import Any, List, Optional, TYPE_CHECKING, Union, overload, Literal, Tuple
4+
from datetime import datetime, timedelta
45

56
if TYPE_CHECKING:
67
from azure.kusto.data import KustoClient
@@ -176,37 +177,45 @@ def kql(
176177
self,
177178
query: str,
178179
*,
180+
timespan: Optional[Union[timedelta, Tuple[datetime, datetime]]] = None,
179181
unwrap_nested: Optional[bool] = None,
180-
single_table: Literal[True] = True
181-
) -> List[pd.DataFrame]:
182+
single_table: Literal[True] = True,
183+
include_statistics: bool = False
184+
) -> pd.DataFrame:
182185
...
183186

184187
@overload
185188
def kql(
186189
self,
187190
query: str,
188191
*,
192+
timespan: Optional[Union[timedelta, Tuple[datetime, datetime]]] = None,
189193
unwrap_nested: Optional[bool] = None,
190-
single_table: Literal[False]
191-
) -> pd.DataFrame:
194+
single_table: Literal[False],
195+
include_statistics: bool = False
196+
) -> List[pd.DataFrame]:
192197
...
193198

194199
@overload
195200
def kql(
196201
self,
197202
query: str,
198203
*,
204+
timespan: Optional[Union[timedelta, Tuple[datetime, datetime]]] = None,
199205
unwrap_nested: Optional[bool] = None,
200-
single_table: bool = True
206+
single_table: bool = True,
207+
include_statistics: bool = False
201208
) -> Union[pd.DataFrame, List[pd.DataFrame]]:
202209
...
203210

204211
def kql(
205212
self,
206213
query: str,
207214
*,
215+
timespan: Optional[Union[timedelta, Tuple[datetime, datetime]]] = None,
208216
unwrap_nested: Optional[bool] = None,
209-
single_table: bool = True
217+
single_table: bool = True,
218+
include_statistics: bool = False
210219
) -> Union[pd.DataFrame, List[pd.DataFrame]]:
211220
"""Execute KQL query and return result tables as DataFrames.
212221
@@ -217,10 +226,14 @@ def kql(
217226
218227
:param query: KQL query string to execute
219228
:type query: str
229+
:param timespan: Time range for the query (ignored by Kusto, for compatibility with Sentinel)
230+
:type timespan: Optional[Union[timedelta, Tuple[datetime, datetime]]]
220231
:param unwrap_nested: Strategy for handling nested/dynamic columns
221232
:type unwrap_nested: Optional[bool]
222233
:param single_table: If True, return single DataFrame (first table if multiple); if False, return list
223234
:type single_table: bool
235+
:param include_statistics: Include query statistics (ignored by Kusto, for compatibility with Sentinel)
236+
:type include_statistics: bool
224237
:returns: Single DataFrame if single_table=True, else list of DataFrames
225238
:rtype: Union[pd.DataFrame, List[pd.DataFrame]]
226239

0 commit comments

Comments
 (0)