mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
fix: IS NULL filter operator for numeric columns (#13496)
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import re
|
||||
|
||||
import pytest
|
||||
|
||||
from superset import db
|
||||
@@ -305,8 +307,15 @@ class TestQueryContext(SupersetTestCase):
|
||||
assert len(responses) == 1
|
||||
response = responses["queries"][0]
|
||||
assert len(response) == 2
|
||||
sql_text = response["query"]
|
||||
assert response["language"] == "sql"
|
||||
assert "SELECT" in response["query"]
|
||||
assert "SELECT" in sql_text
|
||||
assert re.search(r'[`"\[]?num[`"\]]? IS NOT NULL', sql_text)
|
||||
assert re.search(
|
||||
r"""NOT \([`"\[]?name[`"\]]? IS NULL[\s\n]* """
|
||||
r"""OR [`"\[]?name[`"\]]? IN \('abc'\)\)""",
|
||||
sql_text,
|
||||
)
|
||||
|
||||
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
|
||||
def test_fetch_values_predicate_in_query(self):
|
||||
|
||||
Reference in New Issue
Block a user