mistercrunch closed pull request #5561: Minor linting & small bug fixes
URL: https://github.com/apache/incubator-superset/pull/5561
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/superset/assets/src/visualizations/deckgl/layers/grid.jsx
b/superset/assets/src/visualizations/deckgl/layers/grid.jsx
index ca3056e2c1..16a538c906 100644
--- a/superset/assets/src/visualizations/deckgl/layers/grid.jsx
+++ b/superset/assets/src/visualizations/deckgl/layers/grid.jsx
@@ -21,7 +21,6 @@ function getLayer(formData, payload, slice) {
const jsFnMutator = sandboxedEval(fd.js_data_mutator);
data = jsFnMutator(data);
}
-
return new GridLayer({
id: `grid-layer-${fd.slice_id}`,
data,
diff --git a/superset/data/__init__.py b/superset/data/__init__.py
index b887034899..a164111e62 100644
--- a/superset/data/__init__.py
+++ b/superset/data/__init__.py
@@ -226,6 +226,7 @@ def load_world_bank_health_n_pop():
params=get_slice_json(
defaults,
viz_type='filter_box',
+ date_filter=False,
groupby=['region', 'country_name'])),
Slice(
slice_name="World's Population",
@@ -472,7 +473,7 @@ def load_world_bank_health_n_pop():
"width": 4
},
"type": "CHART"
- },
+ },
"CHART-a4808bba": {
"children": [],
"id": "CHART-a4808bba",
@@ -994,7 +995,7 @@ def load_birth_names():
"type": "CHART",
"id": "CHART-976960a5",
"children": []
- },
+ },
"CHART-58575537": {
"meta": {
"chartId": 54,
@@ -1024,7 +1025,7 @@ def load_birth_names():
"type": "CHART",
"id": "CHART-e440d205",
"children": []
- },
+ },
"CHART-59444e0b": {
"meta": {
"chartId": 57,
@@ -1054,7 +1055,7 @@ def load_birth_names():
"type": "CHART",
"id": "CHART-e8774b49",
"children": []
- },
+ },
"CHART-985bfd1e": {
"meta": {
"chartId": 61,
@@ -1064,7 +1065,7 @@ def load_birth_names():
"type": "CHART",
"id": "CHART-985bfd1e",
"children": []
- },
+ },
"CHART-17f13246": {
"meta": {
"chartId": 62,
@@ -1331,7 +1332,7 @@ def load_unicode_test_data():
"type": "ROW"
},
"VERSION_KEY": "v2"
-}
+}
"""
dash.dashboard_title = "Unicode Test"
l = json.loads(js)
@@ -1836,6 +1837,7 @@ def load_deck_dash():
"multiplier": 10,
"point_radius_fixed": {"type": "metric", "value": "count"},
"point_unit": "square_m",
+ "min_radius": 1,
"row_limit": 5000,
"since": None,
"size": "count",
@@ -1972,10 +1974,9 @@ def load_deck_dash():
"granularity_sqla": "dttm",
"size": "count",
"viz_type": "deck_grid",
- "since": None,
"point_radius_unit": "Pixels",
"point_radius": "Auto",
- "until": None,
+ "time_range": "No filter",
"color_picker": {
"a": 1,
"r": 14,
@@ -2244,7 +2245,7 @@ def load_deck_dash():
"type": "CHART",
"id": "CHART-d02f6c40",
"children": []
- },
+ },
"CHART-2673431d": {
"meta": {
"chartId": 70,
diff --git a/superset/legacy.py b/superset/legacy.py
index 54da75c93d..49cc5fe530 100644
--- a/superset/legacy.py
+++ b/superset/legacy.py
@@ -88,4 +88,6 @@ def update_time_range(form_data):
"""Move since and until to time_range."""
if 'since' in form_data or 'until' in form_data:
form_data['time_range'] = '{} : {}'.format(
- form_data.pop('since', ''), form_data.pop('until', ''))
+ form_data.pop('since', '') or '',
+ form_data.pop('until', '') or '',
+ )
diff --git a/superset/views/core.py b/superset/views/core.py
index 09904f71d6..14c5469195 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -1075,7 +1075,7 @@ def get_query_string_response(self, viz_obj):
json.dumps({
'query': query,
'language': viz_obj.datasource.query_language,
- 'data': viz_obj.get_df().to_dict('records'),
+ 'data': viz_obj.get_df().to_dict('records'), # TODO, split
into endpoint
}, default=utils.json_iso_dttm_ser),
status=200,
mimetype='application/json')
@@ -2742,7 +2742,7 @@ def sqllab(self):
@api
@has_access_api
@expose('/slice_query/<slice_id>/')
- def sliceQuery(self, slice_id):
+ def slice_query(self, slice_id):
"""
This method exposes an API endpoint to
get the database query string for this slice
diff --git a/superset/viz.py b/superset/viz.py
index c9eea34ca2..b0a71d5a9d 100644
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -2065,7 +2065,7 @@ class BaseDeckGLViz(BaseViz):
spatial_control_keys = []
def handle_nulls(self, df):
- pass
+ return df
def get_metrics(self):
self.metric = self.form_data.get('size')
@@ -2146,7 +2146,6 @@ def query_obj(self):
d['columns'] = []
else:
d['columns'] = gb
-
return d
def get_js_columns(self, d):
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]