                                         {:rnum 1
                                          :column-name "c1"
                                          :table-name table-name})))))
-      (apply {:type :undo})
+      (apply-transformation {:type :undo})
       (let [table-name (:table-name
                         (latest-dataset-version-by-dataset-id test-conn
                                                               {:dataset-id dataset-id}))]


(deftest ^:functional rename-column-test
  (let [dataset-id (import-file "dates.csv" {:has-column-headers? true})
        apply (partial tf/apply test-conn dataset-id)]
    (let [[tag _] (apply {:type :transformation
                          :transformation {"op" "core/rename-column"
                                           "args" {"columnName" "c2"
                                                   "newColumnTitle" "New Title"}
                                           "onError" "fail"}})]
      (is (= ::lib/ok tag))
      (let [{:keys [columns transformations]} (latest-dataset-version-by-dataset-id test-conn
                                                                                    {:dataset-id dataset-id})]

  (let [dataset-id (import-file "GDP.csv" {:dataset-name "GDP Undo Test"})
        {previous-table-name :table-name} (latest-dataset-version-by-dataset-id test-conn
                                                                                {:dataset-id dataset-id})
        apply-transformation (partial tf/apply test-conn dataset-id)]
    (is (= ::lib/ok (first (apply-transformation {:type :undo}))))
    (let [[tag _] (do (apply-transformation {:type :transformation
                                             :transformation {"op" "core/to-lowercase"
                                                              "args" {"columnName" "c1"}
                                                              "onError" "fail"}})
                      (apply-transformation {:type :transformation
                                             :transformation {"op" "core/change-datatype"
                                                              "args" {"columnName" "c5"
                                                                      "newType" "number"
                                                                      "defaultValue" 0}
                                                              "onError" "default-value"}})
                      (apply-transformation {:type :undo}))]
      (is (= ::lib/ok tag))
      (is (not (:exists (table-exists test-conn {:table-name previous-table-name}))))
      (is (= (:columns (dataset-version-by-dataset-id test-conn
