Unverified Commit aedd87fb authored by Tao Feng's avatar Tao Feng Committed by GitHub

Update dashboard ES doc (#218)

parent 1c72ef16
...@@ -5,22 +5,22 @@ from databuilder.models.elasticsearch_document import ElasticsearchDocument ...@@ -5,22 +5,22 @@ from databuilder.models.elasticsearch_document import ElasticsearchDocument
class DashboardESDocument(ElasticsearchDocument): class DashboardESDocument(ElasticsearchDocument):
""" """
Schema for the Search index document Schema for the ES dashboard ES document
""" """
def __init__(self, def __init__(self,
dashboard_group, # type: str dashboard_group, # type: str
dashboard_name, # type: str dashboard_name, # type: str
description, # type: Union[str, None] description, # type: Union[str, None]
last_reload_time, # type: str total_usage, # type: int
user_id, # type: str product='', # type: Optional[str]
user_name, # type: str dashboard_group_description=None, # type: Optional[str]
tags # type: list tags=None # type: list
): ):
# type: (...) -> None # type: (...) -> None
self.dashboard_group = dashboard_group self.dashboard_group = dashboard_group
self.dashboard_name = dashboard_name self.dashboard_name = dashboard_name
self.description = description self.description = description
self.last_reload_time = last_reload_time self.product = product
self.user_id = user_id self.total_usage = total_usage
self.user_name = user_name self.dashboard_group_description = dashboard_group_description
self.tags = tags self.tags = tags
...@@ -2,7 +2,7 @@ import os ...@@ -2,7 +2,7 @@ import os
from setuptools import setup, find_packages from setuptools import setup, find_packages
__version__ = '2.3.2' __version__ = '2.3.3'
requirements_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'requirements.txt') requirements_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'requirements.txt')
......
...@@ -14,17 +14,17 @@ class TestDashboardElasticsearchDocument(unittest.TestCase): ...@@ -14,17 +14,17 @@ class TestDashboardElasticsearchDocument(unittest.TestCase):
test_obj = DashboardESDocument(dashboard_group='test_dashboard_group', test_obj = DashboardESDocument(dashboard_group='test_dashboard_group',
dashboard_name='test_dashboard_name', dashboard_name='test_dashboard_name',
description='test_description', description='test_description',
last_reload_time='test_last_reload_time', product='mode',
user_id='test_user_id', dashboard_group_description='work space group',
user_name='test_user_name', total_usage=10,
tags=['test']) tags=['test'])
expected_document_dict = {"dashboard_group": "test_dashboard_group", expected_document_dict = {"dashboard_group": "test_dashboard_group",
"dashboard_name": "test_dashboard_name", "dashboard_name": "test_dashboard_name",
"description": "test_description", "description": "test_description",
"last_reload_time": "test_last_reload_time", "product": "mode",
"user_id": "test_user_id", "dashboard_group_description": "work space group",
"user_name": "test_user_name", "total_usage": 10,
"tags": ["test"] "tags": ["test"]
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment