Skip to content
Snippets Groups Projects
Unverified Commit 606686c3 authored by Alexander Polyankin's avatar Alexander Polyankin Committed by GitHub
Browse files

Use is-empty and not-empty for string columns in quick filter drill (#42804)

parent 43084103
Branches
Tags
No related merge requests found
......@@ -65,8 +65,11 @@
[]
(= value :null)
[{:name "=" :filter (operator :is-null field-ref)}
{:name "≠" :filter (operator :not-null field-ref)}]
(for [[op label] (if (or (lib.types.isa/string? column) (lib.types.isa/string-like? column))
[[:is-empty "="] [:not-empty "≠"]]
[[:is-null "="] [:not-null "≠"]])]
{:name label
:filter (operator op field-ref)})
(or (lib.types.isa/numeric? column)
(lib.types.isa/temporal? column))
......
......@@ -139,6 +139,21 @@
:operators [{:name "="}
{:name "≠"}]}})))
(deftest ^:parallel returns-quick-filter-test-10
(testing "quick-filter should use is-empty and not-empty operators for string columns (#41783)"
(lib.drill-thru.tu/test-returns-drill
{:drill-type :drill-thru/quick-filter
:click-type :cell
:query-type :unaggregated
:query-table "PRODUCTS"
:column-name "TITLE"
:custom-row (assoc (get-in lib.drill-thru.tu/test-queries ["PRODUCTS" :unaggregated :row])
"TITLE" nil)
:expected {:type :drill-thru/quick-filter
:value :null
:operators [{:name "=", :filter [:is-empty {} [:field {} (meta/id :products :title)]]}
{:name "≠", :filter [:not-empty {} [:field {} (meta/id :products :title)]]}]}})))
(deftest ^:parallel apply-quick-filter-on-correct-level-test
(testing "quick-filter on an aggregation should introduce an new stage (#34346)"
(lib.drill-thru.tu/test-drill-application
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment