Skip to content
Snippets Groups Projects
Unverified Commit bb77136e authored by Simon Belak's avatar Simon Belak Committed by GitHub
Browse files

Merge pull request #8753 from metabase/column-metadata-skip-check-for-empty-name

Query results metadata: we don't need to check for empty names any more
parents 611e7216 91520fa3
No related branches found
No related tags found
No related merge requests found
......@@ -71,24 +71,16 @@
(redux/post-complete
(redux/juxt
(apply f/col-wise (for [metadata result-metadata]
(if (and (seq (:name metadata))
(nil? (:fingerprint metadata)))
(if-not (:fingerprint metadata)
(f/fingerprinter metadata)
(f/constant-fingerprinter (:fingerprint metadata)))))
(insights/insights result-metadata))
(fn [[fingerprints insights]]
;; Rarely certain queries will return columns with no names. For example
;; `SELECT COUNT(*)` in SQL Server seems to come back with no name. Since we
;; can't use those as field literals in subsequent queries just filter them out
{:metadata (->> (map (fn [fingerprint metadata]
(cond
(instance? Throwable fingerprint)
metadata
(not-empty (:name metadata))
(assoc metadata :fingerprint fingerprint)))
fingerprints
result-metadata)
(remove nil?))
{:metadata (map (fn [fingerprint metadata]
(if (instance? Throwable fingerprint)
metadata
(assoc metadata :fingerprint fingerprint)))
fingerprints
result-metadata)
:insights insights}))
(:rows results))))
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