<commit_before>(ns akvo.lumen.test-utils
  (:require [akvo.lumen.component.tenant-manager :refer [pool]]
            [akvo.lumen.lib.import :as import]
            [akvo.lumen.lib.import.clj-data-importer]
            [akvo.lumen.lib.update :as update]
            [akvo.lumen.postgres]
            [akvo.lumen.lib.transformation.engine :refer (new-dataset-version)]
            [akvo.lumen.specs.transformation]
            [robert.hooke :refer (add-hook) :as r]
            [akvo.lumen.util :refer [squuid] :as util ]
            [clojure.edn :as edn]
            [clojure.java.io :as io]
            [clojure.set :as set]
            [clojure.spec.alpha :as s]
            [clojure.spec.test.alpha :as stest]
            [clojure.test :as t]
            [clojure.tools.logging :as log]
            [clojure.walk :refer (keywordize-keys)]
            [diehard.core :as dh]
            [hugsql.core :as hugsql]))

(defn dataset-version-spec-adapter
  "provisional spec adapter function to be removed when specs work was finished"
  [dsv]
  (letfn [(>mult [i]
            (-> i
                (update :multipleType keyword)
                (set/rename-keys {:multipleType :multiple-type
                                  :multipleId :multiple-id})))]
    (-> (keywordize-keys dsv)
        (update :columns #(mapv (fn [e]
                                  (cond-> e
                                    true keywordize-keys
                                    true (update :type keyword)<commit_msg>Remove redundant call to keywordize-keys<commit_after>(ns akvo.lumen.test-utils
  (:require [akvo.lumen.component.tenant-manager :refer [pool]]
            [akvo.lumen.lib.import :as import]
            [akvo.lumen.lib.import.clj-data-importer]
            [akvo.lumen.lib.update :as update]
            [akvo.lumen.postgres]
            [akvo.lumen.lib.transformation.engine :refer (new-dataset-version)]
            [akvo.lumen.specs.transformation]
            [robert.hooke :refer (add-hook) :as r]
            [akvo.lumen.util :refer [squuid] :as util ]
            [clojure.edn :as edn]
            [clojure.java.io :as io]
            [clojure.set :as set]
            [clojure.spec.alpha :as s]
            [clojure.spec.test.alpha :as stest]
            [clojure.test :as t]
            [clojure.tools.logging :as log]
            [clojure.walk :refer (keywordize-keys)]
            [diehard.core :as dh]
            [hugsql.core :as hugsql]))

(defn dataset-version-spec-adapter
  "provisional spec adapter function to be removed when specs work was finished"
  [dsv]
  (letfn [(>mult [i]
            (-> i
                (update :multipleType keyword)
                (set/rename-keys {:multipleType :multiple-type
                                  :multipleId :multiple-id})))]
    (-> (keywordize-keys dsv)
        (update :columns #(mapv (fn [e]
                                  (cond-> e
                                    true (update :type keyword)
{'fraction_non_alphanumeric': 0.12070128118678354, 'fraction_numerical': 0.0, 'mean_word_length': 1.6094986807387863, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7644367', 'n_tokens_mistral': 943, 'n_tokens_neox': 930, 'n_words': 201}