Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro committed Nov 12, 2021
1 parent 53c5bf5 commit 5c1cf7f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
5 changes: 3 additions & 2 deletions superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -938,8 +938,9 @@ def _get_sqla_row_level_filters(
filters_grouped: Dict[Union[int, str], List[str]] = defaultdict(list)
try:
for filter_ in security_manager.get_rls_filters(self):
rendered_filter = template_processor.process_template(filter_.clause)
clause = text(f"({rendered_filter})")
clause = text(
f"({template_processor.process_template(filter_.clause)})"
)
filters_grouped[filter_.group_key or filter_.id].append(clause)
return [or_(*clauses) for clauses in filters_grouped.values()]
except TemplateError as ex:
Expand Down
3 changes: 0 additions & 3 deletions superset/utils/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
from sqlalchemy.dialects.mysql import MEDIUMTEXT
from sqlalchemy.engine import Connection, Engine
from sqlalchemy.engine.reflection import Inspector
from sqlalchemy.sql.elements import TextClause
from sqlalchemy.sql.type_api import Variant
from sqlalchemy.types import TEXT, TypeDecorator, TypeEngine
from typing_extensions import TypedDict, TypeGuard
Expand Down Expand Up @@ -132,8 +131,6 @@

InputType = TypeVar("InputType")

BIND_PARAM_REGEX = TextClause._bind_params_regex # pylint: disable=protected-access


class LenientEnum(Enum):
"""Enums with a `get` method that convert a enum value to `Enum` if it is a
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/charts/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2079,7 +2079,7 @@ def test_chart_data_virtual_table_with_colons(self):
rv = self.post_assert_metric(CHART_DATA_URI, request_payload, "data")
db.session.delete(table)
db.session.commit()
self.assertEqual(rv.status_code, 200)
assert rv.status_code == 200
response_payload = json.loads(rv.data.decode("utf-8"))
result = response_payload["result"][0]
data = result["data"]
Expand Down

0 comments on commit 5c1cf7f

Please sign in to comment.