Skip to content

Commit

Permalink
use enum value to ensure case sensitive value is used
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro committed Sep 21, 2020
1 parent 9526ef2 commit 8aced2a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 8aced2a

Please sign in to comment.