From 8aced2a86aae4f3a1628e90b317c5c78eb64c1ea Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Mon, 21 Sep 2020 19:49:41 +0300 Subject: [PATCH] use enum value to ensure case sensitive value is used --- superset/connectors/sqla/models.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/superset/connectors/sqla/models.py b/superset/connectors/sqla/models.py index 293d07110e2d4..49663d21421ab 100644 --- a/superset/connectors/sqla/models.py +++ b/superset/connectors/sqla/models.py @@ -93,8 +93,8 @@ class MetadataResult: class AnnotationDatasource(BaseDatasource): - """ Dummy object so we can query annotations using 'Viz' objects just like - regular datasources. + """Dummy object so we can query annotations using 'Viz' objects just like + regular datasources. """ cache_timeout = 0 @@ -1375,9 +1375,9 @@ def import_obj( ) -> int: """Imports the datasource from the object to the database. - Metrics and columns and datasource will be overrided if exists. - This function can be used to import/export dashboards between multiple - superset instances. Audit metadata isn't copies over. + Metrics and columns and datasource will be overrided if exists. + This function can be used to import/export dashboards between multiple + superset instances. Audit metadata isn't copies over. """ def lookup_sqlatable(table_: "SqlaTable") -> "SqlaTable": @@ -1510,7 +1510,9 @@ class RowLevelSecurityFilter(Model, AuditMixinNullable): __tablename__ = "row_level_security_filters" id = Column(Integer, primary_key=True) - filter_type = Column(Enum(utils.RowLevelSecurityFilterType)) + filter_type = Column( + Enum(*[filter_type.value for filter_type in utils.RowLevelSecurityFilterType]) + ) group_key = Column(String(255), nullable=True) roles = relationship( security_manager.role_model,