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
class DashboardESDocument(ElasticsearchDocument):
"""
Schema for the Search index document
Schema for the ES dashboard ES document
"""
def __init__(self,
dashboard_group, # type: str
dashboard_name, # type: str
description, # type: Union[str, None]
last_reload_time, # type: str
user_id, # type: str
user_name, # type: str
tags # type: list
total_usage, # type: int
product='', # type: Optional[str]
dashboard_group_description=None, # type: Optional[str]
tags=None # type: list
):
# type: (...) -> None
self.dashboard_group = dashboard_group
self.dashboard_name = dashboard_name
self.description = description
self.last_reload_time = last_reload_time
self.user_id = user_id
self.user_name = user_name
self.product = product
self.total_usage = total_usage
self.dashboard_group_description = dashboard_group_description
self.tags = tags
......@@ -2,7 +2,7 @@ import os
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')
......
......@@ -14,17 +14,17 @@ class TestDashboardElasticsearchDocument(unittest.TestCase):
test_obj = DashboardESDocument(dashboard_group='test_dashboard_group',
dashboard_name='test_dashboard_name',
description='test_description',
last_reload_time='test_last_reload_time',
user_id='test_user_id',
user_name='test_user_name',
product='mode',
dashboard_group_description='work space group',
total_usage=10,
tags=['test'])
expected_document_dict = {"dashboard_group": "test_dashboard_group",
"dashboard_name": "test_dashboard_name",
"description": "test_description",
"last_reload_time": "test_last_reload_time",
"user_id": "test_user_id",
"user_name": "test_user_name",
"product": "mode",
"dashboard_group_description": "work space group",
"total_usage": 10,
"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