 (defn do-import
   "Import runs within a future and since this is not taking part of ring
   request / response cycle we need to make sure to capture errors."
-  [conn {:keys [sentry-backend-dsn] :as config} error-tracker job-execution-id claims data-source]
+  [conn {:keys [sentry-backend-dsn] :as config} error-tracker job-execution-id claims]
   (let [table-name (util/gen-table-name "ds")]
     (try
       (let [spec (:spec (data-source-spec-by-job-execution-id conn {:job-execution-id job-execution-id}))]

                                     :spec (json/generate-string data-source)})
    (insert-job-execution tenant-conn {:id job-execution-id
                                       :data-source-id data-source-id})
    (future (do-import tenant-conn config error-tracker job-execution-id claims data-source))
    (lib/ok {"importId" job-execution-id
             "kind" kind})))

(hugsql/def-db-fns "akvo/lumen/lib/dataset.sql")
(hugsql/def-db-fns "akvo/lumen/lib/transformation.sql")

(defn- successful-import [conn job-execution-id table-name columns spec claims]
  (let [dataset-id (util/squuid)
        imported-table-name (util/gen-table-name "imported")]
    (insert-dataset conn {:id dataset-id
