mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix(Explore): Apply RLS at column values (#30490)
Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
This commit is contained in:
@@ -626,6 +626,32 @@ def test_values_for_column_on_text_column(text_column_table):
|
||||
assert len(with_null) == 8
|
||||
|
||||
|
||||
def test_values_for_column_on_text_column_with_rls(text_column_table):
|
||||
with patch.object(
|
||||
text_column_table,
|
||||
"get_sqla_row_level_filters",
|
||||
return_value=[
|
||||
TextClause("foo = 'foo'"),
|
||||
],
|
||||
):
|
||||
with_rls = text_column_table.values_for_column(column_name="foo", limit=10000)
|
||||
assert with_rls == ["foo"]
|
||||
assert len(with_rls) == 1
|
||||
|
||||
|
||||
def test_values_for_column_on_text_column_with_rls_no_values(text_column_table):
|
||||
with patch.object(
|
||||
text_column_table,
|
||||
"get_sqla_row_level_filters",
|
||||
return_value=[
|
||||
TextClause("foo = 'bar'"),
|
||||
],
|
||||
):
|
||||
with_rls = text_column_table.values_for_column(column_name="foo", limit=10000)
|
||||
assert with_rls == []
|
||||
assert len(with_rls) == 0
|
||||
|
||||
|
||||
def test_filter_on_text_column(text_column_table):
|
||||
table = text_column_table
|
||||
# null value should be replaced
|
||||
|
||||
Reference in New Issue
Block a user