Skip to content

Commit

Permalink
Change dashboard ES doc based on latest requirement (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
feng-tao authored Apr 10, 2020
1 parent cf8478c commit 8cc4e6b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions databuilder/models/dashboard_elasticsearch_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ class DashboardESDocument(ElasticsearchDocument):
Schema for the ES dashboard ES document
"""
def __init__(self,
dashboard_group, # type: str
dashboard_name, # type: str
group_name, # type: str
name, # type: str
description, # type: Union[str, None]
total_usage, # type: int
product='', # type: Optional[str]
cluster='', # type: Optional[str]
dashboard_group_description=None, # type: Optional[str]
group_description=None, # type: Optional[str]
query_names=None, # type: Union[List[str], None]
group_url=None, # type: Optional[str]
url=None, # type: Optional[str]
Expand All @@ -23,8 +23,8 @@ def __init__(self,
tags=None # type: list
):
# type: (...) -> None
self.dashboard_group = dashboard_group
self.dashboard_name = dashboard_name
self.group_name = group_name
self.name = name
self.description = description
self.cluster = cluster
self.product = product
Expand All @@ -33,6 +33,6 @@ def __init__(self,
self.uri = uri
self.last_successful_run_timestamp = last_successful_run_timestamp
self.total_usage = total_usage
self.dashboard_group_description = dashboard_group_description
self.group_description = group_description
self.query_names = query_names
self.tags = tags
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from setuptools import setup, find_packages


__version__ = '2.5.1'
__version__ = '2.5.2'

requirements_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'requirements.txt')
with open(requirements_path) as requirements_file:
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/models/test_dashboard_elasticsearch_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ def test_to_json(self):
"""
Test string generated from to_json method
"""
test_obj = DashboardESDocument(dashboard_group='test_dashboard_group',
dashboard_name='test_dashboard_name',
test_obj = DashboardESDocument(group_name='test_dashboard_group',
name='test_dashboard_name',
description='test_description',
product='mode',
cluster='gold',
dashboard_group_description='work space group',
group_description='work space group',
query_names=['query1'],
group_url='mode_group_url',
url='mode_report_url',
Expand All @@ -25,8 +25,8 @@ def test_to_json(self):
total_usage=10,
tags=['test'])

expected_document_dict = {"dashboard_group": "test_dashboard_group",
"dashboard_name": "test_dashboard_name",
expected_document_dict = {"group_name": "test_dashboard_group",
"name": "test_dashboard_name",
"description": "test_description",
"product": "mode",
"cluster": "gold",
Expand All @@ -35,7 +35,7 @@ def test_to_json(self):
"uri": "mode_dashboard://gold.cluster/dashboard_group/dashboard",
"query_names": ['query1'],
"last_successful_run_timestamp": 10,
"dashboard_group_description": "work space group",
"group_description": "work space group",
"total_usage": 10,
"tags": ["test"]
}
Expand Down

0 comments on commit 8cc4e6b

Please sign in to comment.