     (if-let [transformation (first transformations)]
       (let [columns (reduce into [] (map :columns data-groups))
             transformation       (adapt-transformation transformation old-columns columns)
-            data-group (data-group-by-tx transformation data-groups)
+            data-group (data-group-by-op transformation data-groups)
             avoid-tranformation? (let [t (w/keywordize-keys transformation)]
                                    (and
                                     (avoidable-if-missing? t)

  4. separate transformation data-group columns from the others"
  [{:keys [tenant-conn] :as deps}
   {:keys [transformation data-groups data-group]}]
  (let [data-group (or data-group (data-group-by-tx transformation data-groups))
        source-table (:table-name data-group)
        other-dgs-columns (reduce (fn [c dg] (if (= (:id dg) (:id data-group))
                                               c (into c (:columns dg)))) [] data-groups)

    (throw (ex-info "Failed to transform. Transformation can't have columns from more than one data-group specified"
                    {:transformation transformation}))))

(defn data-group-by-op [transformation data-groups]
  (let [columns-in-transformation (columns-used (w/keywordize-keys transformation) (reduce into [] (map :columns data-groups)))
        _  (ensure-one-data-group-related transformation columns-in-transformation data-groups)
        column-name (first columns-in-transformation)]
