Skip to content

Commit aedd87f

Browse files
authored
Update dashboard ES doc (#218)
1 parent 1c72ef1 commit aedd87f

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

databuilder/models/dashboard_elasticsearch_document.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55

66
class DashboardESDocument(ElasticsearchDocument):
77
"""
8-
Schema for the Search index document
8+
Schema for the ES dashboard ES document
99
"""
1010
def __init__(self,
1111
dashboard_group, # type: str
1212
dashboard_name, # type: str
1313
description, # type: Union[str, None]
14-
last_reload_time, # type: str
15-
user_id, # type: str
16-
user_name, # type: str
17-
tags # type: list
14+
total_usage, # type: int
15+
product='', # type: Optional[str]
16+
dashboard_group_description=None, # type: Optional[str]
17+
tags=None # type: list
1818
):
1919
# type: (...) -> None
2020
self.dashboard_group = dashboard_group
2121
self.dashboard_name = dashboard_name
2222
self.description = description
23-
self.last_reload_time = last_reload_time
24-
self.user_id = user_id
25-
self.user_name = user_name
23+
self.product = product
24+
self.total_usage = total_usage
25+
self.dashboard_group_description = dashboard_group_description
2626
self.tags = tags

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from setuptools import setup, find_packages
33

44

5-
__version__ = '2.3.2'
5+
__version__ = '2.3.3'
66

77

88
requirements_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'requirements.txt')

tests/unit/models/test_dashboard_elasticsearch_document.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ def test_to_json(self):
1414
test_obj = DashboardESDocument(dashboard_group='test_dashboard_group',
1515
dashboard_name='test_dashboard_name',
1616
description='test_description',
17-
last_reload_time='test_last_reload_time',
18-
user_id='test_user_id',
19-
user_name='test_user_name',
17+
product='mode',
18+
dashboard_group_description='work space group',
19+
total_usage=10,
2020
tags=['test'])
2121

2222
expected_document_dict = {"dashboard_group": "test_dashboard_group",
2323
"dashboard_name": "test_dashboard_name",
2424
"description": "test_description",
25-
"last_reload_time": "test_last_reload_time",
26-
"user_id": "test_user_id",
27-
"user_name": "test_user_name",
25+
"product": "mode",
26+
"dashboard_group_description": "work space group",
27+
"total_usage": 10,
2828
"tags": ["test"]
2929
}
3030

0 commit comments

Comments
 (0)