Allow for additional axis information when creating a visualization.
This commit is contained in:
Родитель
cf09e6290e
Коммит
0236c7e6c2
|
@ -5,5 +5,5 @@ scipy == 1.0.0
|
|||
statistics == 1.0.3.5
|
||||
statsmodels == 0.9.0
|
||||
urllib3 == 1.24.1
|
||||
redash_client == 0.2.5
|
||||
redash_client == 0.2.7
|
||||
nose == 1.3.7
|
||||
|
|
2
setup.py
2
setup.py
|
@ -15,6 +15,6 @@ setup(
|
|||
"statistics == 1.0.3.5",
|
||||
"statsmodels == 0.9.0",
|
||||
"urllib3 == 1.24.1",
|
||||
"redash_client == 0.2.5"
|
||||
"redash_client == 0.2.7"
|
||||
]
|
||||
)
|
|
@ -57,10 +57,18 @@ class SummaryDashboard(object):
|
|||
"Unable to fetch query results: '{query_name}' "
|
||||
" {error}".format(query_name=query_name, error=e))
|
||||
|
||||
def _create_new_visualization(self, query_id, visualization_type,
|
||||
visualization_name, chart_type,
|
||||
column_mapping, series_options,
|
||||
time_interval, stacking):
|
||||
def _create_new_visualization(
|
||||
self,
|
||||
query_id,
|
||||
visualization_type,
|
||||
visualization_name,
|
||||
chart_type,
|
||||
column_mapping,
|
||||
series_options,
|
||||
time_interval,
|
||||
stacking,
|
||||
axis_info
|
||||
):
|
||||
try:
|
||||
viz_id = self.redash.create_new_visualization(
|
||||
query_id,
|
||||
|
@ -71,6 +79,7 @@ class SummaryDashboard(object):
|
|||
series_options,
|
||||
time_interval,
|
||||
stacking,
|
||||
axis_info,
|
||||
)
|
||||
return viz_id
|
||||
except self.redash.RedashClientException as e:
|
||||
|
@ -242,7 +251,8 @@ class SummaryDashboard(object):
|
|||
column_mapping=None,
|
||||
series_options=None,
|
||||
time_interval=None,
|
||||
stacking=True
|
||||
stacking=True,
|
||||
axis_info={}
|
||||
):
|
||||
query_id, table_id = self._create_new_query(
|
||||
query_title, query_string, data_source)
|
||||
|
@ -255,5 +265,6 @@ class SummaryDashboard(object):
|
|||
series_options,
|
||||
time_interval,
|
||||
stacking,
|
||||
axis_info,
|
||||
)
|
||||
self._add_visualization_to_dashboard(viz_id, visualization_width)
|
||||
|
|
|
@ -56,7 +56,7 @@ class TestSummaryDashboard(AppTest):
|
|||
self.dash.ExternalAPIError,
|
||||
"Unable to create visualization titled",
|
||||
lambda: self.dash._create_new_visualization(
|
||||
"a", "b", "c", "d", "e", "f", "g", "h"))
|
||||
"a", "b", "c", "d", "e", "f", "g", "h", "i"))
|
||||
|
||||
def test_get_widgets_from_dash_exception_thrown(self):
|
||||
self._setupMockRedashClientException("get_widget_from_dash")
|
||||
|
|
|
@ -5,4 +5,4 @@ mock == 1.3.0
|
|||
statistics == 1.0.3.5
|
||||
statsmodels == 0.9.0
|
||||
urllib3 == 1.24.1
|
||||
redash_client == 0.2.5
|
||||
redash_client == 0.2.7
|
||||
|
|
Загрузка…
Ссылка в новой задаче