diff --git a/common/amundsen_common/models/search.py b/common/amundsen_common/models/search.py index 06ae63b65c..d90d9eda35 100644 --- a/common/amundsen_common/models/search.py +++ b/common/amundsen_common/models/search.py @@ -1,13 +1,24 @@ # Copyright Contributors to the Amundsen project. # SPDX-License-Identifier: Apache-2.0 -from typing import List, Optional, Dict +from typing import Any, List, Optional, Dict import attr from marshmallow3_annotations.ext.attrs import AttrsSchema +@attr.s(auto_attribs=True, kw_only=True) +class HighlightOptions: + enable_highlight: bool = False + + +class HighlightOptionsSchema(AttrsSchema): + class Meta: + target = HighlightOptions + register_as_scheme = True + + @attr.s(auto_attribs=True, kw_only=True) class Filter: name: str @@ -28,6 +39,8 @@ class SearchRequest: page_index: Optional[int] = 0 results_per_page: Optional[int] = 10 filters: List[Filter] = [] + # highlight options are defined per resource + highlight_options: Optional[Dict[str, HighlightOptions]] class SearchRequestSchema(AttrsSchema): @@ -41,7 +54,7 @@ class SearchResponse: msg: str page_index: int results_per_page: int - results: Dict # type: ignore + results: Dict[str, Any] status_code: int diff --git a/common/setup.py b/common/setup.py index b1c4d11901..247c3cd10e 100644 --- a/common/setup.py +++ b/common/setup.py @@ -4,7 +4,7 @@ from setuptools import find_packages, setup -__version__ = '0.26.2' +__version__ = '0.27.0' requirements_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'requirements-dev.txt') diff --git a/requirements-common.txt b/requirements-common.txt index 48f79dabda..3de3d38849 100644 --- a/requirements-common.txt +++ b/requirements-common.txt @@ -5,7 +5,7 @@ # It is recommended to always pin the exact version (not range) - otherwise common upgrade won't trigger unit tests # on all repositories reyling on this file and any issues that arise from common upgrade might be missed. -amundsen-common>=0.26.0,<0.27.0 +amundsen-common>=0.26.0,<=0.27.0 attrs>=19.1.0 boto3==1.17.23 click==7.0