Skip to content
Snippets Groups Projects
Unverified Commit bcff4138 authored by Braden Shepherdson's avatar Braden Shepherdson Committed by GitHub
Browse files

[QP] Test `:results_metadata` disambiguates column names eg. `ID_2` (#45109)

This makes the names inconsistent with what's in `data.cols` on the same
API response(!) but consistent with what MBQL lib will return.
parent 6fe489a1
No related branches found
No related tags found
No related merge requests found
......@@ -377,3 +377,15 @@
(is (=? {:status :completed
:data {:results_metadata (symbol "nil #_\"key is not present.\"")}}
(qp/process-query (assoc-in query [:middleware :skip-results-metadata?] true))))))
(deftest ^:parallel results-metadata-disambiguated-field-names-test
(let [query (mt/mbql-query orders {:joins [{:source-table $$products
:alias "Products"
:condition [:= $product_id &Products.products.id]
:fields [&Products.$products.id]}]
:fields [$id]
:limit 5})]
(is (=? {:status :completed
:data {:results_metadata {:columns [{:name "ID"}
{:name "ID_2"}]}}}
(mt/process-query query)))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment