       (apply-transformation {:type :transformation
                              :transformation
                              (gen-transformation :core/derive
-                                                 {:akvo.lumen.specs.transformation.derive/newColumnTitle "Derived 4"
-                                                  :akvo.lumen.specs.transformation.derive/code "row['foo'].toUpperCase()"
-                                                  :akvo.lumen.specs.transformation.derive/newColumnType "text"
-                                                  :akvo.lumen.specs.transformation.engine/onError "leave-empty"})})
+                                                 {::transformation.derive.s/newColumnTitle "Derived 4"
+                                                  ::transformation.derive.s/code "row['foo'].toUpperCase()"
+                                                  ::transformation.derive.s/newColumnType "text"
+                                                  ::transformation.engine.s/onError "leave-empty"})})
       (is (= ["A" "B" nil] (map :d2 (latest-data dataset-id))))
 
       (apply-transformation {:type :transformation
                              :transformation
                              (gen-transformation :core/derive
-                                                 {:akvo.lumen.specs.transformation.derive/newColumnTitle "Derived 5"
-                                                  :akvo.lumen.specs.transformation.derive/code "row['Derived 4'].toLowerCase()"
-                                                  :akvo.lumen.specs.transformation.derive/newColumnType "text"
-                                                  :akvo.lumen.specs.transformation.engine/onError "leave-empty"})})
+                                                 {::transformation.derive.s/newColumnTitle "Derived 5"
+                                                  ::transformation.derive.s/code "row['Derived 4'].toLowerCase()"
+                                                  ::transformation.derive.s/newColumnType "text"
+                                                  ::transformation.engine.s/onError "leave-empty"})})
       (is (= ["a" "b" nil] (map :d3 (latest-data dataset-id)))))
 
     (testing "Date transform"
       (let [[tag _] (apply-transformation {:type :transformation
                                            :transformation
                                            (gen-transformation :core/derive
-                                                               {:akvo.lumen.specs.transformation.derive/newColumnTitle "Derived 5"
-                                                                :akvo.lumen.specs.transformation.derive/code "new Date()"
-                                                                :akvo.lumen.specs.transformation.derive/newColumnType "date"
-                                                                :akvo.lumen.specs.transformation.engine/onError "fail"})})]
+                                                               {::transformation.derive.s/newColumnTitle "Derived 5"
+                                                                ::transformation.derive.s/code "new Date()"
+                                                                ::transformation.derive.s/newColumnType "date"
+                                                                ::transformation.engine.s/onError "fail"})})]
         (is (= tag ::lib/ok))
         (is (every? number? (map :d4 (latest-data dataset-id))))))
 

        apply-transformation (partial transformation/apply {:tenant-conn *tenant-conn*} dataset-id)]
    (is (= ::lib/ok (first (apply-transformation {:type :undo}))))
    (let [[tag _] (do (apply-transformation {:type :transformation
                                             :transformation
                                             (gen-transformation :core/to-lowercase
                                                                 {:akvo.lumen.specs.db.dataset-version.column/columnName "c1"
                                                                  :akvo.lumen.specs.transformation.engine/onError "fail"})})
                      (apply-transformation {:type :transformation
                                             :transformation
                                             (gen-transformation :core/change-datatype
                                                                 {:akvo.lumen.specs.db.dataset-version.column/columnName "c5"
                                                                  :akvo.lumen.specs.transformation.engine/onError "default-value"
                                                                  :akvo.lumen.specs.transformation.change-datatype/newType "number"
                                                                  :akvo.lumen.specs.transformation.change-datatype/defaultValue 0})})
                      (apply-transformation {:type :undo}))]
      (is (= ::lib/ok tag))
      (is (not (:exists (table-exists *tenant-conn* {:table-name previous-table-name}))))

        (is (= years-slash (map (comp tcc/from-long :c3) table-data)))
        (is (= years-hiphen (map (comp tcc/from-long :c4) table-data)))))))

(deftest ^:functional derived-column-test
  (let [change-datatype-transformation (fn [column-name]
                                         {:type :transformation
                                          :transformation
                                          (-> (gen-transformation
                                               :core/change-datatype {::db.dataset-version.column.s/columnName "column-name"
                                                                      ::transformation.change-datatype.s/newType "number"
                                                                      ::transformation.engine.s/onError "default-value"})
                                              (assoc-in ["args" "defaultValue"] nil))})
        dataset-id (import-file *tenant-conn* *error-tracker* {:has-column-headers? true
                                                               :file "derived-column.csv"})
        apply-transformation (partial transformation/apply {:tenant-conn *tenant-conn*} dataset-id)]
    (do (apply-transformation (change-datatype-transformation "c2"))
