Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AmendsenProject
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shaik Janipasha
AmendsenProject
Commits
8cc4e6b3
Unverified
Commit
8cc4e6b3
authored
Apr 10, 2020
by
Tao Feng
Committed by
GitHub
Apr 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change dashboard ES doc based on latest requirement (#238)
parent
cf8478c0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
dashboard_elasticsearch_document.py
databuilder/models/dashboard_elasticsearch_document.py
+6
-6
setup.py
setup.py
+1
-1
test_dashboard_elasticsearch_document.py
tests/unit/models/test_dashboard_elasticsearch_document.py
+6
-6
No files found.
databuilder/models/dashboard_elasticsearch_document.py
View file @
8cc4e6b3
...
@@ -8,13 +8,13 @@ class DashboardESDocument(ElasticsearchDocument):
...
@@ -8,13 +8,13 @@ class DashboardESDocument(ElasticsearchDocument):
Schema for the ES dashboard ES document
Schema for the ES dashboard ES document
"""
"""
def
__init__
(
self
,
def
__init__
(
self
,
dashboard_group
,
# type: str
group_name
,
# type: str
dashboard_
name
,
# type: str
name
,
# type: str
description
,
# type: Union[str, None]
description
,
# type: Union[str, None]
total_usage
,
# type: int
total_usage
,
# type: int
product
=
''
,
# type: Optional[str]
product
=
''
,
# type: Optional[str]
cluster
=
''
,
# 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]
query_names
=
None
,
# type: Union[List[str], None]
group_url
=
None
,
# type: Optional[str]
group_url
=
None
,
# type: Optional[str]
url
=
None
,
# type: Optional[str]
url
=
None
,
# type: Optional[str]
...
@@ -23,8 +23,8 @@ class DashboardESDocument(ElasticsearchDocument):
...
@@ -23,8 +23,8 @@ class DashboardESDocument(ElasticsearchDocument):
tags
=
None
# type: list
tags
=
None
# type: list
):
):
# type: (...) -> None
# type: (...) -> None
self
.
dashboard_group
=
dashboard_group
self
.
group_name
=
group_name
self
.
dashboard_name
=
dashboard_
name
self
.
name
=
name
self
.
description
=
description
self
.
description
=
description
self
.
cluster
=
cluster
self
.
cluster
=
cluster
self
.
product
=
product
self
.
product
=
product
...
@@ -33,6 +33,6 @@ class DashboardESDocument(ElasticsearchDocument):
...
@@ -33,6 +33,6 @@ class DashboardESDocument(ElasticsearchDocument):
self
.
uri
=
uri
self
.
uri
=
uri
self
.
last_successful_run_timestamp
=
last_successful_run_timestamp
self
.
last_successful_run_timestamp
=
last_successful_run_timestamp
self
.
total_usage
=
total_usage
self
.
total_usage
=
total_usage
self
.
dashboard_group_description
=
dashboard_
group_description
self
.
group_description
=
group_description
self
.
query_names
=
query_names
self
.
query_names
=
query_names
self
.
tags
=
tags
self
.
tags
=
tags
setup.py
View file @
8cc4e6b3
...
@@ -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.5.
1
'
__version__
=
'2.5.
2
'
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'
)
with
open
(
requirements_path
)
as
requirements_file
:
with
open
(
requirements_path
)
as
requirements_file
:
...
...
tests/unit/models/test_dashboard_elasticsearch_document.py
View file @
8cc4e6b3
...
@@ -11,12 +11,12 @@ class TestDashboardElasticsearchDocument(unittest.TestCase):
...
@@ -11,12 +11,12 @@ class TestDashboardElasticsearchDocument(unittest.TestCase):
"""
"""
Test string generated from to_json method
Test string generated from to_json method
"""
"""
test_obj
=
DashboardESDocument
(
dashboard_group
=
'test_dashboard_group'
,
test_obj
=
DashboardESDocument
(
group_name
=
'test_dashboard_group'
,
dashboard_
name
=
'test_dashboard_name'
,
name
=
'test_dashboard_name'
,
description
=
'test_description'
,
description
=
'test_description'
,
product
=
'mode'
,
product
=
'mode'
,
cluster
=
'gold'
,
cluster
=
'gold'
,
dashboard_
group_description
=
'work space group'
,
group_description
=
'work space group'
,
query_names
=
[
'query1'
],
query_names
=
[
'query1'
],
group_url
=
'mode_group_url'
,
group_url
=
'mode_group_url'
,
url
=
'mode_report_url'
,
url
=
'mode_report_url'
,
...
@@ -25,8 +25,8 @@ class TestDashboardElasticsearchDocument(unittest.TestCase):
...
@@ -25,8 +25,8 @@ class TestDashboardElasticsearchDocument(unittest.TestCase):
total_usage
=
10
,
total_usage
=
10
,
tags
=
[
'test'
])
tags
=
[
'test'
])
expected_document_dict
=
{
"
dashboard_group
"
:
"test_dashboard_group"
,
expected_document_dict
=
{
"
group_name
"
:
"test_dashboard_group"
,
"
dashboard_
name"
:
"test_dashboard_name"
,
"name"
:
"test_dashboard_name"
,
"description"
:
"test_description"
,
"description"
:
"test_description"
,
"product"
:
"mode"
,
"product"
:
"mode"
,
"cluster"
:
"gold"
,
"cluster"
:
"gold"
,
...
@@ -35,7 +35,7 @@ class TestDashboardElasticsearchDocument(unittest.TestCase):
...
@@ -35,7 +35,7 @@ class TestDashboardElasticsearchDocument(unittest.TestCase):
"uri"
:
"mode_dashboard://gold.cluster/dashboard_group/dashboard"
,
"uri"
:
"mode_dashboard://gold.cluster/dashboard_group/dashboard"
,
"query_names"
:
[
'query1'
],
"query_names"
:
[
'query1'
],
"last_successful_run_timestamp"
:
10
,
"last_successful_run_timestamp"
:
10
,
"
dashboard_
group_description"
:
"work space group"
,
"group_description"
:
"work space group"
,
"total_usage"
:
10
,
"total_usage"
:
10
,
"tags"
:
[
"test"
]
"tags"
:
[
"test"
]
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment