Skip to content
Snippets Groups Projects
Commit ecb8562c authored by Simon Belak's avatar Simon Belak Committed by Sameer Al-Sakran
Browse files

Fingerprinting: correctly handle datetimes that are also FKs (#10621)

parent b4bc2bd6
Branches
Tags
No related merge requests found
......@@ -85,6 +85,7 @@
(prefer-method fingerprinter [:type/* :type/PK] [:type/Number :type/*])
(prefer-method fingerprinter [:type/* :type/PK] [:type/Text :type/*])
(prefer-method fingerprinter [:type/DateTime :type/*] [:type/* :type/PK])
(prefer-method fingerprinter [:type/DateTime :type/*] [:type/* :type/FK])
(defn- with-global-fingerprinter
[fingerprinter]
......
......@@ -13,6 +13,17 @@
(fingerprinter (field/map->FieldInstance {:base_type :type/DateTime}))
[#inst "2013" #inst "2018" #inst "2015"]))
;; Correctly disambiguate multiple competing multimethods
(expect
{:global {:distinct-count 3
:nil% 0.0}
:type {:type/DateTime {:earliest (du/date->iso-8601 #inst "2013")
:latest (du/date->iso-8601 #inst "2018")}}}
(transduce identity
(fingerprinter (field/map->FieldInstance {:base_type :type/DateTime
:special_type :type/FK}))
[#inst "2013" #inst "2018" #inst "2015"]))
(expect
{:global {:distinct-count 1
:nil% 1.0}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment