Coverage for mindsdb / integrations / libs / keyword_search_base.py: 73%

11 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-01-21 00:36 +0000

1from mindsdb_sql_parser.ast import Select 

2from typing import List 

3import pandas as pd 

4 

5from mindsdb.integrations.utilities.sql_utils import FilterCondition, KeywordSearchArgs 

6 

7 

8class KeywordSearchBase: 

9 """ 

10 Base class for keyword search integrations. 

11 This class provides a common interface for keyword search functionality. 

12 """ 

13 

14 def __init__(self, *args, **kwargs): 

15 pass 

16 

17 def dispatch_keyword_select( 

18 self, query: Select, conditions: List[FilterCondition] = None, keyword_search_args: KeywordSearchArgs = None 

19 ): 

20 """Dispatches a keyword search select query to the appropriate method.""" 

21 raise NotImplementedError() 

22 

23 def keyword_select( 

24 self, 

25 table_name: str, 

26 columns: List[str] = None, 

27 conditions: List[FilterCondition] = None, 

28 offset: int = None, 

29 limit: int = None, 

30 ) -> pd.DataFrame: 

31 """Select data from table 

32 

33 Args: 

34 table_name (str): table name 

35 columns (List[str]): columns to select 

36 conditions (List[FilterCondition]): conditions to select 

37 

38 Returns: 

39 HandlerResponse 

40 """ 

41 raise NotImplementedError()