cmem_client.repositories.base.task_search¤
Repository implementation for Corporate Memory task search endpoints.
This module provides TaskSearchRepository, a specialized repository that uses Corporate Memory’s DataIntegration task search API to find and retrieve items. The search functionality allows for flexible querying with filters, facets, and text search capabilities.
Classes:
- TaskSearchRepository – Subclass of a ReadRepository that uses the task search endpoint.
- TaskSearchRepositoryConfig – Configuration class for a Task Search read repository
TaskSearchRepository¤
Bases: Repository
Subclass of a ReadRepository that uses the task search endpoint.
Attributes:
- _dict (
dict[str, TaskSearchRepository[ItemType]]) – Cached contents of the repository, mapping the key of each item to the item itself. Backs the Mapping interface and is populated byfetch_data(). - _client (
Client) – Corporate Memory client used for the HTTP requests of this repository. - _config (
TaskSearchRepositoryConfig) – Describes which task search endpoint to query and which task type to search for.
Functions:
- fetch_data – Fetch a list from the DI task search endpoint via a type adapter.
- get_task – Get full task details from the API.
- items – Get the items of the repository
- keys – Get the keys of the repository
- values – Get the values of the repository
fetch_data¤
Fetch a list from the DI task search endpoint via a type adapter.
get_task¤
Get full task details from the API.
Parameters:
- project_id (
str) – The project ID. - task_id (
str) – The task ID. - with_labels (
bool) – Whether to include labels in the response.
Returns:
TaskResponse– The full task details as a TaskResponse model.
items¤
Get the items of the repository
keys¤
Get the keys of the repository
logger¤
Gets the client logger
values¤
Get the values of the repository
TaskSearchRepositoryConfig¤
TaskSearchRepositoryConfig(fetch_data_adapter, item_type, component='build', fetch_data_path='/api/workspace/searchItems', facets=None)
Bases: RepositoryConfig
Configuration class for a Task Search read repository
Attributes:
- component (
Literal[‘build’, ‘explore’]) – Which Corporate Memory API endpoint to address:buildorexplore. - fetch_data_path (
str) – API path of the task search endpoint. - fetch_data_adapter (
TypeAdapter) – Pydantic TypeAdapter used to deserialize the search result set. - item_type (
str) – Task type to search for, sent asitemTypein the search request (e.g.datasetorworkflow). - facets (
list[dict[str, Any]] | None) – Facet filters sent asfacetsin the search request. If None, no facet filtering is applied.