mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
SelectControl hackery: Fixing freeform select and allowing group by and non group-by column selectors to take in arbitrary expressions including select-all semantics. (#6722)
Summary: We want to allow grouping by on expressions, including the ability to select expressions (without group-by). The UI ain't good yet .. it is not at the feature parity of say adhoc filters/metrics that come with a nice text-box to edit the SQL. But this suffices for my usecase for now. (The UI would have to be redone ... but that would require some refactoring to merge the AdhocFilter/Metric/Popover stuff such that it can be used for this use case too.) Also fixed a bug in the SelectControl freeForm selection. Allow selecting all columns easily: Added a new Select-All special item that users can select to make all the options in the selectable show up. The ability to group by arbitrary expressions is useful because now two users don't need to create custom computed-fields for this.
This commit is contained in:
committed by
Maxime Beauchemin
parent
e1b907783a
commit
fc4042a28b
@@ -26,6 +26,7 @@ from superset import app, db, is_feature_enabled, security_manager
|
||||
from superset.connectors.druid.models import DruidCluster, DruidDatasource
|
||||
from superset.connectors.sqla.models import SqlaTable
|
||||
from superset.models import core as models
|
||||
from superset.models.core import Database
|
||||
from superset.utils.core import get_main_database
|
||||
|
||||
BASE_DIR = app.config.get('BASE_DIR')
|
||||
@@ -99,6 +100,9 @@ class SupersetTestCase(unittest.TestCase):
|
||||
def get_table_by_name(self, name):
|
||||
return db.session.query(SqlaTable).filter_by(table_name=name).one()
|
||||
|
||||
def get_database_by_id(self, db_id):
|
||||
return db.session.query(Database).filter_by(id=db_id).one()
|
||||
|
||||
def get_druid_ds_by_name(self, name):
|
||||
return db.session.query(DruidDatasource).filter_by(
|
||||
datasource_name=name).first()
|
||||
|
||||
Reference in New Issue
Block a user