Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[deck_polygon] implement null locations flag #5948

Merged
merged 2 commits into from
Sep 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,5 @@ describe('TableElement', () => {
wrapper.find('.table-remove').simulate('click');
expect(wrapper.state().expanded).to.equal(false);
expect(mockedActions.removeDataPreview.called).to.equal(true);
expect(mockedActions.removeTable.called).to.equal(true);
});
});
10 changes: 0 additions & 10 deletions superset/assets/src/explore/controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -712,16 +712,6 @@ export const controls = {
}),
},

polygon: {
type: 'SelectControl',
label: t('Polygon Column'),
validators: [v.nonEmpty],
description: t('Select the polygon column. Each row should contain JSON.array(N) of [longitude, latitude] points'),
mapStateToProps: state => ({
choices: (state.datasource) ? state.datasource.all_cols : [],
}),
},

point_radius_scale: {
type: 'SelectControl',
freeForm: true,
Expand Down
11 changes: 8 additions & 3 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -2135,21 +2135,26 @@ def process_spatial_data_obj(self, key, df):
return df

def add_null_filters(self):
fd = self.form_data
spatial_columns = set()
for key in self.spatial_control_keys:
for column in self.get_spatial_columns(key):
spatial_columns.add(column)

if self.form_data.get('adhoc_filters') is None:
self.form_data['adhoc_filters'] = []
if fd.get('adhoc_filters') is None:
fd['adhoc_filters'] = []

line_column = fd.get('line_column')
if line_column:
spatial_columns.add(line_column)

for column in sorted(spatial_columns):
filter_ = to_adhoc({
'col': column,
'op': 'IS NOT NULL',
'val': '',
})
self.form_data['adhoc_filters'].append(filter_)
fd['adhoc_filters'].append(filter_)

def query_obj(self):
fd = self.form_data
Expand Down