Closed tangrammer closed 3 years ago
Working in data migration i found this line
https://github.com/akvo/akvo-lumen/blob/master/backend/src/akvo/lumen/lib/transformation/merge_datasets.clj#L171-L180
columns-by-group (->> (set (get source "mergeColumns")) (map-indexed (fn [i column-name] (let [dg (engine/datagroup-by-column data-groups column-name) column (first (filter #(= (get % "columnName") column-name) (:columns dg)))] (-> column (assoc "sourceColumnName" (get column "columnName") "columnName" (engine/derivation-column-name (+ (engine/next-column-index target-dataset-columns) i))) reset-column-values)))) (group-by #(get % "groupId")))
and due to this set call in (set (get source "mergeColumns") we are loosing payload order and getting derived ids based on this random collection order
set
(set (get source "mergeColumns")
remove this set call that seems to be unnecessary
BTW: this bug will make visualisations fails thus referenced derived columns are going to change after an update
Context
Working in data migration i found this line
https://github.com/akvo/akvo-lumen/blob/master/backend/src/akvo/lumen/lib/transformation/merge_datasets.clj#L171-L180
and due to this
set
call in(set (get source "mergeColumns")
we are loosing payload order and getting derived ids based on this random collection orderSolution or next step
remove this
set
call that seems to be unnecessary