<commit_before>(ns metabase.api.qs
  (:require [clojure.data.csv :as csv]
            [compojure.core :refer [defroutes GET POST]]
            [metabase.api.common :refer :all]
            [metabase.db :refer :all]
            [metabase.driver :as driver]
            (metabase.models [database :refer [Database]]
                             [hydrate :refer :all]
                             [query-execution :refer [QueryExecution all-fields build-response]])
            [metabase.util :refer [contains-many? now-iso8601]]))


(declare execute-query build-response)


(defendpoint POST "/" [:as {{:keys [timezone database sql] :as body} :body}]
  (require-params database sql)
  (read-check Database database)
  (let [dataset-query {:type "native"
                       :database database
                       :native {:query sql
                                :timezone timezone}}
        options {:executed_by *current-user-id*<commit_msg>we no longer need to declare 'build-response' in qs.clj<commit_after>(ns metabase.api.qs
  (:require [clojure.data.csv :as csv]
            [compojure.core :refer [defroutes GET POST]]
            [metabase.api.common :refer :all]
            [metabase.db :refer :all]
            [metabase.driver :as driver]
            (metabase.models [database :refer [Database]]
                             [hydrate :refer :all]
                             [query-execution :refer [QueryExecution all-fields build-response]])
            [metabase.util :refer [contains-many? now-iso8601]]))


(declare execute-query)


(defendpoint POST "/" [:as {{:keys [timezone database sql] :as body} :body}]
  (require-params database sql)
  (read-check Database database)
  (let [dataset-query {:type "native"
                       :database database
                       :native {:query sql
                                :timezone timezone}}
        options {:executed_by *current-user-id*
{'fraction_non_alphanumeric': 0.11688311688311688, 'fraction_numerical': 0.004155844155844156, 'mean_word_length': 1.9585253456221199, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3184493', 'n_tokens_mistral': 560, 'n_tokens_neox': 541, 'n_words': 144}