graviti.manager.search#

The implementation of the SearchHistory and SearchManager.

Module Contents#

Classes#

SearchHistory

This class defines the structure of the search history of Graviti Data Platform.

SearchManager

This class defines the operations on the searches on Graviti.

class graviti.manager.search.SearchHistory(dataset, response)[source]#

Bases: graviti.utility.ReprMixin

This class defines the structure of the search history of Graviti Data Platform.

Parameters
  • dataset (graviti.manager.dataset.Dataset) – Class Dataset instance.

  • response (Dict[str, Any]) –

    The response of the OpenAPI associated with the search history:

    {
        "id": <str>
        "commit_id": <str>,
        "draft_number": <int>,
        "sheet": <str>,
        "criteria": <dict>,
        "total_count": <int>,
        "creator": <str>,
        "created_at": <str>,
    },
    

search_id#

The id of this search history.

commit#

The commit of this search history.

draft_number#

The draft number of this search history.

sheet#

The sheet name of this search history.

criteria#

The criteria of this search history.

total_count#

The total count of this search history.

creator#

The creator of this search history.

created_at#

The create time of this search history.

class graviti.manager.search.SearchManager(dataset)[source]#

This class defines the operations on the searches on Graviti.

Parameters
get(self, search_id)[source]#

Get a Graviti search history with given search id.

Parameters

search_id (str) – The id of the search history.

Returns

The requested SearchManager instance.

Return type

SearchHistory

list(self, *, commit_id, draft_number, sheet, sort)[source]#

List Graviti search histories.

Parameters
  • commit_id (Optional[str]) – The commit id.

  • draft_number (Optional[int]) – The draft number.

  • sheet (Optional[str]) – The name of the sheet.

  • sort (graviti.utility.SortParam) – The column and the direction the list result sorted by.

Returns

The LazyPagingList of SearchHistory instances.

Return type

graviti.manager.lazy.LazyPagingList[SearchHistory]

delete(self, search_id)[source]#

Delete a Graviti search history with given search id.

Parameters

search_id (str) – The id of the search history.

Return type

None