diff --git a/.codespellignore b/.codespellignore index 6dec1cec4d5..63528ca9d43 100644 --- a/.codespellignore +++ b/.codespellignore @@ -4,6 +4,8 @@ altho Brite cancelation cancelations +caracteres +copyin datas edn eduction @@ -13,6 +15,7 @@ horizontalX horizontalY juxt methodd +nd notIn optionA ot @@ -29,3 +32,4 @@ trsn tru trun unparseable +withs diff --git a/.codespellrc b/.codespellrc index 4e9ce2de96e..84cdf794318 100644 --- a/.codespellrc +++ b/.codespellrc @@ -19,4 +19,6 @@ skip = frontend/src/metabase/visualizations/lib/mapping_codes.ts, frontend/*/mocks/*, modules/drivers/mongo/src/metabase/driver/mongo/operators.clj, + src/metabase/analyze/classifiers/name.clj, + src/metabase/util/currency.cljc, ignore-words = .codespellignore diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 91a4346cb55..a022741a34a 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -20,3 +20,4 @@ jobs: enterprise frontend modules/drivers + src diff --git a/mage/src/mage/codespell.clj b/mage/src/mage/codespell.clj index 2b39174d8a7..71408199159 100644 --- a/mage/src/mage/codespell.clj +++ b/mage/src/mage/codespell.clj @@ -12,7 +12,7 @@ "enterprise" "frontend" "modules/drivers" - #_"src" + "src" #_"test"]) (defn codespell [_cli-args] diff --git a/src/metabase/actions/http_action.clj b/src/metabase/actions/http_action.clj index 5b28b3c1c65..97e0790e5d9 100644 --- a/src/metabase/actions/http_action.clj +++ b/src/metabase/actions/http_action.clj @@ -102,7 +102,7 @@ (defn apply-json-query "Executes a jq query on [[object]]." [object jq-query] - ;; TODO this is pretty ineficient. We parse with `:as :json`, then reencode within a response + ;; TODO this is pretty inefficient. We parse with `:as :json`, then re-encode within a response ;; I couldn't find a way to get JSONNode out of cheshire, so we fall back to jackson. ;; Should jackson be added explicitly to deps.edn? (let [json-node (.readTree ^ObjectMapper @object-mapper (json/encode object)) diff --git a/src/metabase/activity_feed/api.clj b/src/metabase/activity_feed/api.clj index 9656d12d635..c8c957a4b79 100644 --- a/src/metabase/activity_feed/api.clj +++ b/src/metabase/activity_feed/api.clj @@ -217,7 +217,7 @@ ;; NOTE: the query implementation `views-and-runs` has an order-by clause using most recent timestamp ;; this has an effect on the outcomes. Consider an item with a massively high viewcount but a last view by the user - ;; a long time ago. This may not even make it into the firs 10 items from the query, even though it might be worth showing + ;; a long time ago. This may not even make it into the first 10 items from the query, even though it might be worth showing (when-not (zero? max-count) (* (/ cnt max-count) views-wt))])] (assoc item :score (double (reduce + scores))))) items)))) diff --git a/src/metabase/activity_feed/models/recent_views.clj b/src/metabase/activity_feed/models/recent_views.clj index 6f57e5ae795..5311cb052e2 100644 --- a/src/metabase/activity_feed/models/recent_views.clj +++ b/src/metabase/activity_feed/models/recent_views.clj @@ -604,7 +604,7 @@ Returns: [:map [:recents [:sequential Item]]] - [[do-query]] can return nils, and we remove them here becuase there can be recent views for deleted entities, and we + [[do-query]] can return nils, and we remove them here because there can be recent views for deleted entities, and we don't want to show those in the recent views. Options: diff --git a/src/metabase/analytics/prometheus.clj b/src/metabase/analytics/prometheus.clj index 6ad8ae8798e..48823a9f772 100644 --- a/src/metabase/analytics/prometheus.clj +++ b/src/metabase/analytics/prometheus.clj @@ -208,13 +208,13 @@ (prometheus/gauge :jetty/dispatched-active {:description "Number of active requests being handled"}) (prometheus/gauge :jetty/dispatched-active-max - {:descrption "Maximum number of active requests handled"}) + {:description "Maximum number of active requests handled"}) (prometheus/gauge :jetty/dispatched-time-max {:description "Maximum time spent dispatching a request"}) (prometheus/counter :jetty/dispatched-time-seconds-total - {:descrption "Total time spent handling requests"}) + {:description "Total time spent handling requests"}) (prometheus/counter :jetty/async-requests-total - {:descrption "Totql number of async requests"}) + {:description "Total number of async requests"}) (prometheus/gauge :jetty/async-requests-waiting {:description "Currently waiting async requests"}) (prometheus/gauge :jetty/async-requests-waiting-max @@ -222,9 +222,9 @@ (prometheus/counter :jetty/async-dispatches-total {:description "Number of requests that have been asynchronously dispatched"}) (prometheus/counter :jetty/expires-total - {:descpription "Number of async requests that have expired"}) + {:description "Number of async requests that have expired"}) (prometheus/counter :jetty/responses-total - {:descrption "Total response grouped by status code" + {:description "Total response grouped by status code" :labels [:code]}) (prometheus/counter :jetty/responses-bytes-total {:description "Total number of bytes across all responses"})]) diff --git a/src/metabase/analytics/quartz.clj b/src/metabase/analytics/quartz.clj index 567e3d36fa1..95b25c59699 100644 --- a/src/metabase/analytics/quartz.clj +++ b/src/metabase/analytics/quartz.clj @@ -17,7 +17,7 @@ ;; +----------------------------------------------------------------------------------------------------------------+ (defn create-job-execution-listener - "Creates an instance of an anonymous JobListener to record exeuction metrics to prometheus." + "Creates an instance of an anonymous JobListener to record execution metrics to prometheus." ^JobListener [] ; No registry argument needed (reify JobListener (getName [_] diff --git a/src/metabase/analyze/classifiers/name.clj b/src/metabase/analyze/classifiers/name.clj index 82943e594a5..8f74c9752bf 100644 --- a/src/metabase/analyze/classifiers/name.clj +++ b/src/metabase/analyze/classifiers/name.clj @@ -141,7 +141,7 @@ ::analyze.schema/qp-results-cased-map]) (mu/defn infer-semantic-type-by-name :- [:maybe :keyword] - "Classifer that infers the semantic type of a `field` based on its name and base type." + "Classifier that infers the semantic type of a `field` based on its name and base type." [field-or-column :- FieldOrColumn] ;; Don't overwrite keys, else we're ok with overwriting as a new more precise type might have ;; been added. @@ -182,7 +182,7 @@ [(prefix-or-postfix "vendor") :entity/CompanyTable]]) (mu/defn infer-entity-type-by-name :- analyze.schema/Table - "Classifer that infers the semantic type of a `table` based on its name." + "Classifier that infers the semantic type of a `table` based on its name." [table :- analyze.schema/Table] (let [table-name (-> table :name u/lower-case-en)] (assoc table :entity_type (or (some (fn [[pattern type]] diff --git a/src/metabase/analyze/fingerprint/fingerprinters.clj b/src/metabase/analyze/fingerprint/fingerprinters.clj index 19984f2c632..8fe350f2725 100644 --- a/src/metabase/analyze/fingerprint/fingerprinters.clj +++ b/src/metabase/analyze/fingerprint/fingerprinters.clj @@ -253,7 +253,7 @@ Boolean (->number [this] (if this 1 0)) Number (->number [this] this) String (->number [this] - ;; faster to be optimistic and fail than to explicitely test and dispatch + ;; faster to be optimistic and fail than to explicitly test and dispatch (or (parse-long this) (parse-double this)))) diff --git a/src/metabase/analyze/fingerprint/insights.clj b/src/metabase/analyze/fingerprint/insights.clj index 30a585942b5..781a5afff85 100644 --- a/src/metabase/analyze/fingerprint/insights.clj +++ b/src/metabase/analyze/fingerprint/insights.clj @@ -289,7 +289,7 @@ (sync-util/name-for-logging (mi/instance :model/Field datetime)))))) (defn insights - "Based on the shape of returned data construct a transducer to statistically analyize data." + "Based on the shape of returned data construct a transducer to statistically analyze data." [cols] (let [cols-by-type (->> cols (map-indexed (fn [idx col] diff --git a/src/metabase/analyze/query_results.clj b/src/metabase/analyze/query_results.clj index 836e4e0bdf0..cfbee6872f1 100644 --- a/src/metabase/analyze/query_results.clj +++ b/src/metabase/analyze/query_results.clj @@ -35,7 +35,7 @@ col :semantic_type (fn [original-value] - ;; If we already know the semantic type, becouse it is stored, don't classify again, but try to refine semantic + ;; If we already know the semantic type, because it is stored, don't classify again, but try to refine semantic ;; type set upstream for aggregation cols (which come back as :type/Number). (case original-value (nil :type/Number) (classifiers.name/infer-semantic-type-by-name col) diff --git a/src/metabase/api/common.clj b/src/metabase/api/common.clj index 98140f2847a..cdd2685b9f9 100644 --- a/src/metabase/api/common.clj +++ b/src/metabase/api/common.clj @@ -36,13 +36,13 @@ ;; ;;
;; -;; ## How does defendpoint coersion work? +;; ## How does defendpoint coercion work? ;; ;; The `defendpoint` macro uses the schemas to generate code which binds args to their decoded values. Values are ;; decoded by their corresponding malli schema. n.b.: Only symbols in the arg->schema map will be coerced; unmentioned ;; aliases will not be bound. ;; -;; The exact coersion function [[mc/decode]], uses the [[metabase.api.macros/decode-transformer]], +;; The exact coercion function [[mc/decode]], uses the [[metabase.api.macros/decode-transformer]], ;; and gets called with the schema, value, and transformer. see: https://github.com/metosin/malli#value-transformation ;; for more details ;; diff --git a/src/metabase/api/macros.clj b/src/metabase/api/macros.clj index 24d082f78c2..195fe4009b2 100644 --- a/src/metabase/api/macros.clj +++ b/src/metabase/api/macros.clj @@ -80,7 +80,7 @@ ;;; having two routes with the same method and param that only differ by regex patterns. It makes using this stuff more ;;; annoying (mr/def ::unique-key - "Unique indentifier for an api endpoint. `(:api/endpoints (meta a-namespace))` is a map of `::unique-key` => `::info`" + "Unique identifier for an api endpoint. `(:api/endpoints (meta a-namespace))` is a map of `::unique-key` => `::info`" [:tuple #_method ::method #_route string? diff --git a/src/metabase/api/macros/defendpoint/open_api.clj b/src/metabase/api/macros/defendpoint/open_api.clj index fa08bfdfad6..9b421a43a62 100644 --- a/src/metabase/api/macros/defendpoint/open_api.clj +++ b/src/metabase/api/macros/defendpoint/open_api.clj @@ -91,7 +91,7 @@ e))))) (defn- mjs-collect-definitions - "We transform json-schema in a few different places, but we need to collect all defitions in a single one." + "We transform json-schema in a few different places, but we need to collect all definitions in a single one." [malli-schema] (let [jss (mjs/transform malli-schema {::mjs/definitions-path "#/components/schemas/"})] (when *definitions* diff --git a/src/metabase/api/util.clj b/src/metabase/api/util.clj index ba1ed1fe85a..da38daea233 100644 --- a/src/metabase/api/util.clj +++ b/src/metabase/api/util.clj @@ -1,5 +1,5 @@ (ns metabase.api.util - "Random utilty endpoints for things that don't belong anywhere else in particular, e.g. endpoints for certain admin + "Random utility endpoints for things that don't belong anywhere else in particular, e.g. endpoints for certain admin page tasks." (:require [metabase.api.macros :as api.macros] diff --git a/src/metabase/app_db/cluster_lock.clj b/src/metabase/app_db/cluster_lock.clj index fda911b9764..ff5b7d0a0bb 100644 --- a/src/metabase/app_db/cluster_lock.clj +++ b/src/metabase/app_db/cluster_lock.clj @@ -91,7 +91,7 @@ (throw e))))))) (defmacro with-cluster-lock - "Run `body` in a tranactions that tries to take a lock from the metabase_cluster_lock table of + "Run `body` in a transaction that tries to take a lock from the metabase_cluster_lock table of the specified name to coordinate concurrency with other metabase instances sharing the appdb." ([lock-options & body] `(do-with-cluster-lock ~lock-options (fn [] ~@body)))) diff --git a/src/metabase/app_db/connection_pool_setup.clj b/src/metabase/app_db/connection_pool_setup.clj index 56bb099a7ec..f36bc24ffac 100644 --- a/src/metabase/app_db/connection_pool_setup.clj +++ b/src/metabase/app_db/connection_pool_setup.clj @@ -93,7 +93,7 @@ "idleConnectionTestPeriod" 60 ;; - ;; The fully qualified class-name of an implememtation of the ConnectionCustomizer interface, which users can + ;; The fully qualified class-name of an implementation of the ConnectionCustomizer interface, which users can ;; implement to set up Connections when they are acquired from the database, or on check-out, and potentially to ;; clean things up on check-in and Connection destruction. If standard Connection properties (holdability, readOnly, ;; or transactionIsolation) are set in the ConnectionCustomizer's onAcquire() method, these will override the diff --git a/src/metabase/app_db/custom_migrations.clj b/src/metabase/app_db/custom_migrations.clj index bdaf6cd2944..58116b38bd7 100644 --- a/src/metabase/app_db/custom_migrations.clj +++ b/src/metabase/app_db/custom_migrations.clj @@ -914,7 +914,7 @@ (when (not= (raw-setting :ldap-sync-admin-group) "true") (remove-admin-group-from-mappings-by-setting-key! :ldap-group-mappings)) ;; sso are enterprise feature but we still run this even in OSS in case a customer - ;; have switched from enterprise -> SSO and stil have this mapping in Setting table + ;; have switched from enterprise -> SSO and still have this mapping in Setting table (remove-admin-group-from-mappings-by-setting-key! :jwt-group-mappings) (remove-admin-group-from-mappings-by-setting-key! :saml-group-mappings)) @@ -1334,7 +1334,7 @@ ;; when card display is area or bar, ;; 1. set the display key to :stackable.stack_display value OR leave it the same -;; 2. when series settings exist, remove the diplay key from each map in the series_settings list +;; 2. when series settings exist, remove the display key from each map in the series_settings list (defn- area-bar-stacked-viz-migration [{display :display viz :visualization_settings :as card}] diff --git a/src/metabase/app_db/env.clj b/src/metabase/app_db/env.clj index 91095315b76..b13acb40593 100644 --- a/src/metabase/app_db/env.clj +++ b/src/metabase/app_db/env.clj @@ -139,7 +139,7 @@ (env-defaults db-type))) (def env - "Metabase Datatbase environment. Used to setup *application-db* and audit-db for enterprise users." + "Metabase Database environment. Used to setup *application-db* and audit-db for enterprise users." (env* (config/config-kw :mb-db-type))) (def db-type diff --git a/src/metabase/app_db/jdbc_protocols.clj b/src/metabase/app_db/jdbc_protocols.clj index 11e816399a6..f2594ec6d3d 100644 --- a/src/metabase/app_db/jdbc_protocols.clj +++ b/src/metabase/app_db/jdbc_protocols.clj @@ -50,7 +50,7 @@ ;; Since MySQL TIMESTAMPs aren't timezone-aware this means comparisons are done between timestamps in the report ;; timezone and the local datetime portion of the parameter, in UTC. Bad! ;; - ;; Convert it to a LocalDateTime, in the report timezone, so comparisions will work correctly. + ;; Convert it to a LocalDateTime, in the report timezone, so comparisons will work correctly. ;; ;; See also — https://dev.mysql.com/doc/refman/5.5/en/datetime.html (let [offset (.. (t/zone-id) getRules (getOffset (t/instant t))) diff --git a/src/metabase/app_db/query_cancelation.clj b/src/metabase/app_db/query_cancelation.clj index 0cef91d624a..e66eaa0b59b 100644 --- a/src/metabase/app_db/query_cancelation.clj +++ b/src/metabase/app_db/query_cancelation.clj @@ -37,7 +37,7 @@ ;;; https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html ;;; ;;; MySQL can return 1317 and 3024, but 1969 is not an error code in the mysql reference. All of these codes make sense -;;; for MariaDB to return. Hibernate expects 3024, but in testing 1969 was observered. +;;; for MariaDB to return. Hibernate expects 3024, but in testing 1969 was observed. (defmethod query-canceled-exception?* :mysql [_db-type ^java.sql.SQLException e] ;; apparently there is no enum in the MariaDB JDBC driver for different error codes >:( diff --git a/src/metabase/audit_app/settings.clj b/src/metabase/audit_app/settings.clj index 669d0b6dbe6..68ce3c5c7bd 100644 --- a/src/metabase/audit_app/settings.clj +++ b/src/metabase/audit_app/settings.clj @@ -22,7 +22,7 @@ 720) (defn log-minimum-value-warning - "Logs a warning that the value for `audit-max-retention-days` is below the allowed minimum and will be overriden." + "Logs a warning that the value for `audit-max-retention-days` is below the allowed minimum and will be overridden." [env-var-value] (log/warnf "MB_AUDIT_MAX_RETENTION_DAYS is set to %d; using the minimum value of %d instead." env-var-value diff --git a/src/metabase/bookmarks/api.clj b/src/metabase/bookmarks/api.clj index 8af1912c7c3..b9ed1d1149e 100644 --- a/src/metabase/bookmarks/api.clj +++ b/src/metabase/bookmarks/api.clj @@ -17,7 +17,7 @@ ["card" "dashboard" "collection" "document"])) (def BookmarkOrderings - "Schema for an ordered of boomark orderings" + "Schema for an ordered of bookmark orderings" [:sequential [:map [:type Models] [:item_id ms/PositiveInt]]]) diff --git a/src/metabase/cache/settings.clj b/src/metabase/cache/settings.clj index cd3ddae7121..0a09840cba7 100644 --- a/src/metabase/cache/settings.clj +++ b/src/metabase/cache/settings.clj @@ -13,7 +13,7 @@ (def ^:private ^:const global-max-caching-kb "Although depending on the database, we can support much larger cached values (1GB for PG, 2GB for H2 and 4GB for - MySQL) we are not curretly setup to deal with data of that size. The datatypes we are using will hold this data in + MySQL) we are not currently setup to deal with data of that size. The datatypes we are using will hold this data in memory and will not truly be streaming. This is a global max in order to prevent our users from setting the caching value so high it becomes a performance issue. The value below represents 200MB" (* 200 1024)) diff --git a/src/metabase/channel/impl/http.clj b/src/metabase/channel/impl/http.clj index 097ee9bbfa6..9920ef11aea 100644 --- a/src/metabase/channel/impl/http.clj +++ b/src/metabase/channel/impl/http.clj @@ -74,7 +74,7 @@ true (catch Exception e (let [data (ex-data e)] - ;; throw an appriopriate error if it's a connection error + ;; throw an appropriate error if it's a connection error (if (= ::http/unexceptional-status (:type data)) (throw (ex-info (tru "Failed to connect to channel") {:request-status (:status data) :request-body (maybe-parse-json (:body data))})) diff --git a/src/metabase/channel/render/body.clj b/src/metabase/channel/render/body.clj index 8f66f0ca710..664be3bea7f 100644 --- a/src/metabase/channel/render/body.clj +++ b/src/metabase/channel/render/body.clj @@ -517,7 +517,7 @@ enabled? :enabled} funnel-viz :when enabled?] [k (get rows k)])) - ;; re-create the rows with the label/visibilty specified in the funnel-viz + ;; re-create the rows with the label/visibility specified in the funnel-viz (let [rows-data (map (fn [{k :key enabled? :enabled} [_ value]] (when enabled? [k value])) funnel-viz raw-rows)] diff --git a/src/metabase/channel/render/card.clj b/src/metabase/channel/render/card.clj index 4703d5c55a2..bdf8a24c09a 100644 --- a/src/metabase/channel/render/card.clj +++ b/src/metabase/channel/render/card.clj @@ -234,7 +234,7 @@ (:content (render-pulse-card :inline timezone-id card nil results options)))) (mu/defn render-pulse-section :- ::body/RenderedPartCard - "Render a single Card section of a Pulse to a Hiccup form (representating HTML)." + "Render a single Card section of a Pulse to a Hiccup form (representing HTML)." ([timezone-id part] (render-pulse-section timezone-id part {})) diff --git a/src/metabase/channel/render/preview.clj b/src/metabase/channel/render/preview.clj index 78d86554827..5f080814003 100644 --- a/src/metabase/channel/render/preview.clj +++ b/src/metabase/channel/render/preview.clj @@ -153,7 +153,7 @@ (defn style-tag-nonce-middleware "Constructs a middleware handler function that adds the generated nonce to an html string. This is only designed to be used with an endpoint that returns an html string response containing - a style tag with an attribute 'nonce=%NONCE%'. Specifcally, this was designed to be used with the + a style tag with an attribute 'nonce=%NONCE%'. Specifically, this was designed to be used with the endpoint `api/pulse/preview_dashboard/:id`." [only-this-uri handler] (fn [request respond raise] diff --git a/src/metabase/channel/render/style.clj b/src/metabase/channel/render/style.clj index ef0ab9a7e26..071e722ae7f 100644 --- a/src/metabase/channel/render/style.clj +++ b/src/metabase/channel/render/style.clj @@ -57,7 +57,7 @@ "#4C5773") (def ^:const color-border - "Used as color for the border of table, table header, and table body rows for charts with `:table` vizualization." + "Used as color for the border of table, table header, and table body rows for charts with `:table` visualization." "#F0F0F0") ;; don't try to improve the code and make this a plain variable, in EE it's customizable which is why it's a function. diff --git a/src/metabase/channel/slack.clj b/src/metabase/channel/slack.clj index 78806c72c3a..5222394b999 100644 --- a/src/metabase/channel/slack.clj +++ b/src/metabase/channel/slack.clj @@ -170,7 +170,7 @@ (throw e))))) (defn user-transform - "Tranformation from slack api user to our own internal representation." + "Transformation from slack api user to our own internal representation." [member] {:display-name (str \@ (:name member)) :type "user" @@ -226,7 +226,7 @@ (defn bug-report-channel "Looks in [[slack-cached-channels-and-usernames]] to check whether a channel exists with the expected name from the [[slack-bug-report-channel]] setting with an # prefix. If it does, returns the channel details as a map. If it doesn't, - throws an error that advices an admin to create it." + throws an error that advises an admin to create it." [] (let [channel-name (channel.settings/slack-bug-report-channel)] (if (channel-exists? channel-name) diff --git a/src/metabase/cloud_migration/models/cloud_migration.clj b/src/metabase/cloud_migration/models/cloud_migration.clj index 0b7cfebe825..1325fba2c49 100644 --- a/src/metabase/cloud_migration/models/cloud_migration.clj +++ b/src/metabase/cloud_migration/models/cloud_migration.clj @@ -185,7 +185,7 @@ ;; This endpoint, and only this one in this ns, needs a backwards and forward compatible ;; key conversion. This can be removed when Harbormaster does only underscores in the API, ;; and the keys above (multipart-upload-id multipart-urls) renamed to use underscores. - ;; But it can also stay here indefinitly and will be correct. + ;; But it can also stay here indefinitely and will be correct. u/deep-kebab-keys) etags @@ -214,7 +214,7 @@ Will exit early if migration has been cancelled in any cluster instance. Should run in a separate thread since it can take a long time to complete." [{:keys [id external_id] :as migration} & {:keys [retry?]}] - ;; dump-to-h2 starts behaving oddly if you try to dump repeatly to the same file + ;; dump-to-h2 starts behaving oddly if you try to dump repeatedly to the same file ;; in the same process, so use a random name. ;; The docker image process runs in non-root, so write to a dir it can access. (let [dump-file (io/file (System/getProperty "java.io.tmpdir") @@ -258,7 +258,7 @@ (catch Exception e ;; See set-progress for when :terminal is set. (if (-> e ex-data :terminal) - (log/info "Migration interruped due to terminal state") + (log/info "Migration interrupted due to terminal state") (do (t2/update! :model/CloudMigration id {:state :error}) (log/info "Migration failed") diff --git a/src/metabase/cmd/copy.clj b/src/metabase/cmd/copy.clj index 7966b92e7d5..fedb1cf7ebf 100644 --- a/src/metabase/cmd/copy.clj +++ b/src/metabase/cmd/copy.clj @@ -134,7 +134,7 @@ :model/MetabotMessage :model/MetabotPrompt]))) -(defn- objects->colums+values +(defn- objects->columns+values "Given a sequence of objects/rows fetched from the H2 DB, return a the `columns` that should be used in the `INSERT` statement, and a sequence of rows (as sequences)." [target-db-type objs] @@ -156,7 +156,7 @@ [target-db-type target-db-conn-spec table-name chunkk] (log/debugf "Inserting chunk of %d rows" (count chunkk)) (try - (let [{:keys [cols vals]} (objects->colums+values target-db-type chunkk)] + (let [{:keys [cols vals]} (objects->columns+values target-db-type chunkk)] (jdbc/insert-multi! target-db-conn-spec table-name cols vals {:transaction? false})) (catch SQLException e (log/error (with-out-str (jdbc/print-sql-exception-chain e))) diff --git a/src/metabase/cmd/env_var_dox.clj b/src/metabase/cmd/env_var_dox.clj index a893d01d949..cf0bb3293e5 100644 --- a/src/metabase/cmd/env_var_dox.clj +++ b/src/metabase/cmd/env_var_dox.clj @@ -80,7 +80,7 @@ (str (apply str (take n (repeat "#"))) " `" s "`")) (defn- format-description - "Helper function to specify description format for enviromnent variable docs." + "Helper function to specify description format for environment variable docs." [env-var] (->> ((:description env-var)) u/add-period diff --git a/src/metabase/collections/models/collection.clj b/src/metabase/collections/models/collection.clj index 1014574788f..942eaf0d479 100644 --- a/src/metabase/collections/models/collection.clj +++ b/src/metabase/collections/models/collection.clj @@ -466,7 +466,7 @@ (mu/defn format-personal-collection-name :- ms/NonBlankString "Constructs the personal collection name from user name. - When displaying to users we'll tranlsate it to user's locale, + When displaying to users we'll translate it to user's locale, but to keeps things consistent in the database, we'll store the name in site's locale. Practically, use `user-or-site` = `:site` when insert or update the name in database, @@ -528,7 +528,7 @@ (def ^:private CollectionWithLocationAndPersonalOwnerID "Schema for a Collection instance that has a valid `:location`, and a `:personal_owner_id` key *present* (but not - neccesarily non-nil)." + necessarily non-nil)." [:map [:location LocationPath] [:personal_owner_id [:maybe ms/PositiveInt]]]) @@ -587,7 +587,7 @@ (def ^:private ^{:arglists '([user-id])} user->personal-collection-id "Cached function to fetch the ID of the Personal Collection belonging to User with `user-id`. Since a Personal Collection cannot be deleted, the ID will not change; thus it is safe to cache, saving a DB call. It is also - required to caclulate the Current User's permissions set, which is done for every API call; thus it is cached to + required to calculate the Current User's permissions set, which is done for every API call; thus it is cached to save a DB call for *every* API call." (memoize/ttl ^{::memoize/args-fn (fn [[user-id]] @@ -968,7 +968,7 @@ collections))) ;;; +----------------------------------------------------------------------------------------------------------------+ -;;; | Nested Collections: Ancestors, Childrens, Child Collections | +;;; | Nested Collections: Ancestors, Children, Child Collections | ;;; +----------------------------------------------------------------------------------------------------------------+ (mu/defn- ancestors* :- [:maybe [:sequential (ms/InstanceOf :model/Collection)]] @@ -1882,7 +1882,7 @@ (if (and (= (u/qualified-name (:namespace collection)) "snippets") (not (premium-features/enable-snippet-collections?))) #{} - ;; This is not entirely accurate as you need to be a superuser to modifiy a collection itself (e.g., changing its + ;; This is not entirely accurate as you need to be a superuser to modify a collection itself (e.g., changing its ;; name) but if you have write perms you can add/remove cards #{(case read-or-write :read (perms/collection-read-path collection-or-id) diff --git a/src/metabase/collections_rest/api.clj b/src/metabase/collections_rest/api.clj index 94e0fe493d2..8ae0c8ac0ba 100644 --- a/src/metabase/collections_rest/api.clj +++ b/src/metabase/collections_rest/api.clj @@ -966,9 +966,9 @@ [select-columns necessary-columns] (let [columns (m/index-by select-name select-columns)] (map (fn [col] - (let [[col-name typpe] (u/one-or-many col)] - (get columns col-name (if (and typpe (= (mdb/db-type) :postgres)) - [(h2x/cast typpe nil) col-name] + (let [[col-name type'] (u/one-or-many col)] + (get columns col-name (if (and type' (= (mdb/db-type) :postgres)) + [(h2x/cast type' nil) col-name] [nil col-name])))) necessary-columns))) diff --git a/src/metabase/config/core.clj b/src/metabase/config/core.clj index 04e52c60f5b..9eac6945112 100644 --- a/src/metabase/config/core.clj +++ b/src/metabase/config/core.clj @@ -163,7 +163,7 @@ parse-long)) (defonce ^{:doc "This UUID is randomly-generated upon launch and used to identify this specific Metabase instance during - this specifc run. Restarting the server will change this UUID, and each server in a horizontal cluster + this specific run. Restarting the server will change this UUID, and each server in a horizontal cluster will have its own ID, making this different from the `site-uuid` Setting."} local-process-uuid (str (random-uuid))) diff --git a/src/metabase/content_verification/models/moderation_review.clj b/src/metabase/content_verification/models/moderation_review.clj index 901f2a3c8bb..0bb929d8c60 100644 --- a/src/metabase/content_verification/models/moderation_review.clj +++ b/src/metabase/content_verification/models/moderation_review.clj @@ -44,8 +44,8 @@ 10) (mu/defn delete-extra-reviews! - "Delete extra reviews to maintain an invariant of only `max-moderation-reviews`. Called before inserting so actuall - insures there are one fewer than that so you can add afterwards." + "Delete extra reviews to maintain an invariant of only `max-moderation-reviews`. Called before inserting so actually + ensures there are one fewer than that so you can add afterwards." [item-id :- :int item-type :- :string] (let [ids (into #{} (comp (map :id) @@ -55,7 +55,7 @@ :where [:and [:= :moderated_item_id item-id] [:= :moderated_item_type item-type]] - ;; cannot put the offset in this query as mysql doesnt place nice. It requires a limit + ;; cannot put the offset in this query as mysql doesn't play nice. It requires a limit ;; as well which we do not want to give. The offset is only 10 though so its not a huge ;; savings and we run this on every entry so the max number is 10, delete the extra, ;; and insert a new one to arrive at 10 again, our invariant. diff --git a/src/metabase/driver.clj b/src/metabase/driver.clj index b81cd8594d0..d2ccd693c24 100644 --- a/src/metabase/driver.clj +++ b/src/metabase/driver.clj @@ -89,7 +89,7 @@ (defn the-driver "Like [[clojure.core/the-ns]]. Converts argument to a keyword, then loads and registers the driver if not already done, - throwing an Exception if it fails or is invalid. Returns keyword. Note that this does not neccessarily mean the + throwing an Exception if it fails or is invalid. Returns keyword. Note that this does not necessarily mean the driver is initialized (e.g., its full implementation and deps might not be loaded into memory) -- see also [[the-initialized-driver]]. @@ -151,7 +151,7 @@ (the-initialized-driver driver)) ;;; +----------------------------------------------------------------------------------------------------------------+ -;;; | Interface (Multimethod Defintions) | +;;; | Interface (Multimethod Definitions) | ;;; +----------------------------------------------------------------------------------------------------------------+ ;; Methods a driver can implement. Not all of these are required; some have default implementations immediately below @@ -164,7 +164,7 @@ ;; (driver/register-driver! :my-driver, :parent :sql-jdbc) ;; ;; (defmethod driver/describe-table :my-driver [driver database table] -;; (-> ((get-method driver/describe-table :sql-jdbc) driver databse table) +;; (-> ((get-method driver/describe-table :sql-jdbc) driver database table) ;; (update :tables add-materialized-views))) ;; ;; Make sure to pass along the `driver` parameter-as when you call other methods, rather than hardcoding the name of @@ -181,8 +181,8 @@ manifest file (which is supplied for lazy-loaded drivers). Methods that require connecting to a database dispatch off of [[the-initialized-driver]], which will initialize a driver if not already done so. - You will rarely need to write an implentation for this method yourself. A lazy-loaded driver (like most of the - Metabase drivers in v1.0 and above) are automatiaclly given an implentation of this method that performs the + You will rarely need to write an implementation for this method yourself. A lazy-loaded driver (like most of the + Metabase drivers in v1.0 and above) are automatically given an implementation of this method that performs the `init-steps` specified in the plugin manifest (such as loading namespaces in question). If you do need to implement this method yourself, you do not need to call parent implementations. We'll take care of @@ -203,7 +203,7 @@ implementation capitializes the name of the driver, e.g. `:oracle` becomes \"Oracle\". When writing a driver that you plan to ship as a separate, lazy-loading plugin (including core drivers packaged this - way, like SQLite), you do not need to implement this method; instead, specifiy it in your plugin manifest, and + way, like SQLite), you do not need to implement this method; instead, specify it in your plugin manifest, and `lazy-loaded-driver` will create an implementation for you. Probably best if we only have one place where we set values for this." {:added "0.32.0" :arglists '([driver])} @@ -279,7 +279,7 @@ (defmulti describe-database "Return a map containing information that describes all of the tables in a `database`, an instance of the `Database` - model. It is expected that this function will be peformant and avoid draining meaningful resources of the database. + model. It is expected that this function will be performant and avoid draining meaningful resources of the database. Results should match the [[metabase.sync.interface/DatabaseMetadata]] schema. Multimethod for backwards compatibility, but should not be extended directly, should instead implement [[describe-database*]]. Default impl invokes [[describe-database*]] wrapped in [[do-with-resilient-connection]]" @@ -295,7 +295,7 @@ (defmulti describe-table "Return a map containing a single field `:fields` that describes the fields in a `table`. `database` will be an instance of the `Database` model; and `table`, an instance of the `Table` model. It is expected that this function - will be peformant and avoid draining meaningful resources of the database. The value of `:fields` should be a set of + will be performant and avoid draining meaningful resources of the database. The value of `:fields` should be a set of values matching the [[metabase.sync.interface/TableMetadataField]] schema." {:added "0.32.0" :arglists '([driver database table])} dispatch-on-initialized-driver @@ -578,7 +578,7 @@ :binning ;; Does this driver not let you specify whether or not our string search filter clauses (`:contains`, - ;; `:starts-with`, and `:ends-with`, collectively the equivalent of SQL `LIKE`) are case-senstive or not? This + ;; `:starts-with`, and `:ends-with`, collectively the equivalent of SQL `LIKE`) are case-sensitive or not? This ;; informs whether we should present you with the 'Case Sensitive' checkbox in the UI. At the time of this writing ;; SQLite, SQLServer, and MySQL do not support this -- `LIKE` clauses are always case-insensitive. ;; @@ -933,14 +933,14 @@ At the time of writing, this method acts as identity for nosql drivers. However, story with sql drivers is a bit different. To extend it for sql drivers, developers could use [[metabase.driver.sql.util/format-sql]]. Function - in question is implemented in a way, that developers, implemnting this multimethod can: + in question is implemented in a way, that developers, implementing this multimethod can: - Avoid implementing it completely, if their driver keyword representation corresponds to key in [[metabase.driver.sql.util/dialects]] (eg. `:postgres`). - Ignore implementing it, if it is sufficient to format their drivers native form with dialect corresponding to `:standardsql`'s value from the dialects map (eg `:h2`). - Use [[metabase.driver.sql.util/format-sql]] in this method's implementation, providing dialect keyword representation that corresponds to to their driver's formatting (eg. `:sqlserver` uses `:tsql`). - - Completly reimplement this method with their special formatting code." + - Completely reimplement this method with their special formatting code." {:added "0.47.0", :arglists '([driver native-form])} dispatch-on-initialized-driver :hierarchy #'hierarchy) @@ -1017,7 +1017,7 @@ is only used for iterating over the values in a `_metabase_metadata` table. As such, the results are not expected to be returned lazily. There is no expectation that the results be returned in any given order. - This method is currently only used by the H2 driver to load the Sample Database, so it is not neccesary for any other + This method is currently only used by the H2 driver to load the Sample Database, so it is not necessary for any other drivers to implement it at this time." {:added "0.32.0" :arglists '([driver database table])} dispatch-on-initialized-driver diff --git a/src/metabase/driver/common/parameters.clj b/src/metabase/driver/common/parameters.clj index c46b433a832..959f0b76165 100644 --- a/src/metabase/driver/common/parameters.clj +++ b/src/metabase/driver/common/parameters.clj @@ -14,7 +14,7 @@ ;; ;; `value`" is either: ;; * `no-value` -;; * A map contianing the value and type info for the value, e.g. +;; * A map containing the value and type info for the value, e.g. ;; ;; {:type :date/single ;; :value #t "2019-09-20T19:52:00.000-07:00"} diff --git a/src/metabase/driver/common/parameters/dates.clj b/src/metabase/driver/common/parameters/dates.clj index ebc2db89773..2ed31743ee9 100644 --- a/src/metabase/driver/common/parameters/dates.clj +++ b/src/metabase/driver/common/parameters/dates.clj @@ -33,7 +33,7 @@ ;; For parsing date strings and producing either a date range (for raw SQL parameter substitution) or a MBQL clause -;; Decorders consist of: +;; Decoders consist of: ;; 1) Parser which tries to parse the date parameter string ;; 2) Range decoder which takes the parser output and produces a date range relative to the given datetime ;; 3) Filter decoder which takes the parser output and produces a mbql clause for a given mbql field reference diff --git a/src/metabase/driver/h2/actions.clj b/src/metabase/driver/h2/actions.clj index 1fb25e6a300..c5031e95ea5 100644 --- a/src/metabase/driver/h2/actions.clj +++ b/src/metabase/driver/h2/actions.clj @@ -32,7 +32,7 @@ (defn- db-identifier->name "Get the name of identifier from JDBC error message. An identifier can contains quote and full schema, database, table , etc. - This formats so that we get only the identifer name with quote removed. + This formats so that we get only the identifier name with quote removed. (db-identifier->name \"PUBLIC.TABLE\" ) => \"TABLE\"" @@ -61,7 +61,7 @@ constraint-name table-name) (reduced nil)))) [[] nil nil] - (jdbc/reducible-query jdbc-spec sql-args {:identifers identity, :transaction? false}))))) + (jdbc/reducible-query jdbc-spec sql-args {:transaction? false}))))) (defmethod sql-jdbc.actions/maybe-parse-sql-error [:h2 driver-api/violate-not-null-constraint] [_driver error-type _database _action-type error-message] diff --git a/src/metabase/driver/impl.clj b/src/metabase/driver/impl.clj index 96bfd4f083c..6d4d7096a9f 100644 --- a/src/metabase/driver/impl.clj +++ b/src/metabase/driver/impl.clj @@ -80,7 +80,7 @@ (throw (Exception. (tru "Could not load {0} driver." driver) e)))))) (mu/defn load-driver-namespace-if-needed! - "Load the expected namespace for a `driver` if it has not already been registed. This only works for core Metabase + "Load the expected namespace for a `driver` if it has not already been registered. This only works for core Metabase drivers, whose namespaces follow an expected pattern; drivers provided by 3rd-party plugins are expected to register themselves in their plugin initialization code. diff --git a/src/metabase/driver/mysql.clj b/src/metabase/driver/mysql.clj index 59f9a900049..fd6e4b73627 100644 --- a/src/metabase/driver/mysql.clj +++ b/src/metabase/driver/mysql.clj @@ -736,7 +736,7 @@ ;; Since MySQL TIMESTAMPs aren't timezone-aware this means comparisons are done between timestamps in the report ;; timezone and the local datetime portion of the parameter, in UTC. Bad! ;; -;; Convert it to a LocalDateTime, in the report timezone, so comparisions will work correctly. +;; Convert it to a LocalDateTime, in the report timezone, so comparisons will work correctly. ;; ;; See also — https://dev.mysql.com/doc/refman/5.5/en/datetime.html ;; @@ -767,7 +767,7 @@ ;; There is currently no way to tell whether the column is the result of a `timediff()` call (i.e., a duration) or a ;; normal `LocalTime` -- JDBC doesn't have interval/duration type enums. `java.time.LocalTime`only accepts values of ;; hour between 0 and 23 (inclusive). The MariaDB JDBC driver's implementations of `(.getObject rs i -;; java.time.LocalTime)` will throw Exceptions theses cases. +;; java.time.LocalTime)` will throw Exceptions in these cases. ;; ;; Thus we should attempt to fetch temporal results the normal way and fall back to string representations for cases ;; where the values are unparseable. diff --git a/src/metabase/driver/mysql/actions.clj b/src/metabase/driver/mysql/actions.clj index 552c692aacc..b6f51d40e42 100644 --- a/src/metabase/driver/mysql/actions.clj +++ b/src/metabase/driver/mysql/actions.clj @@ -50,7 +50,7 @@ constraint-name) (reduced nil)))) [[] nil nil] - (jdbc/reducible-query jdbc-spec sql-args {:identifers identity, :transaction? false}))))) + (jdbc/reducible-query jdbc-spec sql-args {:transaction? false}))))) (defmethod sql-jdbc.actions/maybe-parse-sql-error [:mysql driver-api/violate-not-null-constraint] [_driver error-type _database _action-type error-message] @@ -228,7 +228,7 @@ select-sql-args (select-created-row-sql-args driver create-hsql pks insert_id) query-results (jdbc/query jdbc-spec select-sql-args - {:identifiers identity, :transaction? false, :keywordize? false})] + {:transaction? false, :keywordize? false})] (if (next query-results) (log/warn "cannot identify row inserted by" create-hsql "using results" results) (first query-results)))) diff --git a/src/metabase/driver/postgres/actions.clj b/src/metabase/driver/postgres/actions.clj index 2b1b8e9a827..97e5fcc0165 100644 --- a/src/metabase/driver/postgres/actions.clj +++ b/src/metabase/driver/postgres/actions.clj @@ -21,7 +21,7 @@ sql-args ["select column_name from information_schema.constraint_column_usage where constraint_name = ?" constraint-name]] (into [] (map :column_name) - (jdbc/reducible-query jdbc-spec sql-args {:identifers identity, :transaction? false})))) + (jdbc/reducible-query jdbc-spec sql-args {:transaction? false})))) (defmethod sql-jdbc.actions/maybe-parse-sql-error [:postgres driver-api/violate-not-null-constraint] [_driver error-type _database _action-type error-message] diff --git a/src/metabase/driver/sql/parameters/substitution.clj b/src/metabase/driver/sql/parameters/substitution.clj index 783ad7ffd1e..090fb97ee58 100644 --- a/src/metabase/driver/sql/parameters/substitution.clj +++ b/src/metabase/driver/sql/parameters/substitution.clj @@ -38,7 +38,7 @@ (defmulti ->prepared-substitution "Returns a `PreparedStatementSubstitution` (see schema below) for `x` and the given driver. This allows driver specific parameters and SQL replacement text (usually just ?). The param value is already prepared and ready for - inlcusion in the query, such as what's needed for SQLite and timestamps." + inclusion in the query, such as what's needed for SQLite and timestamps." {:added "0.34.0" :arglists '([driver x])} (fn [driver x] [(driver/dispatch-on-initialized-driver driver) (class x)]) :hierarchy #'driver/hierarchy) @@ -288,7 +288,7 @@ (field->clause field {:temporal-unit (align-temporal-unit-with-param-type-and-value driver field param-type value)})) (mu/defn- field->identifier :- driver-api/schema.common.non-blank-string - "Return an approprate snippet to represent this `field` in SQL given its param type. + "Return an appropriate snippet to represent this `field` in SQL given its param type. For non-date Fields, this is just a quoted identifier; for dates, the SQL includes appropriately bucketing based on the `param-type`." [driver field param-type value] diff --git a/src/metabase/driver/sql/query_processor.clj b/src/metabase/driver/sql/query_processor.clj index b7f3266bbdd..233b4d09a84 100644 --- a/src/metabase/driver/sql/query_processor.clj +++ b/src/metabase/driver/sql/query_processor.clj @@ -55,7 +55,7 @@ That requires: - - Removal of traling comments (after the semicolon). + - Removal of trailing comments (after the semicolon). - Removing the semicolon(s). - Squashing whitespace at the end of the string and replacinig it with newline. This is required in case some comments were preceding semicolon. @@ -243,7 +243,7 @@ Used in implementations of ->integer." [driver value] ;; value can be either string or float - ;; if it's a float, coversion to float does nothing + ;; if it's a float, conversion to float does nothing ;; if it's a string, we can't round, so we need to convert to float first (->> value (->float driver) @@ -269,7 +269,7 @@ (inline-value driver/*driver* x) (honey.sql.protocols/sqlize x))) -;;; Replace the implentation of [[honey.sql/sqlize-value]] with one that hands off to [[inline-value]] if driver is +;;; Replace the implementation of [[honey.sql/sqlize-value]] with one that hands off to [[inline-value]] if driver is ;;; bound. This way we can have driver-specific inline behavior. Monkey-patching private functions like this is a little ;;; questionable for sure but I think it's justified here since there is on other way to consistently guarantee that we ;;; hand off to [[sqlize-value]] when compiling something inline. @@ -332,7 +332,7 @@ (defmethod date [:sql :week-of-year] [driver _ expr] - ;; Some DBs truncate when doing integer division, therefore force float arithmetics + ;; Some DBs truncate when doing integer division, therefore force float arithmetic (->honeysql driver [:ceil (compiled (h2x// (date driver :day-of-year (date driver :week expr)) 7.0))])) (defmethod date [:sql :month-of-year] [_driver _ expr] (h2x/month expr)) @@ -351,7 +351,7 @@ :hierarchy #'driver/hierarchy) (defn- days-till-start-of-first-full-week - "Takes a datetime expession, return a HoneySQL form + "Takes a datetime expression, return a HoneySQL form that calculate how many days from the Jan 1st till the start of `first full week`. A full week is a week that contains 7 days in the same year. @@ -1314,7 +1314,7 @@ [:offset (options :guard :name) _expr _n] (->honeysql driver (h2x/identifier :field-alias (:name options))) - ;; for everything else just use the name of the aggregation as an identifer, e.g. `:sum` + ;; for everything else just use the name of the aggregation as an identifier, e.g. `:sum` ;; ;; TODO -- I don't think we will ever actually get to this anymore because everything should have been given a name ;; by [[metabase.query-processor.middleware.pre-alias-aggregations]] @@ -1385,7 +1385,7 @@ ;; TODO -- this name is a bit of a misnomer since it also handles `:aggregation` and `:expression` clauses. (mu/defn field-clause->alias :- some? - "Generate HoneySQL for an approriate alias (e.g., for use with SQL `AS`) for a `:field`, `:expression`, or + "Generate HoneySQL for an appropriate alias (e.g., for use with SQL `AS`) for a `:field`, `:expression`, or `:aggregation` clause of any type, or `nil` if the Field should not be aliased. By default uses the `::add/desired-alias` key in the clause options. diff --git a/src/metabase/driver/sql_jdbc/actions.clj b/src/metabase/driver/sql_jdbc/actions.clj index 409a877d473..f8981c1e166 100644 --- a/src/metabase/driver/sql_jdbc/actions.clj +++ b/src/metabase/driver/sql_jdbc/actions.clj @@ -36,7 +36,7 @@ The methods should returns a map of: - type: the error type. Check [[metabase.actions.error]] for the full list - message: a nice message summarized of what went wrong - - errors: a map from field-name => sepcific error message. This is used by UI to display per fields error + - errors: a map from field-name => specific error message. This is used by UI to display per fields error If non per-column error is available, returns an empty map. Or return `nil` if the parser doesn't match." @@ -458,7 +458,7 @@ (let [db-id (u/the-id database) driver (:engine database) table-id (get-in query [:query :source-table]) - ;; Check that we have a PK before we insert thte data, because we'd need this to query the return data. + ;; Check that we have a PK before we insert the data, because we'd need this to query the return data. _ (assert-pk! db-id table-id) {:keys [from]} (mbql-query->raw-hsql driver query) create-hsql (-> {:insert-into (first from) diff --git a/src/metabase/driver/sql_jdbc/common.clj b/src/metabase/driver/sql_jdbc/common.clj index b543079dbe3..104d2b09dd4 100644 --- a/src/metabase/driver/sql_jdbc/common.clj +++ b/src/metabase/driver/sql_jdbc/common.clj @@ -61,7 +61,7 @@ :always (assoc :subname (conn-str-with-additional-opts connection-string seperator-style additional-options))))) (defn additional-options->map - "Attempts to parse the entires within the `additional-options` string into a map of keys to values. `separator-style` + "Attempts to parse the entries within the `additional-options` string into a map of keys to values. `separator-style` works as in the other functions in this namespace (since it influences the separator that appears between pairs). `opt-name-val-separator?` is an optional parameter that indicates the string that appears between keys and values. If diff --git a/src/metabase/driver/sql_jdbc/execute.clj b/src/metabase/driver/sql_jdbc/execute.clj index fc20c7e156d..0151980a190 100644 --- a/src/metabase/driver/sql_jdbc/execute.clj +++ b/src/metabase/driver/sql_jdbc/execute.clj @@ -138,7 +138,7 @@ [(driver/dispatch-on-initialized-driver driver) (class object)]) :hierarchy #'driver/hierarchy) -;; TODO -- maybe like [[do-with-connection-with-options]] we should replace [[prepared-statment]] and [[statement]] +;; TODO -- maybe like [[do-with-connection-with-options]] we should replace [[prepared-statement]] and [[statement]] ;; with `do-with-prepared-statement` and `do-with-statement` methods -- that way you can't accidentally forget to wrap ;; things in a `try-catch` and call `.close` (metabase#40010) @@ -753,7 +753,7 @@ ; Combines the original SQL query with query remarks. Most databases using sql-jdbc based drivers support prepending the ; remark to the SQL statement, so we have it as a default. However, some drivers do not support it, so we allow it to -; be overriden. +; be overridden. (defmethod inject-remark :default [_ sql remark] (str "-- " remark "\n" sql)) @@ -798,9 +798,9 @@ (let [rsmeta (.getMetaData rs) results-metadata {:cols (column-metadata driver rsmeta)}] (try (respond results-metadata (reducible-rows driver rs rsmeta (driver-api/canceled-chan))) - ;; Following cancels the statment on the dbms side. + ;; Following cancels the statement on the dbms side. ;; It avoids blocking `.close` call, in case we reduced the results subset eg. by means of - ;; [[metabase.query-processor.middleware.limit/limit-xform]] middleware, while statment is still + ;; [[metabase.query-processor.middleware.limit/limit-xform]] middleware, while statement is still ;; in progress. This problem was encountered on Redshift. For details see the issue #39018. ;; It also handles situation where query is canceled through [[driver-api/canceled-chan]] (#41448). (finally diff --git a/src/metabase/driver/sql_jdbc/sync/describe_database.clj b/src/metabase/driver/sql_jdbc/sync/describe_database.clj index 9820af81f81..9002b7fa332 100644 --- a/src/metabase/driver/sql_jdbc/sync/describe_database.clj +++ b/src/metabase/driver/sql_jdbc/sync/describe_database.clj @@ -76,7 +76,7 @@ {:pre [(string? sql)]} (with-open [stmt (sql-jdbc.sync.common/prepare-statement driver conn sql params)] ;; attempting to execute the SQL statement will throw an Exception if we don't have permissions; otherwise it will - ;; truthy wheter or not it returns a ResultSet, but we can ignore that since we have enough info to proceed at + ;; truthy whether or not it returns a ResultSet, but we can ignore that since we have enough info to proceed at ;; this point. (doto stmt (.setQueryTimeout *select-probe-query-timeout-seconds*) @@ -109,7 +109,7 @@ (let [;; Let's try to ensure the connection is not just open but also valid. ;; Snowflake closes the connection but doesn't set it as closed in the object, - ;; so we must explicitely check if it's valid so that subsequent calls to [[sql-jdbc.execute/try-ensure-open-conn!]] + ;; so we must explicitly check if it's valid so that subsequent calls to [[sql-jdbc.execute/try-ensure-open-conn!]] ;; will obtain a new connection is-open (sql-jdbc.execute/is-conn-open? conn :check-valid? true) @@ -166,7 +166,7 @@ "Build a nested map of schema -> table -> set of permissions from current user table privileges. There are 2 permissions: - :select - self-explained - - :write - must have insert, update, and delete permisisons. used for table data editing" + - :write - must have insert, update, and delete permissions. used for table data editing" [driver conn] (->> (sql-jdbc.sync.interface/current-user-table-privileges driver {:connection conn}) (reduce (fn [acc {:keys [schema table select insert update delete]}] diff --git a/src/metabase/driver/sql_jdbc/sync/describe_table.clj b/src/metabase/driver/sql_jdbc/sync/describe_table.clj index 824460297e9..72ca6b2ae57 100644 --- a/src/metabase/driver/sql_jdbc/sync/describe_table.clj +++ b/src/metabase/driver/sql_jdbc/sync/describe_table.clj @@ -178,7 +178,7 @@ ;; ;; 3. Filter out any duplicates between the two methods using `m/distinct-by`. (let [has-fields-without-type-info? (volatile! false) - ;; intented to fix syncing dynamic tables for snowflake. + ;; intended to fix syncing dynamic tables for snowflake. ;; currently there is a bug in snowflake jdbc (snowflake#1574) in which it doesn't return columns for dynamic tables jdbc-returns-no-field? (volatile! true) jdbc-metadata (eduction @@ -463,7 +463,7 @@ (filter #(nil? (:filter_condition %))) (jdbc/reducible-result-set index-info-rs {}))) (keep (fn [[index-name idx-values]] - ;; we only sync columns that are either singlely indexed or is the first key in a composite index + ;; we only sync columns that are either singly indexed or is the first key in a composite index (when-let [column-name (some :column_name (sort-by :ordinal_position idx-values))] {:type :normal-column-index :index-name index-name diff --git a/src/metabase/driver/sql_jdbc/sync/interface.clj b/src/metabase/driver/sql_jdbc/sync/interface.clj index 48986147f71..b26ad2b8be1 100644 --- a/src/metabase/driver/sql_jdbc/sync/interface.clj +++ b/src/metabase/driver/sql_jdbc/sync/interface.clj @@ -73,7 +73,7 @@ (defmulti fallback-metadata-query "SELECT columns from a given table so we can get column metadata. By default doesn't return any rows. This can be - overriden because SQLite is silly and only returns column information for views if the query returns a non-zero + overridden because SQLite is silly and only returns column information for views if the query returns a non-zero number of rows. (fallback-metadata-query :postgres \"my_database\" \"public\" \"my_table\") diff --git a/src/metabase/driver_api/core.clj b/src/metabase/driver_api/core.clj index 12642e2ae72..d16dd2ecf98 100644 --- a/src/metabase/driver_api/core.clj +++ b/src/metabase/driver_api/core.clj @@ -185,7 +185,7 @@ api/*current-user*) (defn canceled-chan - "If this channel is bount you can check if it has received a message + "If this channel is bound you can check if it has received a message to see if the query has been canceled." [] qp.pipeline/*canceled-chan*) diff --git a/src/metabase/embedding_rest/api/common.clj b/src/metabase/embedding_rest/api/common.clj index 98fd226e3d9..45c39037078 100644 --- a/src/metabase/embedding_rest/api/common.clj +++ b/src/metabase/embedding_rest/api/common.clj @@ -452,7 +452,7 @@ (catch Throwable e (let [e (ex-info (.getMessage e) {:card-id (u/the-id card) - :card-params (:parametres card) + :card-params (:parameters card) :allowed-param-slugs embedding-params :slug->id slug->id :id->slug id->slug @@ -497,7 +497,7 @@ (catch Throwable e (let [e (ex-info (.getMessage e) {:card-id (u/the-id card) - :card-params (:parametres card) + :card-params (:parameters card) :allowed-param-slugs embedding-params :slug->id slug->id :id->slug id->slug diff --git a/src/metabase/formatter/datetime.clj b/src/metabase/formatter/datetime.clj index 8d5ba0a8db7..959cb85b78d 100644 --- a/src/metabase/formatter/datetime.clj +++ b/src/metabase/formatter/datetime.clj @@ -228,7 +228,7 @@ (format-timestring timezone-id temporal-str (dissoc col :unit) viz-settings) ;; We're making an assumption when we bottom out here that the string is compatible with this default format, ;; 'MMMM d, yyyy'. If the time string isn't compatible with this format, we just return the string. - ;; This is not likely to happen IRL since you generally have a useful unit or know the type of the colum. A failure + ;; This is not likely to happen IRL since you generally have a useful unit or know the type of the column. A failure ;; mode that can be reproduced in test is trying to format a time string (e.g.'15:30:45Z') when the column has no ;; type information (e.g. a semantic or effective type of `:type/Time`). (let [date-format (post-process-date-style (or date-style "MMMM d, yyyy") viz-settings)] diff --git a/src/metabase/legacy_mbql/jvm_util.clj b/src/metabase/legacy_mbql/jvm_util.clj index f5cb195ce74..cd4660f9d32 100644 --- a/src/metabase/legacy_mbql/jvm_util.clj +++ b/src/metabase/legacy_mbql/jvm_util.clj @@ -1,5 +1,5 @@ (ns metabase.legacy-mbql.jvm-util - "This namespace contains functionality that is not compatible with js, hence can not be stored in correspoding + "This namespace contains functionality that is not compatible with js, hence can not be stored in corresponding cljc ns, ie. [[metabase.legacy-mbql.util]]." {:deprecated "0.57.0"} (:require diff --git a/src/metabase/legacy_mbql/schema.cljc b/src/metabase/legacy_mbql/schema.cljc index 9f148b4b801..d6824dff81d 100644 --- a/src/metabase/legacy_mbql/schema.cljc +++ b/src/metabase/legacy_mbql/schema.cljc @@ -214,7 +214,7 @@ "datetime" ::lib.schema.literal/datetime "unit" ::DateTimeUnit)]]) -;; almost exactly the same as `absolute-datetime`, but generated in some sitations where the literal in question was +;; almost exactly the same as `absolute-datetime`, but generated in some situations where the literal in question was ;; clearly a time (e.g. "08:00:00.000") and/or the Field derived from `:type/Time` and/or the unit was a ;; time-bucketing unit (defclause time @@ -1962,7 +1962,7 @@ {:type "A join should not include :type" :filter "A join should not have top-level 'inner' query keys like :filter" :breakout "A join should not have top-level 'inner' query keys like :breakout" - :aggreggation "A join should not have top-level 'inner' query keys like :aggreggation" + :aggregation "A join should not have top-level 'inner' query keys like :aggregation" :expressions "A join should not have top-level 'inner' query keys like :expressions" :joins "A join should not have top-level 'inner' query keys like :joins" :ident ":ident is deprecated and should not be included in joins"})]) diff --git a/src/metabase/legacy_mbql/schema/helpers.cljc b/src/metabase/legacy_mbql/schema/helpers.cljc index 2ac149a97fa..4303fd06db9 100644 --- a/src/metabase/legacy_mbql/schema/helpers.cljc +++ b/src/metabase/legacy_mbql/schema/helpers.cljc @@ -115,7 +115,7 @@ tag))) (defn one-of* - "Interal impl of `one-of` macro." + "Internal impl of `one-of` macro." [& schemas] (into [:multi {:dispatch effective-clause-tag diff --git a/src/metabase/legacy_mbql/util.cljc b/src/metabase/legacy_mbql/util.cljc index cc8d1d9393b..c3492a45f8d 100644 --- a/src/metabase/legacy_mbql/util.cljc +++ b/src/metabase/legacy_mbql/util.cljc @@ -1,5 +1,5 @@ (ns metabase.legacy-mbql.util - "Utilitiy functions for working with MBQL queries. + "Utility functions for working with MBQL queries. DEPRECATED: Use [[metabase.lib.core]] for MBQL manipulation in all new code." {:deprecated "0.57.0"} diff --git a/src/metabase/lib/aggregation.cljc b/src/metabase/lib/aggregation.cljc index e00511b05ed..4a96cc05b35 100644 --- a/src/metabase/lib/aggregation.cljc +++ b/src/metabase/lib/aggregation.cljc @@ -361,7 +361,7 @@ (:columns aggregation-operator)) (mu/defn available-aggregation-operators :- [:maybe [:sequential OperatorWithColumns]] - "Returns the available aggegation operators for the stage with `stage-number` of `query`. + "Returns the available aggregation operators for the stage with `stage-number` of `query`. If `stage-number` is omitted, uses the last stage." ([query] (available-aggregation-operators query -1)) diff --git a/src/metabase/lib/binning/util.cljc b/src/metabase/lib/binning/util.cljc index 86565bb9902..be77b5e62b0 100644 --- a/src/metabase/lib/binning/util.cljc +++ b/src/metabase/lib/binning/util.cljc @@ -38,7 +38,7 @@ [:num-bins ::lib.schema.binning/num-bins]]]) (mu/defn- resolve-default-strategy :- ResolvedStrategy - "Determine the approprate strategy & options to use when `:default` strategy was specified." + "Determine the appropriate strategy & options to use when `:default` strategy was specified." [metadata-providerable :- ::lib.schema.metadata/metadata-providerable column :- ::lib.schema.metadata/column min-value :- number? diff --git a/src/metabase/lib/card.cljc b/src/metabase/lib/card.cljc index 1c7ea5d6a58..e055d960e41 100644 --- a/src/metabase/lib/card.cljc +++ b/src/metabase/lib/card.cljc @@ -142,7 +142,7 @@ [:maybe [:sequential {:min 1} ::column]]) (def ^:private ^:dynamic *card-metadata-columns-card-ids* - "Used to track the ID of Cards we're resolving columns for, to avoid inifinte recursion for Cards that have circular + "Used to track the ID of Cards we're resolving columns for, to avoid infinite recursion for Cards that have circular references between one another." #{}) diff --git a/src/metabase/lib/drill_thru/pivot.cljc b/src/metabase/lib/drill_thru/pivot.cljc index 816195f39bc..6e141b65fef 100644 --- a/src/metabase/lib/drill_thru/pivot.cljc +++ b/src/metabase/lib/drill_thru/pivot.cljc @@ -96,7 +96,7 @@ - One or two category breakouts: no `:location` pivot. (`pivot` mode) - If all these conditions fail, no pivots are allowed and the pivot drill should not be returned. - This function encodes all these rules, returning a (possibly emtpy) set of permitted types." + This function encodes all these rules, returning a (possibly empty) set of permitted types." [query :- ::lib.schema/query stage-number :- :int] (case (->> (lib.breakout/breakouts query stage-number) diff --git a/src/metabase/lib/drill_thru/zoom_in_bins.cljc b/src/metabase/lib/drill_thru/zoom_in_bins.cljc index 97d6b0cab32..82e97ab84b6 100644 --- a/src/metabase/lib/drill_thru/zoom_in_bins.cljc +++ b/src/metabase/lib/drill_thru/zoom_in_bins.cljc @@ -117,8 +117,8 @@ (or (lib.binning/resolve-bin-width query column value) (lib.binning/resolve-bin-width query - ;; One of the "superflous" options is ::lib.field/binning, which we want to preserve here. - (lib.underlying/top-level-column query column :rename-superflous-options? false) + ;; One of the "superfluous" options is ::lib.field/binning, which we want to preserve here. + (lib.underlying/top-level-column query column :rename-superfluous-options? false) value))] (case (:strategy binning) (:num-bins :default) diff --git a/src/metabase/lib/drill_thru/zoom_in_geographic.cljc b/src/metabase/lib/drill_thru/zoom_in_geographic.cljc index 4f951c14508..1dec9ce334d 100644 --- a/src/metabase/lib/drill_thru/zoom_in_geographic.cljc +++ b/src/metabase/lib/drill_thru/zoom_in_geographic.cljc @@ -106,7 +106,7 @@ [query :- ::lib.schema/query stage-number :- :int {:keys [row], :as context} :- ::lib.schema.drill-thru/context] - (let [;; First check returned columns in case we breakout by lat/lon so we maintain the binning, othwerwise check visible. + (let [;; First check returned columns in case we breakout by lat/lon so we maintain the binning, otherwise check visible. [lat-column lon-column] (some (fn [columns] (when-let [lat-column (m/find-first lib.types.isa/latitude? columns)] diff --git a/src/metabase/lib/fe_util.cljc b/src/metabase/lib/fe_util.cljc index ed31b160296..7fc2a06218d 100644 --- a/src/metabase/lib/fe_util.cljc +++ b/src/metabase/lib/fe_util.cljc @@ -77,7 +77,7 @@ "Modify expression in a way, that its resulting [[expression-parts]] are digestable by filter picker. Current filter picker implementation is unable to handle expression parts of expressions of a form - `[:= {...} [:field {:temporal-unit :week} 11] \"2024-05-12\"]` -- expresions that check for equality of a column + `[:= {...} [:field {:temporal-unit :week} 11] \"2024-05-12\"]` -- expressions that check for equality of a column with `:temporal-unit` set to value other than `:day` or `:minute` to some date time value. To mitigate that expressions are converted to `:between` form which is handled correctly by filter picker. For more diff --git a/src/metabase/lib/field.cljc b/src/metabase/lib/field.cljc index 16241a0a05b..2553fae7e50 100644 --- a/src/metabase/lib/field.cljc +++ b/src/metabase/lib/field.cljc @@ -390,10 +390,10 @@ (and (isa? effective-type :type/Number) (not (isa? semantic-type :Relation/*))) (lib.binning/numeric-binning-strategies))] ;; TODO: Include the time and date binning strategies too - (for [strat strategies] - (cond-> strat + (for [strategy strategies] + (cond-> strategy (or (:lib/original-binning field-metadata) existing) (dissoc :default) - (lib.binning/strategy= strat existing) (assoc :selected true)))) + (lib.binning/strategy= strategy existing) (assoc :selected true)))) [])) (defmethod lib.ref/ref-method :field @@ -705,7 +705,7 @@ {:query query :stage stage-number :source source})) - ;; Default case: do nothing and return the query unchaged. + ;; Default case: do nothing and return the query unchanged. ;; Generate a warning - we should aim to capture every `:source/*` value above. (do (log/warnf "Cannot remove-field with unknown source %s" (pr-str source)) diff --git a/src/metabase/lib/field/resolution.cljc b/src/metabase/lib/field/resolution.cljc index 9cb4e744e95..00397793322 100644 --- a/src/metabase/lib/field/resolution.cljc +++ b/src/metabase/lib/field/resolution.cljc @@ -166,7 +166,7 @@ :name :lib/ref-name}) (defn- opts-fn-inherited-temporal-unit - "`:inherited-temporal-unit` is transfered from `:temporal-unit` ref option only when + "`:inherited-temporal-unit` is transferred from `:temporal-unit` ref option only when the [[lib.metadata.calculation/*propagate-binning-and-bucketing*]] is truthy, i.e. bound. TODO (Cam 6/18/25) -- that DOES NOT seem to be how it actually works. (Other documentation here was not mine.) @@ -546,7 +546,7 @@ ;; we maybe have incorrectly used a field name ref when we should have used a field ID ref. ;; - ;; TODO (Cam 8/15/25) -- what happpens if this field is marked inactive? It won't come back from + ;; TODO (Cam 8/15/25) -- what happens if this field is marked inactive? It won't come back from ;; `returned-columns`... we'd get fallback metadata, right? (and source-table-id (string? id-or-name)) diff --git a/src/metabase/lib/filter.cljc b/src/metabase/lib/filter.cljc index b3490dc4aea..f3d1d8d59ea 100644 --- a/src/metabase/lib/filter.cljc +++ b/src/metabase/lib/filter.cljc @@ -412,7 +412,7 @@ (mu/defn filters :- [:maybe [:ref ::lib.schema/filters]] "Returns the current filters in stage with `stage-number` of `query`. - If `stage-number` is omitted, the last stage is used. Logicaly, the + If `stage-number` is omitted, the last stage is used. Logically, the filter attached to the query is the conjunction of the expressions in the returned list. If the returned list is empty, then there is no filter attached to the query. @@ -530,7 +530,7 @@ (mu/defn filter-parts :- FilterParts "Return the parts of the filter clause `a-filter-clause` in query `query` at stage `stage-number`. - Might obsolate [[filter-operator]]." + Might obsolete [[filter-operator]]." ([query a-filter-clause] (filter-parts query -1 a-filter-clause)) diff --git a/src/metabase/lib/filter/desugar.cljc b/src/metabase/lib/filter/desugar.cljc index d563e754476..b5b0a39ddf4 100644 --- a/src/metabase/lib/filter/desugar.cljc +++ b/src/metabase/lib/filter/desugar.cljc @@ -188,7 +188,7 @@ (lib.util.match/replace expr [:does-not-contain opts whole & parts] (-> (lib.filter/not (-> (apply lib.filter/contains whole parts) - ;; need to preserve stuff like `:case-sensitve`. Prefer values in each clause over `opts` + ;; need to preserve stuff like `:case-sensitive`. Prefer values in each clause over `opts` ;; so we don't get duplicate UUIDs (lib.options/update-options #(merge opts %)))) (merge-options opts)))) diff --git a/src/metabase/lib/join.cljc b/src/metabase/lib/join.cljc index bc894daef8a..7c95cd2cbaf 100644 --- a/src/metabase/lib/join.cljc +++ b/src/metabase/lib/join.cljc @@ -68,7 +68,7 @@ frontend using functions like [[join-condition-operators]], [[join-condition-lhs-columns]], and [[join-condition-rhs-columns]]. - LHS and RHS expressions can be aribtrary and not only `:field` references. The LHS expression will normally contain + LHS and RHS expressions can be arbitrary and not only `:field` references. The LHS expression will normally contain columns from [[join-condition-lhs-columns]], and the RHS expression from [[join-condition-rhs-columns]]." [condition :- [:maybe ::lib.schema.expression/boolean]] (when condition @@ -578,11 +578,11 @@ (defn- add-alias-to-condition [query stage-number condition join-alias home-cols join-cols] (let [condition (add-alias-to-join-refs query stage-number condition join-alias join-cols)] - ;; Sometimes conditions have field references which cannot be unambigously + ;; Sometimes conditions have field references which cannot be unambiguously ;; assigned to one of the sides. The following code tries to deal with ;; these cases, but only for conditions that look like the ones generated ;; generated by the FE. These have the form home-field op join-field, - ;; so we break ties by looking at the poisition of the field reference. + ;; so we break ties by looking at the position of the field reference. (lib.util.match/replace condition [op op-opts (lhs :guard lib.util/field-clause?) (rhs :guard lib.util/field-clause?)] (let [lhs-alias (lib.join.util/current-join-alias lhs) @@ -702,7 +702,7 @@ (get a-join :strategy :left-join)) (mu/defn join-strategy :- ::lib.schema.join/strategy.option - "Get the strategy (type) of a given join, as a `:option/join.strategy` map. If `:stategy` is unspecified, returns + "Get the strategy (type) of a given join, as a `:option/join.strategy` map. If `:strategy` is unspecified, returns the default, left join." [a-join :- ::lib.join.util/partial-join] (raw-join-strategy->strategy-option (raw-join-strategy a-join))) diff --git a/src/metabase/lib/js.cljs b/src/metabase/lib/js.cljs index 941a273c095..d9255135b10 100644 --- a/src/metabase/lib/js.cljs +++ b/src/metabase/lib/js.cljs @@ -205,7 +205,7 @@ (defn ^:export as-returned "When a query has aggregations in stage `N`, there's an important difference between adding an expression to stage `N` - (with access to the colums before aggregation) or adding it to stage `N+1` (with access to the aggregations and + (with access to the columns before aggregation) or adding it to stage `N+1` (with access to the aggregations and breakouts). Given `a-query` and `stage-number`, this returns a **JS object** with `query` and `stageIndex` keys, for working with @@ -2189,7 +2189,7 @@ (lib.core/database-id a-query)) (defn ^:export join-condition-update-temporal-bucketing - "Updates the provided `join-condition` so both the LHS and RHS columns have the provied temporal bucketing option. + "Updates the provided `join-condition` so both the LHS and RHS columns have the provided temporal bucketing option. `join-condition` must be a *standard join condition*, meaning it's in the form constructed by the query builder UI, where the LHS is a column in the outer query and RHS is a column from the joinable. diff --git a/src/metabase/lib/js/metadata.cljs b/src/metabase/lib/js/metadata.cljs index 973b9541098..b489c4c0768 100644 --- a/src/metabase/lib/js/metadata.cljs +++ b/src/metabase/lib/js/metadata.cljs @@ -412,7 +412,7 @@ (let [parse-card-ignoring-plain-object (parse-object-fn :card {:use-plain-object? false}) parse-card (parse-object-fn :card)] ;; The question objects might not contain the fields so we merge them - ;; in from the table matadata. + ;; in from the table metadata. (merge (-> metadata (object-get "tables") diff --git a/src/metabase/lib/metadata/calculation.cljc b/src/metabase/lib/metadata/calculation.cljc index a68702127f6..e6e07d3c30f 100644 --- a/src/metabase/lib/metadata/calculation.cljc +++ b/src/metabase/lib/metadata/calculation.cljc @@ -15,7 +15,7 @@ [metabase.lib.ref :as lib.ref] [metabase.lib.schema :as lib.schema] [metabase.lib.schema.common :as lib.schema.common] - [metabase.lib.schema.expression :as lib.schema.expresssion] + [metabase.lib.schema.expression :as lib.schema.expression] [metabase.lib.schema.metadata :as lib.schema.metadata] [metabase.lib.schema.temporal-bucketing :as lib.schema.temporal-bucketing] [metabase.lib.types.isa :as lib.types.isa] @@ -183,7 +183,7 @@ (defmulti type-of-method "Calculate the effective type of something. This differs from [[metabase.lib.schema.expression/type-of]] in that it is called with a query/MetadataProvider and a stage number, allowing us to fully resolve information and return - complete, unambigous type information. Default implementation calls [[metabase.lib.schema.expression/type-of]]." + complete, unambiguous type information. Default implementation calls [[metabase.lib.schema.expression/type-of]]." {:arglists '([query stage-number expr])} (fn [_query _stage-number expr] (lib.dispatch/dispatch-value expr)) @@ -223,7 +223,7 @@ (defmethod type-of-method :default [_query _stage-number expr] - (lib.schema.expresssion/type-of expr)) + (lib.schema.expression/type-of expr)) ;;; for MBQL clauses whose type is the same as the type of the first arg. Also used ;;; for [[metabase.lib.schema.expression/type-of]]. @@ -235,7 +235,7 @@ [query stage-number [_tag _opts expr :as clause]] (if (string? expr) ;; If a string, get the type filtered by this expression (eg. `:datetime-add`). - (lib.schema.expresssion/type-of clause) + (lib.schema.expression/type-of clause) ;; Otherwise, just get the type of this first arg. (type-of query stage-number expr))) diff --git a/src/metabase/lib/metadata/protocols.cljc b/src/metabase/lib/metadata/protocols.cljc index 40a29f26d41..71c5accba64 100644 --- a/src/metabase/lib/metadata/protocols.cljc +++ b/src/metabase/lib/metadata/protocols.cljc @@ -19,7 +19,7 @@ `:id` and `:name` are mutually exclusive. When fetching metadata that can be inactive/archived/hidden, only active/unarchived/unhidden objects are fetched - unless `:id` or `:name` is specifed." + unless `:id` or `:name` is specified." [:and [:map {:closed true} @@ -129,7 +129,7 @@ side-effects (to warm the cache). When fetching metadata that can be inactive/archived/hidden, only active/unarchived/unhidden objects are fetched - unless `:id` or `:name` is specifed.") + unless `:id` or `:name` is specified.") (setting [metadata-provider setting-key] "Return the value of the given Metabase setting with keyword `setting-name`.")) @@ -388,7 +388,7 @@ (#?(:clj p/defprotocol+ :cljs defprotocol) InvocationTracker "Optional. A protocol for a MetadataProvider that records the arguments of method invocations during query execution. - This is useful for tracking which metdata ids were used during a query execution. The main purpose of this is to power + This is useful for tracking which metadata ids were used during a query execution. The main purpose of this is to power updating card.last_used_at during query execution. see [[metabase.query-processor.middleware.update-used-cards/update-used-cards!]]" (invoked-ids [this metadata-type] "Get all invoked ids of a metadata type thus far.")) diff --git a/src/metabase/lib/parameters/parse/types.cljc b/src/metabase/lib/parameters/parse/types.cljc index 28f4e4bd076..c7e606e5650 100644 --- a/src/metabase/lib/parameters/parse/types.cljc +++ b/src/metabase/lib/parameters/parse/types.cljc @@ -38,7 +38,7 @@ * [[no-value]] - * A map contianing the value and type info for the value, e.g. + * A map containing the value and type info for the value, e.g. {:type :date/single :value #t \"2019-09-20T19:52:00.000-07:00\"} diff --git a/src/metabase/lib/schema/expression/temporal.cljc b/src/metabase/lib/schema/expression/temporal.cljc index 46ddbbea633..3e318b504be 100644 --- a/src/metabase/lib/schema/expression/temporal.cljc +++ b/src/metabase/lib/schema/expression/temporal.cljc @@ -284,7 +284,7 @@ [:= :default] [:ref ::temporal-bucketing/unit.date-time.interval]]) -;;; TODO (Cam 7/16/25) -- I think unit is rewuired unless `n` is `:current` +;;; TODO (Cam 7/16/25) -- I think unit is required unless `n` is `:current` (mbql-clause/define-catn-mbql-clause :relative-datetime :- :type/DateTime [:n [:schema [:ref ::relative-datetime.amount]]] [:unit [:? [:schema [:ref ::relative-datetime.unit]]]]) diff --git a/src/metabase/lib/schema/parameter.cljc b/src/metabase/lib/schema/parameter.cljc index bc832c88d9b..b43cedab157 100644 --- a/src/metabase/lib/schema/parameter.cljc +++ b/src/metabase/lib/schema/parameter.cljc @@ -1,5 +1,5 @@ (ns metabase.lib.schema.parameter - "`:parameters` specify the *values* of parameters previously definied for a Dashboard or Card (native query template + "`:parameters` specify the *values* of parameters previously defined for a Dashboard or Card (native query template tag parameters.) See [[metabase.lib.schema.template-tag]] above for more information on the later. There are three things called 'type' in play when we talk about parameters and template tags. diff --git a/src/metabase/lib/underlying.cljc b/src/metabase/lib/underlying.cljc index 039746e6825..a1ecdb9fc99 100644 --- a/src/metabase/lib/underlying.cljc +++ b/src/metabase/lib/underlying.cljc @@ -61,7 +61,7 @@ (def ^:private TopLevelColumnOptions [:map {:closed true} - [:rename-superflous-options? {:optional true} :boolean]]) + [:rename-superfluous-options? {:optional true} :boolean]]) (mu/defn top-level-column :- [:maybe ::lib.schema.metadata/column] "Given a column, returns the \"top-level\" equivalent. @@ -72,10 +72,10 @@ Returns nil if the column can't be traced back to the top-level query." ([query :- ::lib.schema/query column :- ::lib.schema.metadata/column] - (top-level-column query column :rename-superflous-options? true)) + (top-level-column query column :rename-superfluous-options? true)) ([query :- ::lib.schema/query column :- ::lib.schema.metadata/column - & {:keys [rename-superflous-options?]} :- TopLevelColumnOptions] + & {:keys [rename-superfluous-options?]} :- TopLevelColumnOptions] (let [top-query (top-level-query query)] (if (= query top-query) column ;; Unchanged if this is already a top-level query. That includes keeping the "superfluous" options! @@ -83,7 +83,7 @@ column column] (if (= query top-query) (cond-> column - rename-superflous-options? + rename-superfluous-options? ;; Once we've found it, rename superfluous options, unless disabled by the caller, because under normal ;; circumstances, you will not need them. On the off chance you do need them, they'll still be available. (set/rename-keys {::lib.field/temporal-unit ::temporal-unit diff --git a/src/metabase/lib/util/match.clj b/src/metabase/lib/util/match.clj index 64a904c9d49..fa47e1688f2 100644 --- a/src/metabase/lib/util/match.clj +++ b/src/metabase/lib/util/match.clj @@ -8,7 +8,7 @@ [net.cgrand.macrovich :as macros])) (defn- generate-pattern - "Generate a single approprate pattern for use with core.match based on the `pattern` input passed into `match` or + "Generate a single appropriate pattern for use with core.match based on the `pattern` input passed into `match` or `replace`." [pattern] (cond @@ -152,7 +152,7 @@ automatically recurse, use a catch-all pattern (such as `_`). Our macro implementation will optimize out this `:else` clause if the last pattern is `_` - ### Returing something other than the exact match with result body + ### Returning something other than the exact match with result body By default, `match` returns whatever matches the pattern you pass in. But what if you only want to return part of the match? You can, using `core.match` binding facilities. Bind relevant things in your pattern and pass in the @@ -187,7 +187,7 @@ ;; -> [[:field 1 nil]]" {:style/indent :defn} [x & patterns-and-results] - ;; Actual implementation of these macros is in `mbql.util.match`. They're in a seperate namespace because they have + ;; Actual implementation of these macros is in `mbql.util.match`. They're in a separate namespace because they have ;; lots of other functions and macros they use for their implementation (which means they have to be public) that we ;; would like to discourage you from using directly. `(match* ~x ~patterns-and-results)) diff --git a/src/metabase/lib/util/match/impl.cljc b/src/metabase/lib/util/match/impl.cljc index c95f7bb22d9..236ba20cd7b 100644 --- a/src/metabase/lib/util/match/impl.cljc +++ b/src/metabase/lib/util/match/impl.cljc @@ -48,7 +48,7 @@ [] form)))) (defn replace-in-collection - "Inernal impl for `replace`. Recursively replace values in a collection using a `replace-fn`." + "Internal impl for `replace`. Recursively replace values in a collection using a `replace-fn`." [replace-fn clause-parents form] (cond (map? form) diff --git a/src/metabase/lib_be/metadata/jvm.clj b/src/metabase/lib_be/metadata/jvm.clj index 974fbe47974..44b33490705 100644 --- a/src/metabase/lib_be/metadata/jvm.clj +++ b/src/metabase/lib_be/metadata/jvm.clj @@ -571,7 +571,7 @@ [[application-database-metadata-provider]] will use it for caching the `MetadataProvider` for each `database-id` over the lifespan of this binding. - This is useful for an API request, or group fo API requests like a dashboard load, to reduce appdb traffic." + This is useful for an API request, or group for API requests like a dashboard load, to reduce appdb traffic." nil) (defn metadata-provider-cache diff --git a/src/metabase/model_persistence/models/persisted_info.clj b/src/metabase/model_persistence/models/persisted_info.clj index e9140ba0cc9..21d4d8746df 100644 --- a/src/metabase/model_persistence/models/persisted_info.clj +++ b/src/metabase/model_persistence/models/persisted_info.clj @@ -117,7 +117,7 @@ "Marks PersistedInfo as `deletable` or `off`, these will at some point be cleaned up by the PersistPrune task. `deletable` will wipe out all trace of persisted-info and allow them to be turned back on by automatic processes - use when you are disabling peristence at a high level. + use when you are disabling persistence at a high level. `off` will ensure automatic processes do not pick up these up and re-enable." ([conditions-map] (mark-for-pruning! conditions-map "deletable")) diff --git a/src/metabase/models/humanization.clj b/src/metabase/models/humanization.clj index 445f21eb75b..1072133b858 100644 --- a/src/metabase/models/humanization.clj +++ b/src/metabase/models/humanization.clj @@ -5,7 +5,7 @@ There are currently two implementations of humanization logic, previously three. Which implementation is used is determined by the Setting `humanization-strategy`. `:simple`, which merely replaces underscores and dashes with spaces, and `:none`, - which predictibly is merely an identity function that does nothing to the results. + which predictably is merely an identity function that does nothing to the results. There used to also be `:advanced`, which was the default until enough customers complained that we first fixed it and then the fix wasn't good enough so we removed it." @@ -29,7 +29,7 @@ (name->human-readable-name \"cool_toucans\") ;-> \"Cool Toucans\" ;; this is the same as: (name->human-readable-name (humanization-strategy) \"cool_toucans\") ;-> \"Cool Toucans\" - ;; specifiy a different strategy: + ;; specify a different strategy: (name->human-readable-name :none \"cool_toucans\") ;-> \"cool_toucans\"" ([s] (name->human-readable-name (humanization-strategy) s)) diff --git a/src/metabase/models/interface.clj b/src/metabase/models/interface.clj index c0e3bac53f7..9699b7ab125 100644 --- a/src/metabase/models/interface.clj +++ b/src/metabase/models/interface.clj @@ -277,7 +277,7 @@ (defn transform-validator "Given a transform, returns a transform that call `assert-fn` on the \"out\" value. - E.g: A keyword transfomer that throw an error if the value is not namespaced + E.g: A keyword transformer that throw an error if the value is not namespaced (transform-validator transform-keyword (fn [x] (when-not (-> x namespace some?) diff --git a/src/metabase/models/serialization.clj b/src/metabase/models/serialization.clj index be287cf0523..3ba20190d57 100644 --- a/src/metabase/models/serialization.clj +++ b/src/metabase/models/serialization.clj @@ -191,7 +191,7 @@ mi/dispatch-on-model) (defn- increment-hash-values - "Potenially adds a new value to the list of input seq based on increment. Used to 'increment' a hash value to avoid duplicates." + "Potentially adds a new value to the list of input seq based on increment. Used to 'increment' a hash value to avoid duplicates." [values increment] (if (= increment 0) values @@ -418,7 +418,7 @@ - `:skip`: a vector of field names, used it tests to check if all fields were specified (`:id` and `:updated_at` are always skipped, no need to mention them). - `:transform`: is a map like `{:field-name {:export (fn [v] ...) :import (fn [v] ...)}}`. For behavior see docs - on `extract-one` and `xform-one`. There are a number of transfomers, see this field for `fk` and similar. + on `extract-one` and `xform-one`. There are a number of transformers, see this field for `fk` and similar. - `:coerce`: a map like `{:field-name Schema}`; incoming data will be coerced to schema after `:import`/`:copy`. Example (search codebase for more examples): @@ -633,7 +633,7 @@ ;;; ;;; - `(ingest-one serdes-path opts)` is called to read the value into memory, then ;;; - `(dependencies ingested)` gets a list of other `:serdes/meta` paths need to be loaded first. -;;; - See below on depenencies. +;;; - See below on dependencies. ;;; - Dependencies are loaded recursively in postorder; that is an entity is loaded after all its deps. ;;; - Circular dependencies will make the load process throw. ;;; - Once an entity's deps are all loaded, we check for an existing one: @@ -1182,7 +1182,7 @@ (if (= db-id lib.schema.id/saved-questions-virtual-database-id) "database/__virtual" (t2/select-one-fn :name :model/Database :id db-id))) - (:card_id :card-id) #(*export-fk* % :model/Card) ; attibutes that refer to db fields use `_`; template-tags use `-` + (:card_id :card-id) #(*export-fk* % :model/Card) ; attributes that refer to db fields use `_`; template-tags use `-` (:source_table :source-table) export-source-table ::mb.viz/param-mapping-source *export-field-fk* :segment #(*export-fk* % :model/Segment) @@ -1419,7 +1419,7 @@ (defn- json-mbql-fully-qualified-names->ids "Converts fully qualified names to IDs in MBQL embedded inside a JSON string. - Returns a new JSON string with teh IDs converted inside." + Returns a new JSON string with the IDs converted inside." [json-str] (-> json-str json/decode+kw diff --git a/src/metabase/parameters/chain_filter.clj b/src/metabase/parameters/chain_filter.clj index d1673bdeac0..a6f312dafc3 100644 --- a/src/metabase/parameters/chain_filter.clj +++ b/src/metabase/parameters/chain_filter.clj @@ -112,7 +112,7 @@ (def ^:dynamic *enable-reverse-joins* "Whether to chain filter via joins where we must follow relationships in reverse, e.g. child -> parent (e.g. - Restaurant -> Category instead of the usual Category -> Restuarant*) + Restaurant -> Category instead of the usual Category -> Restaurant*) This switch mostly exists because I'm not 100% sure what the right behavior is." true) diff --git a/src/metabase/parameters/field_values.clj b/src/metabase/parameters/field_values.clj index ac5c64670db..3bef11e8363 100644 --- a/src/metabase/parameters/field_values.clj +++ b/src/metabase/parameters/field_values.clj @@ -108,7 +108,7 @@ (:id field) constraints {}) ;; we have a hard limit for how many values we want to store in FieldValues, ;; let's make sure we respect that limit here. - ;; For a more detailed docs on this limt check out [[field-values/distinct-values]] + ;; For a more detailed docs on this limit check out [[field-values/distinct-values]] limited-values (field-values/take-by-length field-values/*total-max-length* values)] {:values limited-values :has_more_values (or (> (count values) diff --git a/src/metabase/parameters/params.clj b/src/metabase/parameters/params.clj index 4b9e0c7a01e..18fd0b7907b 100644 --- a/src/metabase/parameters/params.clj +++ b/src/metabase/parameters/params.clj @@ -32,7 +32,7 @@ ;;; +----------------------------------------------------------------------------------------------------------------+ (defn assert-valid-parameters - "Receive a Paremeterized Object and check if its parameters is valid." + "Receive a Parameterized Object and check if its parameters is valid." [{:keys [parameters]}] (let [schema [:maybe ::parameters.schema/parameters]] (when-let [error (mr/explain schema parameters)] @@ -42,7 +42,7 @@ :errors (:errors error)}))))) (defn assert-valid-parameter-mappings - "Receive a Paremeterized Object and check if its parameters is valid." + "Receive a Parameterized Object and check if its parameters is valid." [{parameter-mappings :parameter_mappings}] (let [schema [:maybe [:sequential ::parameters.schema/parameter-mapping]]] (when-not (mr/validate schema parameter-mappings) @@ -223,7 +223,7 @@ ctx))) (def ^:dynamic *field-id-context* - "Conext for effective computation of field ids for parameters. Bound in + "Context for effective computation of field ids for parameters. Bound in the [[metabase.dashboards-rest.api/hydrate-dashboard-details]]. Meant to be used in the [[field-id-into-context-rf]], to re-use values of previous `filterable-columns` computations (during the reduction itself and hydration of `:param_fields` and `:param_values` at the time of writing)." @@ -319,7 +319,7 @@ (into #{} cat (vals param-id->field-ids)))) (defn get-linked-field-ids - "Retrieve a map relating paramater ids to field ids." + "Retrieve a map relating parameter ids to field ids." [dashcards] (letfn [(targets [{params :parameter_mappings card :card, :as _dashcard}] (into {} diff --git a/src/metabase/parameters/shared.cljc b/src/metabase/parameters/shared.cljc index 7131450ca2b..6ba73f6f9d6 100644 --- a/src/metabase/parameters/shared.cljc +++ b/src/metabase/parameters/shared.cljc @@ -224,7 +224,7 @@ #"\{\{\s*([A-Za-z0-9_\.]+?)\s*\}\}") (def ^:private template-tag-splitting-regex - "A regex for spliting text around template tags. This should be identical to `template-tag-regex` above, but without + "A regex for splitting text around template tags. This should be identical to `template-tag-regex` above, but without the capture group around the tag name." #"\{\{\s*[A-Za-z0-9_\.]+?\s*\}\}") diff --git a/src/metabase/permissions/models/data_permissions/sql.clj b/src/metabase/permissions/models/data_permissions/sql.clj index 726e6cf2b41..7e1ca89650b 100644 --- a/src/metabase/permissions/models/data_permissions/sql.clj +++ b/src/metabase/permissions/models/data_permissions/sql.clj @@ -104,7 +104,7 @@ :having [(perm-condition perm-type required-level (or most-or-least :least))]}]) (def UserInfo - "The user-id to use in the visiblity query and their superuser status." + "The user-id to use in the visibility query and their superuser status." [:map [:user-id pos-int?] [:is-superuser? :boolean]]) diff --git a/src/metabase/permissions/models/permissions.clj b/src/metabase/permissions/models/permissions.clj index 8a9fc47702a..554363ecb97 100644 --- a/src/metabase/permissions/models/permissions.clj +++ b/src/metabase/permissions/models/permissions.clj @@ -262,7 +262,7 @@ this :- [:map [:collection_id [:maybe ms/PositiveInt]]] read-or-write :- [:enum :read :write]] - ;; based on value of read-or-write determine the approprite function used to calculate the perms path + ;; based on value of read-or-write determine the appropriate function used to calculate the perms path (let [path-fn (case read-or-write :read permissions.path/collection-read-path :write permissions.path/collection-readwrite-path) @@ -358,10 +358,10 @@ "Delete all 'related' permissions for `group-or-id` (i.e., perms that grant you full or partial access to `path`). This includes *both* ancestor and descendant paths. For example: - Suppose we asked this functions to delete related permssions for `/db/1/schema/PUBLIC/`. Depending on the + Suppose we asked this functions to delete related permissions for `/db/1/schema/PUBLIC/`. Depending on the permissions the group has, it could end up doing something like: - * deleting `/db/1/` permissions (because the ancestor perms implicity grant you full perms for `schema/PUBLIC`) + * deleting `/db/1/` permissions (because the ancestor perms implicitly grant you full perms for `schema/PUBLIC`) * deleting perms for `/db/1/schema/PUBLIC/table/2/` (because Table 2 is a descendant of `schema/PUBLIC`) In short, it will delete any permissions that contain `/db/1/schema/` as a prefix, or that themeselves are prefixes @@ -437,12 +437,12 @@ ; Audit permissions helper fns end (defn revoke-application-permissions! - "Remove all permissions entries for a Group to access a Application permisisons" + "Remove all permissions entries for a Group to access a Application permissions" [group-or-id perm-type] (delete-related-permissions! group-or-id (permissions.path/application-perms-path perm-type))) (defn grant-application-permissions! - "Grant full permissions for a group to access a Application permisisons." + "Grant full permissions for a group to access a Application permissions." [group-or-id perm-type] (when (and (perms-group/is-tenant-group? group-or-id) (not= perm-type :subscription)) diff --git a/src/metabase/permissions/schema.clj b/src/metabase/permissions/schema.clj index edbc6806019..fa33a7b6a7d 100644 --- a/src/metabase/permissions/schema.clj +++ b/src/metabase/permissions/schema.clj @@ -7,7 +7,7 @@ ;; IMPORTANT: If you add a new permission type, `:values` must be ordered from *most* permissive to *least* permissive. ;; ;; - When fetching a user's permissions, the default behavior is to return the *most* permissive value from any group the -;; user is in. This can be overridden by definding a custom implementation of `coalesce`. +;; user is in. This can be overridden by defining a custom implementation of `coalesce`. ;; ;; - If a user does not have any value for the permission when it is fetched, the *least* permissive value is used as a ;; fallback. diff --git a/src/metabase/permissions/util.clj b/src/metabase/permissions/util.clj index 8ab3cf7b29b..d7de5a974b4 100644 --- a/src/metabase/permissions/util.clj +++ b/src/metabase/permissions/util.clj @@ -158,7 +158,7 @@ "Any path starting with /application is a permissions that is not scoped by database or collection /application/setting/ -> permissions to access /admin/settings page /application/monitoring/ -> permissions to access tools, audit and troubleshooting - /application/subscription/ -> permisisons to create/edit subscriptions and alerts" + /application/subscription/ -> permissions to create/edit subscriptions and alerts" [:and "application/" [:or "setting/" "monitoring/" "subscription/"]]) diff --git a/src/metabase/permissions_rest/data_permissions/graph.clj b/src/metabase/permissions_rest/data_permissions/graph.clj index a9e82ac68d3..fbd25ac8a22 100644 --- a/src/metabase/permissions_rest/data_permissions/graph.clj +++ b/src/metabase/permissions_rest/data_permissions/graph.clj @@ -424,7 +424,7 @@ :data-model (update-db-level-metadata-permissions! group-id db-id new-perms) :details (update-details-perms! group-id db-id new-perms)))))) - ;; The following arity is provided soley for convenience for tests/REPL usage + ;; The following arity is provided solely for convenience for tests/REPL usage ([ks :- [:vector :any] new-value] (update-data-perms-graph!* (assoc-in (-> api-graph :groups) ks new-value)))) @@ -441,6 +441,6 @@ (delete-impersonations-if-needed-after-permissions-change! group-updates) (delete-gtaps-if-needed-after-permissions-change! group-updates)))))) - ;; The following arity is provided soley for convenience for tests/REPL usage + ;; The following arity is provided solely for convenience for tests/REPL usage ([ks :- [:vector :any] new-value] (update-data-perms-graph! (assoc-in (api-graph) (cons :groups ks) new-value)))) diff --git a/src/metabase/pivot/core.cljc b/src/metabase/pivot/core.cljc index 2e9c2643ae4..3afae1700b5 100644 --- a/src/metabase/pivot/core.cljc +++ b/src/metabase/pivot/core.cljc @@ -18,7 +18,7 @@ (js->clj (js/JSON.parse x)))) (defn- ensure-consistent-type - "Convert Clojure value that may have ambigous type into canonical type to ensure it can be used as a key. + "Convert Clojure value that may have ambiguous type into canonical type to ensure it can be used as a key. Does nothing in CLJS." [x] #?(:cljs x diff --git a/src/metabase/plugins/init_steps.clj b/src/metabase/plugins/init_steps.clj index 6dc018faa5f..8bb910b9a35 100644 --- a/src/metabase/plugins/init_steps.clj +++ b/src/metabase/plugins/init_steps.clj @@ -1,7 +1,7 @@ (ns metabase.plugins.init-steps "Logic for performing the `init-steps` listed in a Metabase plugin's manifest. For driver plugins that specify that we should `lazy-load`, these steps are lazily performed the first time non-trivial driver methods (such as connecting - to a Database) are called; for all other Metabase plugins these are perfomed during launch. + to a Database) are called; for all other Metabase plugins these are performed during launch. The entire list of possible init steps is below, as impls for the `do-init-step!` multimethod." (:require diff --git a/src/metabase/plugins/lazy_loaded_driver.clj b/src/metabase/plugins/lazy_loaded_driver.clj index d9206f4b4d9..67e2848f56c 100644 --- a/src/metabase/plugins/lazy_loaded_driver.clj +++ b/src/metabase/plugins/lazy_loaded_driver.clj @@ -67,7 +67,7 @@ ;; manually call it. When we do so we don't want to get stuck in an infinite loop of calls back to this ;; implementation (remove-method driver/initialize! driver) - ;; ok, do the init steps listed in the plugin mainfest + ;; ok, do the init steps listed in the plugin manifest (u/profile (u/format-color 'magenta (trs "Load lazy loading driver {0}" driver)) (init-steps/do-init-steps! init-steps)) ;; ok, now go ahead and call `driver/initialize!` a second time on the driver in case it actually has diff --git a/src/metabase/premium_features/token_check.clj b/src/metabase/premium_features/token_check.clj index 6c34f39d83f..e37c31821ca 100644 --- a/src/metabase/premium_features/token_check.clj +++ b/src/metabase/premium_features/token_check.clj @@ -223,7 +223,7 @@ (declare decode-airgap-token) (mu/defn max-users-allowed :- [:maybe pos-int?] - "Returns the max users value from an airgapped key, or nil indicating there is no limt." + "Returns the max users value from an airgapped key, or nil indicating there is no limit." [] (when-let [token (premium-features.settings/premium-embedding-token)] (when (str/starts-with? token "airgap_") @@ -450,7 +450,7 @@ (error-catching-token-checker))) (def token-checker - "The token checker. Combines http/airgapping vaildation, circuit breaking, grace periods, caching, and error + "The token checker. Combines http/airgapping validation, circuit breaking, grace periods, caching, and error handling." (make-checker {:base store-and-airgap-token-checker :circuit-breaker {:failure-threshold-ratio-in-period [10 10 (u/seconds->ms 10)] diff --git a/src/metabase/pulse/task/send_pulses.clj b/src/metabase/pulse/task/send_pulses.clj index 3c37a6bfe47..d047a33fa27 100644 --- a/src/metabase/pulse/task/send_pulses.clj +++ b/src/metabase/pulse/task/send_pulses.clj @@ -214,7 +214,7 @@ (some? remove-pc-ids) (set/difference (set remove-pc-ids))) (set add-pc-ids))] (cond - ;; no op when new-pc-ids doesnt't change + ;; no op when new-pc-ids doesn't change (= new-pc-ids existing-pc-ids) nil ;; delete if no new pc-ids and there is an existing trigger diff --git a/src/metabase/queries/models/card.clj b/src/metabase/queries/models/card.clj index 4ab155b4f8b..cb1c53a4eab 100644 --- a/src/metabase/queries/models/card.clj +++ b/src/metabase/queries/models/card.clj @@ -211,7 +211,7 @@ (some-> card :dataset_query not-empty lib/all-source-table-ids)) (mu/defn- prefetch-tables-for-cards! - "Collect tables from `dataset-cards` and prefetch metadata. Should be used only with metdata provider caching + "Collect tables from `dataset-cards` and prefetch metadata. Should be used only with metadata provider caching enabled, as per https://github.com/metabase/metabase/pull/45050. Returns `nil`." [cards-with-non-empty-queries :- [:maybe [:sequential @@ -542,7 +542,7 @@ (let [param-id->parameter (m/index-by :id parameters)] (->> param-cards (filter (fn [param-card] - ;; if cant find the value-field in result_metadata, then we should + ;; if can't find the value-field in result_metadata, then we should ;; remove it ;; existing usage -- do not use this in new code #_{:clj-kondo/ignore [:deprecated-var]} @@ -1102,13 +1102,13 @@ not-empty))) (defn- eligible-mapping? - "Decide whether parameter mapping has strucuture so it can be updated presumably using [[update-mapping]]." + "Decide whether parameter mapping has structure so it can be updated presumably using [[update-mapping]]." [{[dim [ref-kind]] :target :as _mapping}] (and (= dim :dimension) (#{:field :expression} ref-kind))) (defn- update-mapping - "Return modifed mapping according to action." + "Return modified mapping according to action." [identifier->action {[_dim field-ref] :target :as mapping}] (let [identifier (mbql-clause->identifier-for-parameter-updates field-ref) [action arg] (get identifier->action identifier)] diff --git a/src/metabase/queries/models/card/metadata.clj b/src/metabase/queries/models/card/metadata.clj index bf91e3d4eb3..1083e01bbab 100644 --- a/src/metabase/queries/models/card/metadata.clj +++ b/src/metabase/queries/models/card/metadata.clj @@ -88,7 +88,7 @@ saved later when it is ready." (mu/defn maybe-async-result-metadata :- ::maybe-async-result-metadata "Return result metadata for the passed in `query`. If metadata needs to be recalculated, waits up to - [[metadata-sync-wait-ms]] for it to be recalcuated; if not recalculated by then, returns a map with + [[metadata-sync-wait-ms]] for it to be recalculated; if not recalculated by then, returns a map with `:metadata-future`. Otherwise returns a map with `:metadata`. Takes the `original-query` so it can determine if existing `metadata` might still be valid. Takes `dataset?` since @@ -119,7 +119,7 @@ saved later when it is ready." (log/debug "Reusing provided metadata") {:metadata metadata}) - ;; frontend always sends query. But sometimes programatic don't (cypress, API usage). Returning an empty channel + ;; frontend always sends query. But sometimes programmatic don't (cypress, API usage). Returning an empty channel ;; means the metadata won't be updated at all. (nil? query) (do diff --git a/src/metabase/queries/schema.clj b/src/metabase/queries/schema.clj index b12e8663e03..fe16f659f75 100644 --- a/src/metabase/queries/schema.clj +++ b/src/metabase/queries/schema.clj @@ -53,7 +53,7 @@ :any]]) ;;; TODO (Cam 9/29/25) -- fill this out more, `:metabase.lib.schema.metadata/card` has a lot of stuff and there's also -;;; stuff sprinkled thruout this module. For example [[metabase.queries-rest.api.card/CardUpdateSchema]] should get merged +;;; stuff sprinkled throughout this module. For example [[metabase.queries-rest.api.card/CardUpdateSchema]] should get merged ;;; into this ;;; ;;; TODO (Cam 9/30/25) -- consider renaming this to `:model/Card` so it can serve as the "official" schema of a Card diff --git a/src/metabase/queries_rest/api/card.clj b/src/metabase/queries_rest/api/card.clj index 9b80971e5d4..29e8cbcb51f 100644 --- a/src/metabase/queries_rest/api/card.clj +++ b/src/metabase/queries_rest/api/card.clj @@ -772,7 +772,7 @@ (defn- update-collection-positions! "For cards that have a position in the previous collection, add them to the end of the new collection, trying to - preseve the order from the original collections. Note it's possible for there to be multiple collections + preserve the order from the original collections. Note it's possible for there to be multiple collections (and thus duplicate collection positions) merged into this new collection. No special tie breaker logic for when that's the case, just use the order the DB returned it in" [new-collection-id-or-nil cards] @@ -797,7 +797,7 @@ {:collection_position idx :collection_id new-collection-id-or-nil})) ;; These are reversed because of the classic issue when removing an item from array. If we remove an - ;; item at index 1, everthing above index 1 will get decremented. By reversing our processing order we + ;; item at index 1, everything above index 1 will get decremented. By reversing our processing order we ;; can avoid changing the index of cards we haven't yet updated (reverse (range starting-position (+ (count sorted-cards) starting-position))) (reverse sorted-cards))))) @@ -820,7 +820,7 @@ (doseq [old-collection-id (set (filter identity (map :collection_id cards)))] (api/write-check :model/Collection old-collection-id)) - ;; Ensure all of the card updates occur in a transaction. Read commited (the default) really isn't what we want + ;; Ensure all of the card updates occur in a transaction. Read committed (the default) really isn't what we want ;; here. We are querying for the max card position for a given collection, then using that to base our position ;; changes if the cards are moving to a different collection. Without repeatable read here, it's possible we'll ;; get duplicates @@ -878,7 +878,7 @@ ;; ;; POST /api/dashboard/:dashboard-id/queries/:card-id/query ;; - ;; endpoint instead. Or error in that situtation? We're not even validating that you have access to this Dashboard. + ;; endpoint instead. Or error in that situation? We're not even validating that you have access to this Dashboard. (let [resolved-card-id (eid-translation/->id-or-404 :card card-id)] (qp.card/process-query-for-card resolved-card-id :api diff --git a/src/metabase/query_permissions/impl.clj b/src/metabase/query_permissions/impl.clj index 38a99ba951e..bbde114c0c0 100644 --- a/src/metabase/query_permissions/impl.clj +++ b/src/metabase/query_permissions/impl.clj @@ -69,7 +69,7 @@ (and (set? val1) (set? val2)) (set/union val1 val2) - ;; Booleans should only ever be `:native? true`, but make sure we propogate truthy values + ;; Booleans should only ever be `:native? true`, but make sure we propagate truthy values (and (boolean? val1) (boolean? val2)) (or val1 val2) @@ -269,7 +269,7 @@ (as-> $query (legacy-mbql-required-perms mp $query perms-opts))))) (defn required-perms-for-query - "Returns a map representing the permissions requried to run `query`. The map has the optional keys + "Returns a map representing the permissions required to run `query`. The map has the optional keys :paths (containing legacy permission paths), :card-ids, :perms/view-data, and :perms/create-queries." [query & {:as perms-opts}] (if (empty? query) diff --git a/src/metabase/query_processor/api.clj b/src/metabase/query_processor/api.clj index 1639ca56c1d..a5e40eb6e7d 100644 --- a/src/metabase/query_processor/api.clj +++ b/src/metabase/query_processor/api.clj @@ -136,7 +136,7 @@ format-rows :format_rows pivot-results :pivot_results visualization-settings :visualization_settings} - ;; Support JSON-encoded query and viz settings for backwards compatability for when downloads used to be triggered by + ;; Support JSON-encoded query and viz settings for backwards compatibility for when downloads used to be triggered by ;; `
` submissions... see https://metaboat.slack.com/archives/C010L1Z4F9S/p1738003606875659 :- [:map [:query [:map diff --git a/src/metabase/query_processor/card.clj b/src/metabase/query_processor/card.clj index c30d28f5aed..94d8940f853 100644 --- a/src/metabase/query_processor/card.clj +++ b/src/metabase/query_processor/card.clj @@ -118,7 +118,7 @@ filter-stage-added?)) lib/append-stage) query (-> query - ;; don't want default constraints overridding anything that's already there + ;; don't want default constraints overriding anything that's already there (m/dissoc-in [:middleware :add-default-userland-constraints?]) (m/assoc-some :constraints (not-empty constraints) :parameters (not-empty (cond-> parameters diff --git a/src/metabase/query_processor/middleware/add_implicit_clauses.clj b/src/metabase/query_processor/middleware/add_implicit_clauses.clj index 1d3e7a80813..73938f86a67 100644 --- a/src/metabase/query_processor/middleware/add_implicit_clauses.clj +++ b/src/metabase/query_processor/middleware/add_implicit_clauses.clj @@ -1,5 +1,5 @@ (ns metabase.query-processor.middleware.add-implicit-clauses - "Middlware for adding an implicit `:fields` and `:order-by` clauses to certain queries." + "Middleware for adding an implicit `:fields` and `:order-by` clauses to certain queries." (:refer-clojure :exclude [every? empty? not-empty]) (:require [metabase.lib.core :as lib] diff --git a/src/metabase/query_processor/middleware/auto_bucket_datetimes.clj b/src/metabase/query_processor/middleware/auto_bucket_datetimes.clj index a098426304e..4c639720af3 100644 --- a/src/metabase/query_processor/middleware/auto_bucket_datetimes.clj +++ b/src/metabase/query_processor/middleware/auto_bucket_datetimes.clj @@ -148,7 +148,7 @@ (mu/defn- wrap-unbucketed-clauses :- ::lib.schema/stage "Add `:temporal-unit` to `:field`s and `:expression`s in breakouts and filters if appropriate; for fields, look - at corresponing type information in `field-id->type-info` to see if we should do so. For expressions examine the clause + at corresponding type information in `field-id->type-info` to see if we should do so. For expressions examine the clause options." ;; we only want to wrap clauses in `:breakout` and `:filter` so just make a 3-arg version of this fn that takes the ;; name of the clause to rewrite and call that twice diff --git a/src/metabase/query_processor/middleware/binning.clj b/src/metabase/query_processor/middleware/binning.clj index cb9d088091b..e4fe4d3a121 100644 --- a/src/metabase/query_processor/middleware/binning.clj +++ b/src/metabase/query_processor/middleware/binning.clj @@ -78,7 +78,7 @@ metadata min-value max-value) resolved-options (merge min-max resolved-options) - ;; Bail out and use unmodifed version if we can't converge on a nice version. + ;; Bail out and use unmodified version if we can't converge on a nice version. new-options (or (lib.binning.util/nicer-breakout new-strategy resolved-options) resolved-options)] (lib/update-options field-ref update :binning merge {:strategy new-strategy} new-options))) diff --git a/src/metabase/query_processor/middleware/cumulative_aggregations.clj b/src/metabase/query_processor/middleware/cumulative_aggregations.clj index 5a2f1ffe186..d410a65df5e 100644 --- a/src/metabase/query_processor/middleware/cumulative_aggregations.clj +++ b/src/metabase/query_processor/middleware/cumulative_aggregations.clj @@ -1,5 +1,5 @@ (ns metabase.query-processor.middleware.cumulative-aggregations - "Middlware for handling cumulative count and cumulative sum aggregations in Clojure-land. In 0.50.0+, this middleware + "Middleware for handling cumulative count and cumulative sum aggregations in Clojure-land. In 0.50.0+, this middleware is only used for drivers that do not have native implementations of `:window-functions/cumulative`; see the driver changelog for 0.50.0 for more information. @@ -31,7 +31,7 @@ ;;;; Pre-processing (defn- diff-indexes - "Given two sequential collections, return indecies that are different between the two." + "Given two sequential collections, return indices that are different between the two." [coll-1 coll-2] (into #{} (keep-indexed (fn [i transformed?] @@ -60,7 +60,7 @@ (mu/defn rewrite-cumulative-aggregations :- ::lib.schema/query "Pre-processing middleware. Rewrite `:cum-count` and `:cum-sum` aggregations as `:count` and `:sum` respectively. Add - information about the indecies of the replaced aggregations under the `::replaced-indexes` key." + information about the indices of the replaced aggregations under the `::replaced-indexes` key." [query :- ::lib.schema/query] (if (driver.u/supports? driver/*driver* :window-functions/cumulative diff --git a/src/metabase/query_processor/middleware/format_rows.clj b/src/metabase/query_processor/middleware/format_rows.clj index 86b983c21f7..7568425fc9c 100644 --- a/src/metabase/query_processor/middleware/format_rows.clj +++ b/src/metabase/query_processor/middleware/format_rows.clj @@ -15,7 +15,7 @@ "Protocol for determining how QP results of various classes are serialized. Drivers can add implementations to support custom driver types as needed." (format-value [v ^ZoneId timezone-id] - "Serialize a value in the QP results. You can add impementations for driver-specific types as needed.")) + "Serialize a value in the QP results. You can add implementations for driver-specific types as needed.")) (extend-protocol FormatValue nil diff --git a/src/metabase/query_processor/middleware/large_int.clj b/src/metabase/query_processor/middleware/large_int.clj index eac03084ed4..f07c949ff5a 100644 --- a/src/metabase/query_processor/middleware/large_int.clj +++ b/src/metabase/query_processor/middleware/large_int.clj @@ -65,7 +65,7 @@ rf)) (defn- maybe-integer-column? - "Checks if the column might have large interger values." + "Checks if the column might have large integer values." [{:keys [base_type] :as _column-metadata}] (or (isa? base_type :type/Integer) (isa? base_type :type/Decimal))) diff --git a/src/metabase/query_processor/middleware/limit.clj b/src/metabase/query_processor/middleware/limit.clj index 382b530d918..589f8e3b32a 100644 --- a/src/metabase/query_processor/middleware/limit.clj +++ b/src/metabase/query_processor/middleware/limit.clj @@ -91,7 +91,7 @@ ;; Background: SQL Server treats a limit of `0` as meaning "unbounded". SQL Server can override ;; [[qp.constraints/max-results-bare-rows]] with a Database-local Setting to fix #9940, where queries with aggregations ;; and expressions could return the wrong results because of limits being applied to subselects. Realistically the - ;; overriden limit of `0` should probably only apply to the MBQL query and not to the number of rows we take. But we'd + ;; overridden limit of `0` should probably only apply to the MBQL query and not to the number of rows we take. But we'd ;; have to break [[determine-query-max-rows]] into two separate things in order to do that. :shrug: ((take (if-not (pos? max-rows) 1 max-rows)) rf)) diff --git a/src/metabase/query_processor/middleware/metrics.clj b/src/metabase/query_processor/middleware/metrics.clj index b11a02fc6ec..49b366896c7 100644 --- a/src/metabase/query_processor/middleware/metrics.clj +++ b/src/metabase/query_processor/middleware/metrics.clj @@ -308,7 +308,7 @@ :order-by ``` - `:fields` are added explictly to pass previous-stage fields onto the following-stage + `:fields` are added explicitly to pass previous-stage fields onto the following-stage The following stages will have `[:metric {} id]` clauses replaced with the actual aggregation of the metric." diff --git a/src/metabase/query_processor/middleware/optimize_temporal_filters.clj b/src/metabase/query_processor/middleware/optimize_temporal_filters.clj index ff54dc959a9..5c1ec0042e1 100644 --- a/src/metabase/query_processor/middleware/optimize_temporal_filters.clj +++ b/src/metabase/query_processor/middleware/optimize_temporal_filters.clj @@ -1,5 +1,5 @@ (ns metabase.query-processor.middleware.optimize-temporal-filters - "Middlware that optimizes equality filter clauses against bucketed temporal fields. See docstring for + "Middleware that optimizes equality filter clauses against bucketed temporal fields. See docstring for `optimize-temporal-filters` for more details." (:refer-clojure :exclude [get-in]) (:require @@ -306,7 +306,7 @@ clause))) (mu/defn optimize-temporal-filters :- ::lib.schema/query - "Middlware that optimizes equality (`=` and `!=`) and comparison (`<`, `between`, etc.) filter clauses against + "Middleware that optimizes equality (`=` and `!=`) and comparison (`<`, `between`, etc.) filter clauses against bucketed datetime fields. Rewrites those filter clauses as logically equivalent filter clauses that do not use bucketing (i.e., their datetime unit is `:default`, meaning no bucketing functions need be applied). diff --git a/src/metabase/query_processor/middleware/parameters.clj b/src/metabase/query_processor/middleware/parameters.clj index 4fc677c9026..2aca0504074 100644 --- a/src/metabase/query_processor/middleware/parameters.clj +++ b/src/metabase/query_processor/middleware/parameters.clj @@ -134,8 +134,8 @@ (u/update-if-exists stage :template-tags assoc-database-id-in-snippet-tag (:database query)))))) (mu/defn substitute-parameters :- ::lib.schema/query - "Substitute Dashboard or Card-supplied parameters in a query, replacing the param placeholers with appropriate values - and/or modifiying the query as appropriate. This looks for maps that have the key `:parameters` and/or + "Substitute Dashboard or Card-supplied parameters in a query, replacing the param placeholders with appropriate values + and/or modifying the query as appropriate. This looks for maps that have the key `:parameters` and/or `:template-tags` and removes those keys, splicing appropriate conditions into the queries they affect. A SQL query with a param like `{{param}}` will have that part of the query replaced with an appropriate snippet as diff --git a/src/metabase/query_processor/middleware/permissions.clj b/src/metabase/query_processor/middleware/permissions.clj index d27216b3294..feff62df251 100644 --- a/src/metabase/query_processor/middleware/permissions.clj +++ b/src/metabase/query_processor/middleware/permissions.clj @@ -67,7 +67,7 @@ (defn remove-permissions-key "Pre-processing middleware. Removes the `:query-permissions/perms` key from the query. This is where we store important permissions - information like perms coming from sandboxing (GTAPs). This is programatically added by middleware when appropriate, + information like perms coming from sandboxing (GTAPs). This is programmatically added by middleware when appropriate, but we definitely don't want users passing it in themselves. So remove it if it's present." [query] (dissoc query :query-permissions/perms)) @@ -107,7 +107,7 @@ (let [required-perms (query-perms/required-perms-for-query outer-query :already-preprocessed? true) source-card-ids (set/difference (:card-ids required-perms) (:card-ids gtap-perms))] ;; On EE, check block permissions up front for all queries. If block perms are in place, reject all native queries - ;; (unless overriden by `gtap-perms`) and any queries that touch blocked tables/DBs + ;; (unless overridden by `gtap-perms`) and any queries that touch blocked tables/DBs (check-block-permissions outer-query) (cond ;; if card-id is bound this means that this is not an ad hoc query and we can just diff --git a/src/metabase/query_processor/parameters/dates.clj b/src/metabase/query_processor/parameters/dates.clj index de61a986573..c9b4dae1576 100644 --- a/src/metabase/query_processor/parameters/dates.clj +++ b/src/metabase/query_processor/parameters/dates.clj @@ -166,7 +166,7 @@ (when-let [regex-result (re-matches regex param-value)] (into {} (mapcat expand-parser-groups group-labels (rest regex-result)))))) -;; Decorders consist of: +;; Decoders consist of: ;; 1) Parser which tries to parse the date parameter string ;; 2) Range decoder which takes the parser output and produces a date range relative to the given datetime ;; 3) Filter decoder which takes the parser output and produces a mbql clause for a given mbql field reference diff --git a/src/metabase/query_processor/streaming/interface.clj b/src/metabase/query_processor/streaming/interface.clj index 0ff9de15d59..aa805b27def 100644 --- a/src/metabase/query_processor/streaming/interface.clj +++ b/src/metabase/query_processor/streaming/interface.clj @@ -22,7 +22,7 @@ (finish! [this final-metadata] "Write anything needed after writing the last row. `final-metadata` is the final, complete metadata available after reducing all rows. Very important: This method *must* `.close` the underlying OutputStream when it is - finshed.")) + finished.")) (defmulti streaming-results-writer "Given a `export-format` and `java.io.Writer`, return an object that implements `StreamingResultsWriter`." diff --git a/src/metabase/query_processor/streaming/xlsx.clj b/src/metabase/query_processor/streaming/xlsx.clj index 1eb8f33ae3c..4e1e3ca0947 100644 --- a/src/metabase/query_processor/streaming/xlsx.clj +++ b/src/metabase/query_processor/streaming/xlsx.clj @@ -2,7 +2,7 @@ (:refer-clojure :exclude [mapv some]) (:require [clojure.string :as str] - [dk.ative.docjure.spreadsheet :as spreadsheet] + [dk.ative.docjure.spreadsheet :as spreadsheet] ; codespell:ignore ative [java-time.api :as t] [medley.core :as m] [metabase.formatter.core :as formatter] @@ -107,7 +107,7 @@ [{::mb.viz/keys [prefix suffix number-style number-separators currency-in-header decimals] :as format-settings}] (let [format-strings (let [base-string (if (= number-separators ".") - ;; Omit thousands separator if ommitted in the format settings. Otherwise ignore + ;; Omit thousands separator if omitted in the format settings. Otherwise ignore ;; number separator settings, since custom separators are not supported in XLSX. "###0" "#,##0") @@ -416,7 +416,7 @@ "The format-rows qp middleware formats rows into strings, which circumvents the formatting done in this namespace. To gain the formatting back, we parse the temporal strings back into their java.time objects. - TODO: find a way to avoid this java.time -> string -> java.time conversion by making sure the format-rows middlware + TODO: find a way to avoid this java.time -> string -> java.time conversion by making sure the format-rows middleware works effectively with the streaming-results-writer implementations for CSV, JSON, and XLSX. A hint towards a better solution is to add into the format-rows middleware the use of viz-settings/column-formatting that is used inside `metabase.formatter/create-formatter`." diff --git a/src/metabase/remote_sync/core.clj b/src/metabase/remote_sync/core.clj index 6ed9e889e40..c2712d7838e 100644 --- a/src/metabase/remote_sync/core.clj +++ b/src/metabase/remote_sync/core.clj @@ -3,7 +3,7 @@ [metabase.premium-features.core :refer [defenterprise]])) (defenterprise collection-editable? - "Returns if remote-synced collections are editable. Takes a collection to check for eligability. + "Returns if remote-synced collections are editable. Takes a collection to check for eligibility. Always true on OSS." metabase-enterprise.remote-sync.core diff --git a/src/metabase/request/cookies.clj b/src/metabase/request/cookies.clj index ee3fb918d0a..0036a76f55a 100644 --- a/src/metabase/request/cookies.clj +++ b/src/metabase/request/cookies.clj @@ -121,7 +121,7 @@ metabase-embedded-session-cookie)) (defn- use-permanent-cookies? - "Check if we should use permanent cookies for a given request, which are not cleared when a browser sesion ends." + "Check if we should use permanent cookies for a given request, which are not cleared when a browser session ends." [request] (if (session.settings/session-cookies) ;; Disallow permanent cookies if MB_SESSION_COOKIES is set diff --git a/src/metabase/search/in_place/filter.clj b/src/metabase/search/in_place/filter.clj index 85793a0c7b6..7ea136f0559 100644 --- a/src/metabase/search/in_place/filter.clj +++ b/src/metabase/search/in_place/filter.clj @@ -241,7 +241,7 @@ (sql.helpers/where (date-range-filter-clause :revision.timestamp last-edited-at))))) ;; These filters are really only supported by the :appdb engine as they require a search index. -;; By building this no-op filter definition for the in-place engine we can atleast appropriately +;; By building this no-op filter definition for the in-place engine we can at least appropriately ;; reduce the intended supported models that are searched. See PR 60912 (doseq [model ["card" "dataset" "metric"]] (defmethod build-optional-filter-query [:non-temporal-dim-ids model] diff --git a/src/metabase/search/models/search_index_metadata.clj b/src/metabase/search/models/search_index_metadata.clj index 796a273ef66..5bc3c1de078 100644 --- a/src/metabase/search/models/search_index_metadata.clj +++ b/src/metabase/search/models/search_index_metadata.clj @@ -23,7 +23,7 @@ (t/days 1)) (defn indexes - "The current 'pending' and 'active' indexes for the given co-ordinates, where they exist." + "The current 'pending' and 'active' indexes for the given coordinates, where they exist." [engine version] (let [pending-cut-off (t/minus (t/offset-date-time) pending-table-cut-off)] (->> (t2/select [:model/SearchIndexMetadata :index_name :status :created_at] diff --git a/src/metabase/search/spec.clj b/src/metabase/search/spec.clj index 81bd2a0a504..73df12de8ab 100644 --- a/src/metabase/search/spec.clj +++ b/src/metabase/search/spec.clj @@ -356,7 +356,7 @@ Attribute value formats: - `true` - Use column with same name (snake_case) - `:column_name` - Use specified database column - - `{:fn function :fields [:field1 :field2]}` - Execute a clojure funtion at index time with the given fields" + - `{:fn function :fields [:field1 :field2]}` - Execute a clojure function at index time with the given fields" [search-model spec] `(do ;; Capture raw form before evaluation (symbols stay as symbols, not function objects) diff --git a/src/metabase/server/handler.clj b/src/metabase/server/handler.clj index fa04ada943b..a81722b59bf 100644 --- a/src/metabase/server/handler.clj +++ b/src/metabase/server/handler.clj @@ -90,7 +90,7 @@ #'wrap-cookies ; Parses cookies in the request map and assocs as :cookies #'mw.misc/add-version ; Adds a X-Metabase-Version header to the response #'mw.misc/add-content-type ; Adds a Content-Type header for any response that doesn't already have one - #'mw.misc/disable-streaming-buffering ; Add header to streaming (async) responses so ngnix doesn't buffer keepalive bytes + #'mw.misc/disable-streaming-buffering ; Add header to streaming (async) responses so nginx doesn't buffer keepalive bytes #'wrap-gzip ; GZIP response if client can handle it #'mw.request-id/wrap-request-id ; Add a unique request ID to the request #'mw.misc/bind-request ; bind `metabase.middleware.misc/*request*` for the duration of the request diff --git a/src/metabase/server/middleware/log.clj b/src/metabase/server/middleware/log.clj index e5ea149b966..2fa57b13a73 100644 --- a/src/metabase/server/middleware/log.clj +++ b/src/metabase/server/middleware/log.clj @@ -175,7 +175,7 @@ (log-info (assoc info :async-status (name result))))))) (defn- logged-response - "Log an API response. Returns resonse, possibly modified (i.e., core.async channels will be wrapped); this value + "Log an API response. Returns response, possibly modified (i.e., core.async channels will be wrapped); this value should be passed to the normal `respond` function." [{{:keys [body], :as response} :response, :as info}] (condp instance? body diff --git a/src/metabase/session/api.clj b/src/metabase/session/api.clj index 480e442e06e..96b65f98220 100644 --- a/src/metabase/session/api.clj +++ b/src/metabase/session/api.clj @@ -85,7 +85,7 @@ (throttle/check throttler throttle-key))) (mu/defn- login :- session.schema/SessionSchema - "Attempt to login with different avaialable methods with `username` and `password`, returning new Session ID or + "Attempt to login with different available methods with `username` and `password`, returning new Session ID or throwing an Exception if login could not be completed." [username :- ms/NonBlankString password :- ms/NonBlankString diff --git a/src/metabase/session/settings.clj b/src/metabase/session/settings.clj index dd3da113815..870211836cb 100644 --- a/src/metabase/session/settings.clj +++ b/src/metabase/session/settings.clj @@ -13,7 +13,7 @@ :feature :disable-password-login :audit :raw-value :getter (fn [] - ;; if `:enable-password-login` has an *explict* (non-default) value, and SSO is configured, use that; + ;; if `:enable-password-login` has an *explicit* (non-default) value, and SSO is configured, use that; ;; otherwise this always returns true. (let [v (setting/get-value-of-type :boolean :enable-password-login)] (if (and (some? v) diff --git a/src/metabase/settings/models/setting.clj b/src/metabase/settings/models/setting.clj index c2f6b4d1554..3e3e5f5ea71 100644 --- a/src/metabase/settings/models/setting.clj +++ b/src/metabase/settings/models/setting.clj @@ -198,7 +198,7 @@ ;; description is validated via the macro, not schema ;; Use `:doc` to include a map with additional documentation, for use when generating the environment variable docs - ;; from source. To exclude a setting from documenation, set to `false`. See metabase.cmd.env-var-dox. + ;; from source. To exclude a setting from documentation, set to `false`. See metabase.cmd.env-var-dox. [:description :any] [:doc :any] @@ -1238,7 +1238,7 @@ ###### `:visibility` - Controls where this setting is visibile, and who can update it. Possible values are: + Controls where this setting is visible, and who can update it. Possible values are: Visibility | Who Can See It? | Who Can Update It? ---------------- | ---------------------------- | -------------------- @@ -1275,7 +1275,7 @@ Is this a sensitive setting, such as a password, that we should never return in plaintext? (Default: `false`). Obfuscation is not done by getter functions, but instead by functions that ultimately return these values via the - API, such as [[writable-settings]] below. (In other words, code in the backend can continute to consume + API, such as [[writable-settings]] below. (In other words, code in the backend can continue to consume sensitive Settings normally; sensitivity is a purely user-facing option.) ###### `:database-local` diff --git a/src/metabase/settings/models/setting/cache.clj b/src/metabase/settings/models/setting/cache.clj index 1662ea1c8fa..63c1c3c8699 100644 --- a/src/metabase/settings/models/setting/cache.clj +++ b/src/metabase/settings/models/setting/cache.clj @@ -60,7 +60,7 @@ ;; locally cached value is older than the one in the DB, we will flush our cache. When the cache is fetched again, it ;; will have the up-to-date value. ;; -;; Because different machines can have out-of-sync clocks, we'll rely entirely on the application DB for caclulating +;; Because different machines can have out-of-sync clocks, we'll rely entirely on the application DB for calculating ;; and comparing values of `settings-last-updated`. Because the Setting table itself only stores text values, we'll ;; need to cast it between TEXT and TIMESTAMP SQL types as needed. diff --git a/src/metabase/setup/core.clj b/src/metabase/setup/core.clj index 704a535707e..30a2cea5488 100644 --- a/src/metabase/setup/core.clj +++ b/src/metabase/setup/core.clj @@ -23,5 +23,5 @@ (setting/restore-cache!) (or (setup.settings/setup-token) ;; I guess we can't use `setup-token!` because it's marked as `:setter :none` even tho we are literally setting it - ;; right here. `:setter :none` is meant for settings whose values are programatically generated -- Cam + ;; right here. `:setter :none` is meant for settings whose values are programmatically generated -- Cam (setting/set-value-of-type! :string :setup-token (str (random-uuid))))) diff --git a/src/metabase/setup/settings.clj b/src/metabase/setup/settings.clj index 3c2020100aa..9c132e4b284 100644 --- a/src/metabase/setup/settings.clj +++ b/src/metabase/setup/settings.clj @@ -7,7 +7,7 @@ [toucan2.core :as t2])) ;;; TODO -- we actually do set this so it probably shouldn't be `:setter :none`. `:setter :none` is meant for settings -;;; whose values are programatically generated -- Cam +;;; whose values are programmatically generated -- Cam (defsetting setup-token "A token used to signify that an instance has permissions to create the initial User. This is created upon the first launch of Metabase, by the first instance; once used, it is cleared out, never to be used again." diff --git a/src/metabase/sync/analyze/classify.clj b/src/metabase/sync/analyze/classify.clj index 7c9dce6a834..431b7e2622b 100644 --- a/src/metabase/sync/analyze/classify.clj +++ b/src/metabase/sync/analyze/classify.clj @@ -132,7 +132,7 @@ :fields-failed fields-failed})))) (mu/defn ^:always-validate classify-table! - "Run various classifiers on the `table`. These do things like inferring (and setting) entitiy type of `table`." + "Run various classifiers on the `table`. These do things like inferring (and setting) entity type of `table`." [table :- i/TableInstance] (let [updated-table (sync-util/with-error-handling (format "Error running classifier on %s" (sync-util/name-for-logging table)) diff --git a/src/metabase/sync/schedules.clj b/src/metabase/sync/schedules.clj index 531296c2b15..72169f4c349 100644 --- a/src/metabase/sync/schedules.clj +++ b/src/metabase/sync/schedules.clj @@ -28,7 +28,7 @@ [:ref ::ExpandedSchedulesMap]) (mu/defn schedule-map->cron-strings :- CronSchedulesMap - "Convert a map of `:schedules` as passed in by the frontend to a map of cron strings with the approriate keys for + "Convert a map of `:schedules` as passed in by the frontend to a map of cron strings with the appropriate keys for Database. This map can then be merged directly inserted into the DB, or merged with a map of other columns to insert/update." [{:keys [metadata_sync cache_field_values]} :- ExpandedSchedulesMap] diff --git a/src/metabase/sync/sync_metadata/fields.clj b/src/metabase/sync/sync_metadata/fields.clj index 6e18c737ade..88318a5c56f 100644 --- a/src/metabase/sync/sync_metadata/fields.clj +++ b/src/metabase/sync/sync_metadata/fields.clj @@ -26,12 +26,12 @@ `DatabaseMetaData`) describing the columns (or equivalent) currently present in the table (or equivalent) that we're syncing. - * `field-metadata` is a map of information describing a single columnn currently present in the table being synced + * `field-metadata` is a map of information describing a single column currently present in the table being synced * `our-metadata` is a set of maps of Field metadata reconstructed from the Metabase application database. * `metabase-field` is a single map of Field metadata reconstructed from the Metabase application database; there is - a 1:1 correspondance between this metadata and a row in the `Field` table. Unlike `field-metadata`, these entries + a 1:1 correspondence between this metadata and a row in the `Field` table. Unlike `field-metadata`, these entries always have an `:id` associated with them (because they are present in the Metabase application DB). Other notes: diff --git a/src/metabase/sync/sync_metadata/fields/our_metadata.clj b/src/metabase/sync/sync_metadata/fields/our_metadata.clj index fa89a3e62db..88079434eee 100644 --- a/src/metabase/sync/sync_metadata/fields/our_metadata.clj +++ b/src/metabase/sync/sync_metadata/fields/our_metadata.clj @@ -59,7 +59,7 @@ (add-nested-fields nested-field parent-id->fields))))))) (mu/defn fields->our-metadata :- [:set common/TableMetadataFieldWithID] - "Given a sequence of Metabase Fields, format them and return them in a hierachy so the format matches the one + "Given a sequence of Metabase Fields, format them and return them in a hierarchy so the format matches the one `db-metadata` comes back in." ([fields :- [:maybe [:sequential i/FieldInstance]]] (fields->our-metadata fields nil)) diff --git a/src/metabase/sync/sync_metadata/fields/sync_instances.clj b/src/metabase/sync/sync_metadata/fields/sync_instances.clj index 57041d41b4b..f8a5d0dbad0 100644 --- a/src/metabase/sync/sync_metadata/fields/sync_instances.clj +++ b/src/metabase/sync/sync_metadata/fields/sync_instances.clj @@ -114,7 +114,7 @@ (def ^:private Updates "Schema for the value returned by `sync-active-instances!`. Because we need to know about newly-inserted/reactivated - parent Fields when recursively syncing nested Fields, we need to propogate the updates to `our-metadata` made by + parent Fields when recursively syncing nested Fields, we need to propagate the updates to `our-metadata` made by this function and pass them to other steps of the `sync-instances!` process." [:map [:num-updates ms/IntGreaterThanOrEqualToZero] diff --git a/src/metabase/sync/sync_metadata/metabase_metadata.clj b/src/metabase/sync/sync_metadata/metabase_metadata.clj index b0420bc0c04..56e9d61a968 100644 --- a/src/metabase/sync/sync_metadata/metabase_metadata.clj +++ b/src/metabase/sync/sync_metadata/metabase_metadata.clj @@ -58,7 +58,7 @@ (t2/update! :model/Database (u/the-id database) {k value}))))) (mu/defn- sync-metabase-metadata-table! - "Databases may include a table named `_metabase_metadata` (case-insentive) which includes descriptions or other + "Databases may include a table named `_metabase_metadata` (case-insensitive) which includes descriptions or other metadata about the `Tables` and `Fields` it contains. This table is *not* synced normally, i.e. a Metabase `Table` is not created for it. Instead, *this* function is called, which reads the data it contains and updates the relevant Metabase objects. diff --git a/src/metabase/sync/util.clj b/src/metabase/sync/util.clj index dfa1c4f5aff..d3ddd788117 100644 --- a/src/metabase/sync/util.clj +++ b/src/metabase/sync/util.clj @@ -302,7 +302,7 @@ (defmacro with-emoji-progress-bar "Run BODY with access to a function that makes using our amazing emoji-progress-bar easy like Sunday morning. - Calling the function will return the approprate string output for logging and automatically increment an internal + Calling the function will return the appropriate string output for logging and automatically increment an internal counter as needed. (with-emoji-progress-bar [progress-bar 10] @@ -450,7 +450,7 @@ (format "Field ''%s''" field-name)) (mu/defn calculate-duration-str :- :string - "Given two datetimes, caculate the time between them, return the result as a string" + "Given two datetimes, calculate the time between them, return the result as a string" [begin-time :- (ms/InstanceOfClass Temporal) end-time :- (ms/InstanceOfClass Temporal)] (u/format-nanoseconds (.toNanos (t/duration begin-time end-time)))) diff --git a/src/metabase/task/job_factory.clj b/src/metabase/task/job_factory.clj index 2debf384ebb..a5ebb0767e6 100644 --- a/src/metabase/task/job_factory.clj +++ b/src/metabase/task/job_factory.clj @@ -1,6 +1,6 @@ (ns metabase.task.job-factory "Provides a job factory for our quartz scheduler. The primary purpose of the custom factory is to prevent us from mark jobs as 'ERROR' when a metabase instance - picks up a job by cannot find a class to instatiate it. This will occur during rolling upgrades when a newer metabase instance adds a job that an older instance + picks up a job by cannot find a class to instantiate it. This will occur during rolling upgrades when a newer metabase instance adds a job that an older instance does not have a class for." (:require [metabase.util.log :as log]) diff --git a/src/metabase/testing_api/api.clj b/src/metabase/testing_api/api.clj index 6c2e9355f4f..ef959957086 100644 --- a/src/metabase/testing_api/api.clj +++ b/src/metabase/testing_api/api.clj @@ -110,7 +110,7 @@ (finally (.. lock writeLock unlock) ;; don't know why this happens but when I try to test things locally with `yarn-test-cypress-open-no-backend` - ;; and a backend server started with `dev/start!` the snapshots are always missing columms added by DB + ;; and a backend server started with `dev/start!` the snapshots are always missing columns added by DB ;; migrations. So let's just check and make sure it's fully up to date in this scenario. Not doing this outside ;; of dev because it seems to work fine for whatever reason normally and we don't want tests taking 5 million ;; years to run because we're wasting a bunch of time initializing Liquibase and checking for unrun migrations @@ -140,7 +140,7 @@ ;; #_{:clj-kondo/ignore [:metabase/validate-defendpoint-has-response-schema]} (api.macros/defendpoint :post "/echo" - "Simple echo hander. Fails when you POST with `?fail=true`." + "Simple echo handler. Fails when you POST with `?fail=true`." [_route-params {:keys [fail]} :- [:map [:fail {:default false} ms/BooleanValue]] @@ -177,7 +177,7 @@ ;; #_{:clj-kondo/ignore [:metabase/validate-defendpoint-has-response-schema]} (api.macros/defendpoint :get "/echo" - "Simple echo hander. Fails when you GET with `?fail=true`." + "Simple echo handler. Fails when you GET with `?fail=true`." [_route-params {:keys [fail body]} :- [:map [:fail {:default false} ms/BooleanValue] diff --git a/src/metabase/users_rest/api.clj b/src/metabase/users_rest/api.clj index b3b333504f5..9e0d713af95 100644 --- a/src/metabase/users_rest/api.clj +++ b/src/metabase/users_rest/api.clj @@ -251,7 +251,7 @@ (or api/*is-superuser?* api/*is-group-manager?*) (t2/hydrate :group_ids) - ;; if there is a group_id clause, make sure the list is deduped in case the same user is in multiple gropus + ;; if there is a group_id clause, make sure the list is deduped in case the same user is in multiple groups group_id distinct) :total (-> (t2/query @@ -605,7 +605,7 @@ (t2/update! :model/User (u/the-id existing-user) {:is_active true :is_superuser false - ;; if the user orignally logged in via Google Auth/LDAP and it's no longer enabled, convert them into a regular user + ;; if the user originally logged in via Google Auth/LDAP and it's no longer enabled, convert them into a regular user ;; (see metabase#3323) :sso_source (case (:sso_source existing-user) :google (when (sso/google-auth-enabled) :google) diff --git a/src/metabase/util.cljc b/src/metabase/util.cljc index 9ffbde6dae5..c57e8f04b2b 100644 --- a/src/metabase/util.cljc +++ b/src/metabase/util.cljc @@ -402,7 +402,7 @@ (defn maybe? "Returns `true` if X is `nil`, otherwise calls (F X). - This can be used to see something is either `nil` or statisfies a predicate function: + This can be used to see something is either `nil` or satisfies a predicate function: (string? nil) -> false (string? \"A\") -> true @@ -650,7 +650,7 @@ m)) (defn index-of - "Return index of the first element in `coll` for which `pred` reutrns true." + "Return index of the first element in `coll` for which `pred` returns true." [pred coll] (first (keep-indexed (fn [i x] (when (pred x) i)) diff --git a/src/metabase/util/date_2.clj b/src/metabase/util/date_2.clj index ca838114a16..33ebe2828b7 100644 --- a/src/metabase/util/date_2.clj +++ b/src/metabase/util/date_2.clj @@ -322,7 +322,7 @@ (alter-var-root #'t/truncate-to (constantly t.core/truncate-to)) (def truncate-units - "Valid date trucation units" + "Valid date truncation units" #{:millisecond :second :minute :hour :day :week :month :quarter :year}) (mu/defn truncate :- TemporalInstance @@ -471,7 +471,7 @@ (u.date/compare-period-durations (u.date/period-duration #t \"2019-01-01\" #t \"2019-07-01\") \"P11M\") ; -> -1 - Note that this calculation is inexact, since it calclates relative to a fixed point in time, but should be + Note that this calculation is inexact, since it calculates relative to a fixed point in time, but should be sufficient for most if not all use cases." [d1 d2] (when (and d1 d2) diff --git a/src/metabase/util/date_2/parse/builder.clj b/src/metabase/util/date_2/parse/builder.clj index 0810d92bd10..15c2fa46b9c 100644 --- a/src/metabase/util/date_2/parse/builder.clj +++ b/src/metabase/util/date_2/parse/builder.clj @@ -1,11 +1,11 @@ (ns metabase.util.date-2.parse.builder - "Utility functions for programatically building a `DateTimeFormatter`. Easier to understand than chaining a hundred + "Utility functions for programmatically building a `DateTimeFormatter`. Easier to understand than chaining a hundred Java calls and trying to keep the structure straight. The basic idea here is you pass a number of `sections` to `formatter` to build a `DateTimeFormatter` — see `metabase.util.date-2.parse` for examples. Most of these sections are simple wrappers around corresponding `DateTimeFormatterBuilder` -- see - https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatterBuilder.html for documenation. + https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatterBuilder.html for documentation. TODO - this is a prime library candidate." (:require diff --git a/src/metabase/util/encryption.clj b/src/metabase/util/encryption.clj index db782314ec5..ecfc678784f 100644 --- a/src/metabase/util/encryption.clj +++ b/src/metabase/util/encryption.clj @@ -48,7 +48,7 @@ (str (trs "MB_ENCRYPTION_SECRET_KEY must be at least 16 characters."))) (secret-key->hash secret-key)))) -;; apperently if you're not tagging in an arglist, `^bytes` will set the `:tag` metadata to `clojure.core/bytes` (ick) +;; apparently if you're not tagging in an arglist, `^bytes` will set the `:tag` metadata to `clojure.core/bytes` (ick) ;; so you have to do `^{:tag 'bytes}` instead ;; ;; TODO -- we should probably put a watch on `env/env` so if it changes this gets recaclulated as needed... or just make diff --git a/src/metabase/util/format.cljc b/src/metabase/util/format.cljc index d0d9106ce30..60be7ea69bd 100644 --- a/src/metabase/util/format.cljc +++ b/src/metabase/util/format.cljc @@ -12,7 +12,7 @@ (defn format-nanoseconds "Format a time interval in nanoseconds to something more readable. (µs/ms/etc.)" ^String [nanoseconds] - ;; The basic idea is to take `n` and see if it's greater than the divisior. If it is, we'll print it out as that + ;; The basic idea is to take `n` and see if it's greater than the divisor. If it is, we'll print it out as that ;; unit. If more, we'll divide by the divisor and recur, trying each successively larger unit in turn. e.g. ;; ;; (format-nanoseconds 500) ; -> "500 ns" @@ -64,8 +64,8 @@ #_{:clj-kondo/ignore [:def-fn]} (def ^{:arglists '(^String [color-symb x])} colorize "Colorize string `x` using `color`, a symbol or keyword, but only if `MB_COLORIZE_LOGS` is enabled (the default). - `color` can be `green`, `red`, `yellow`, `blue`, `cyan`, `magenta`, etc. See the entire list of avaliable - colors [here](https://github.com/ibdknox/colorize/blob/master/src/colorize/core.clj)" + `color` can be `green`, `red`, `yellow`, `blue`, `cyan`, `magenta`, etc. See the entire list of available + colors [here](https://github.com/ibdknox/colorize/blob/master/src/colorize/core.clj)." #?(:clj (if colorize? (fn [color x] (colorize/color (keyword color) (str x))) diff --git a/src/metabase/util/formatting/internal/numbers.clj b/src/metabase/util/formatting/internal/numbers.clj index 4473fb7b043..5f29d7b2bef 100644 --- a/src/metabase/util/formatting/internal/numbers.clj +++ b/src/metabase/util/formatting/internal/numbers.clj @@ -1,5 +1,5 @@ (ns metabase.util.formatting.internal.numbers - "JVM Clojure implementation of the [[core/NumberFormatter]] abstaction." + "JVM Clojure implementation of the [[core/NumberFormatter]] abstraction." (:require [clojure.string :as str] [metabase.util.currency :as currency] diff --git a/src/metabase/util/honey_sql_2.clj b/src/metabase/util/honey_sql_2.clj index abebe8a52b2..180794a15aa 100644 --- a/src/metabase/util/honey_sql_2.clj +++ b/src/metabase/util/honey_sql_2.clj @@ -162,7 +162,7 @@ (u/qualified-name component)))]) (mu/defn identifier->components :- [:sequential string?] - "Given an identifer return its components + "Given an identifier return its components (identifier->components (identifier :field :metabase :user :email)) => (\"metabase\" \"user\" \"email\"))" [identifier :- [:fn identifier?]] diff --git a/src/metabase/util/humanization.cljc b/src/metabase/util/humanization.cljc index dde9b0db2ab..3b27c7d0783 100644 --- a/src/metabase/util/humanization.cljc +++ b/src/metabase/util/humanization.cljc @@ -10,7 +10,7 @@ (name->human-readable-name :simple \"cool_toucans\") ;-> \"Cool Toucans\" - ;; specifiy a different strategy: + ;; specify a different strategy: (name->human-readable-name :none \"cool_toucans\") ;-> \"cool_toucans\"" {:arglists '([strategy s])} (fn [strategy _s] diff --git a/src/metabase/util/jvm.clj b/src/metabase/util/jvm.clj index 5334feabd98..1092ff4b971 100644 --- a/src/metabase/util/jvm.clj +++ b/src/metabase/util/jvm.clj @@ -265,7 +265,7 @@ tends to break like running Liquibase migrations.) Note that because `Locale/setDefault` and `Locale/getDefault` aren't thread-local (as far as I know) I've had to put - a lock in place to prevent race conditions where threads simulataneously attempt to fetch and change the default + a lock in place to prevent race conditions where threads simultaneously attempt to fetch and change the default Locale. Thus this macro should be used sparingly, and only in places that are already single-threaded (such as the launch code that runs Liquibase). @@ -344,7 +344,7 @@ [#"[^\d,.-]+" ""] ;; now strip out any thousands separators [#"(?<=\d)[,.](\d{3})" "$1"] - ;; now replace a comma decimal seperator with a period + ;; now replace a comma decimal separator with a period [#"," "."] ;; move minus sign at end to front [#"(^[^-]+)-$" "-$1"]])))) diff --git a/src/metabase/util/malli/defn.clj b/src/metabase/util/malli/defn.clj index 5f48b226a38..65fc6d9124b 100644 --- a/src/metabase/util/malli/defn.clj +++ b/src/metabase/util/malli/defn.clj @@ -18,7 +18,7 @@ :cljs (meta args) - ;; make sure we resolve classnames e.g. `java.sql.Connection` intstead of `Connection`, otherwise the + ;; make sure we resolve classnames e.g. `java.sql.Connection` instead of `Connection`, otherwise the ;; tags won't work if you use them in another namespace that doesn't import that class. (Clj only) :clj (let [args-meta (meta args) diff --git a/src/metabase/util/malli/registry/validator_cache.clj b/src/metabase/util/malli/registry/validator_cache.clj index 5d2f4ced3cd..92c4c934083 100644 --- a/src/metabase/util/malli/registry/validator_cache.clj +++ b/src/metabase/util/malli/registry/validator_cache.clj @@ -3,11 +3,11 @@ => - for SUCCESSFUL validations (presence of an entry means that the validation was sucessful). + for SUCCESSFUL validations (presence of an entry means that the validation was successful). When the map gets bigger than [[max-entries]], walk the values and find the oldest `nano-time` and evict that entry. - I tried at least 20 different cache implentations and settled on this one and the current value of [[max-entries]] + I tried at least 20 different cache implementations and settled on this one and the current value of [[max-entries]] as the most performant -- significantly faster then [[clojure.core.memoize/lru]] -- Cam.") diff --git a/src/metabase/util/malli/schema.clj b/src/metabase/util/malli/schema.clj index 795684de46c..af73a05340b 100644 --- a/src/metabase/util/malli/schema.clj +++ b/src/metabase/util/malli/schema.clj @@ -262,7 +262,7 @@ "Schema for a valid representation of a boolean (one of `\"true\"` or `true` or `\"false\"` or `false`.). Used by [[metabase.api.common/defendpoint]] to coerce the value for this schema to a boolean. - Garanteed to evaluate to `true` or `false` when passed through a json decoder." + Guaranteed to evaluate to `true` or `false` when passed through a json decoder." (-> [:enum {:decode/json (fn [b] (contains? #{"true" true} b)) :json-schema {:type "boolean"}} "true" "false" true false] diff --git a/src/metabase/util/markdown.clj b/src/metabase/util/markdown.clj index 7ae00aee62f..4dcb044babf 100644 --- a/src/metabase/util/markdown.clj +++ b/src/metabase/util/markdown.clj @@ -324,7 +324,7 @@ (if resolved-uri ["<" resolved-uri "|" resolved-content ">"] ;; If this was parsed as a link-ref but has no reference, assume it was just a pair of square brackets and - ;; restore them. This is a known discrepency between flexmark-java and Markdown rendering on the frontend. + ;; restore them. This is a known discrepancy between flexmark-java and Markdown rendering on the frontend. ["[" resolved-content "]"]))) (defmethod ast->slack :auto-link @@ -381,7 +381,7 @@ (defn- empty-link-ref? "Returns true if this node was parsed as a link ref, but has no references. This probably means the original text - was just a pair of square brackets, and not an actual link ref. This is a known discrepency between flexmark-java + was just a pair of square brackets, and not an actual link ref. This is a known discrepancy between flexmark-java and Markdown rendering on the frontend." [^Node node] (and (instance? LinkRef node) diff --git a/src/metabase/util/password.clj b/src/metabase/util/password.clj index 5f2931138a5..7c27987ca8a 100644 --- a/src/metabase/util/password.clj +++ b/src/metabase/util/password.clj @@ -46,11 +46,11 @@ [char-type->min password] {:pre [(map? char-type->min) (string? password)]} - (let [occurences (count-occurrences password)] + (let [occurrences (count-occurrences password)] (boolean (loop [[[char-type min-count] & more] (seq char-type->min)] (if-not char-type true - (when (>= (occurences char-type) min-count) + (when (>= (occurrences char-type) min-count) (recur more))))))) (defn active-password-complexity diff --git a/src/metabase/version/settings.clj b/src/metabase/version/settings.clj index 4b053e34e0b..5325eba69c3 100644 --- a/src/metabase/version/settings.clj +++ b/src/metabase/version/settings.clj @@ -20,7 +20,7 @@ :default true) (defsetting upgrade-threshold - (deferred-tru "Threshold (value in 0-100) indicating at which treshold it should offer an upgrade to the latest major version.") + (deferred-tru "Threshold (value in 0-100) indicating at which threshold it should offer an upgrade to the latest major version.") :visibility :internal :export? false :type :integer diff --git a/src/metabase/warehouse_schema/models/field.clj b/src/metabase/warehouse_schema/models/field.clj index fd1168e0a13..ac7cf50f6e8 100644 --- a/src/metabase/warehouse_schema/models/field.clj +++ b/src/metabase/warehouse_schema/models/field.clj @@ -161,14 +161,14 @@ upds {:semantic_type nil :fk_target_field_id nil}] (t2/update! :model/Field k upds) - ;; we must explicitely clear user-set fks in this case + ;; we must explicitly clear user-set fks in this case (t2/update! :model/FieldUserSettings k upds))) (sync-user-settings field)) (t2/define-before-delete :model/Field [field] ;; Cascading deletes through parent_id cannot be done with foreign key constraints in the database - ;; because parent_id constributes to a generated column, and MySQL doesn't support columns with cascade delete + ;; because parent_id contributes to a generated column, and MySQL doesn't support columns with cascade delete ;; foreign key constraints in generated columns. #44866 (t2/delete! :model/Field :parent_id (:id field))) @@ -252,7 +252,7 @@ (t2/select [:model/FieldValues :field_id :values], :field_id id :type :full)) (mu/defn nested-field-names->field-id :- [:maybe ms/PositiveInt] - "Recusively find the field id for a nested field name, return nil if not found. + "Recursively find the field id for a nested field name, return nil if not found. Nested field here refer to a field that has another field as its parent_id, like nested field in Mongo DB. This is to differentiate from the json nested field in, which the path is defined in metabase_field.nfc_path." diff --git a/src/metabase/warehouse_schema/table.clj b/src/metabase/warehouse_schema/table.clj index 6f381a2f6e9..be731710352 100644 --- a/src/metabase/warehouse_schema/table.clj +++ b/src/metabase/warehouse_schema/table.clj @@ -111,7 +111,7 @@ :id (or col-id ;; TODO -- what???? [:field (:name col) {:base-type (or (:base_type col) :type/*)}]) - ;; Assoc semantic_type at least temprorarily. We need the correct semantic type in place to make + ;; Assoc semantic_type at least temporarily. We need the correct semantic type in place to make ;; decisions about what kind of dimension options should be added. PK/FK values will be removed ;; after we've added the dimension options :semantic_type (keyword (:semantic_type col))) diff --git a/src/metabase/warehouses/models/database.clj b/src/metabase/warehouses/models/database.clj index 7519fc5c57b..97779a849f4 100644 --- a/src/metabase/warehouses/models/database.clj +++ b/src/metabase/warehouses/models/database.clj @@ -577,7 +577,7 @@ (catch Throwable e ;; there is an known issue with exception is ignored when render API response (#32822) ;; If you see this error, you probably need to define a setting for `setting-name`. - ;; But ideally, we should resovle the above issue, and remove this try/catch + ;; But ideally, we should resolve the above issue, and remove this try/catch (log/errorf e "Error checking the readability of %s setting. The setting will be hidden in API response." setting-name) ;; let's be conservative and hide it by defaults, if you want to see it, diff --git a/src/metabase/warehouses_rest/api.clj b/src/metabase/warehouses_rest/api.clj index a57a2f3e5e5..1ba5aa05921 100644 --- a/src/metabase/warehouses_rest/api.clj +++ b/src/metabase/warehouses_rest/api.clj @@ -1005,7 +1005,7 @@ ;;; --------------------------------------------- PUT /api/database/:id ---------------------------------------------- (defn- upsert-sensitive-fields - "Replace any sensitive values not overriden in the PUT with the original values" + "Replace any sensitive values not overridden in the PUT with the original values" [database details] (when details (merge (:details database) diff --git a/src/metabase/xrays/automagic_dashboards/core.clj b/src/metabase/xrays/automagic_dashboards/core.clj index 2e747e3fa2a..c3d6ea470d8 100644 --- a/src/metabase/xrays/automagic_dashboards/core.clj +++ b/src/metabase/xrays/automagic_dashboards/core.clj @@ -962,7 +962,7 @@ (defn candidate-tables "Return a list of tables in database with ID `database-id` for which it makes sense to generate an automagic dashboard. Results are grouped by schema and ranked - acording to interestingness (both schemas and tables within each schema). Each + according to interestingness (both schemas and tables within each schema). Each schema contains up to `max-candidate-tables` tables. Tables are ranked based on how specific dashboard template has been used, and diff --git a/src/metabase/xrays/automagic_dashboards/filters.clj b/src/metabase/xrays/automagic_dashboards/filters.clj index a9e12855320..fd4f8e464aa 100644 --- a/src/metabase/xrays/automagic_dashboards/filters.clj +++ b/src/metabase/xrays/automagic_dashboards/filters.clj @@ -157,7 +157,7 @@ DBs don't do this optimization or even protest (eg. GA) if there are duplicate clauses. Assumes that any refinement sub-clauses referencing fields that are also referenced in the main clause are subsets - of the latter. Therefore we can rewrite the combined clause to ommit the more broad version from the main clause. + of the latter. Therefore we can rewrite the combined clause to omit the more broad version from the main clause. Assumes both filter clauses can be flattened by recursively merging `:and` claueses (ie. no `:and`s inside `:or` or `:not`)." [filter-clauses :- [:maybe ::lib.schema/filters] diff --git a/src/metabase/xrays/automagic_dashboards/names.clj b/src/metabase/xrays/automagic_dashboards/names.clj index e0d3264b7e7..98b01ed3048 100644 --- a/src/metabase/xrays/automagic_dashboards/names.clj +++ b/src/metabase/xrays/automagic_dashboards/names.clj @@ -15,12 +15,10 @@ [metabase.xrays.automagic-dashboards.schema :as ads] [metabase.xrays.automagic-dashboards.util :as magic.util])) -;; TODO - rename "minumum" to "minimum". Note that there are internationalization string implications -;; here so make sure to do a *thorough* find and replace on this. (def ^:private op->name {:sum (deferred-tru "sum") :avg (deferred-tru "average") - :min (deferred-tru "minumum") + :min (deferred-tru "minimum") :max (deferred-tru "maximum") :count (deferred-tru "number") :distinct (deferred-tru "distinct count") diff --git a/src/metabase/xrays/automagic_dashboards/populate.clj b/src/metabase/xrays/automagic_dashboards/populate.clj index 00658a6be21..a286050e3ed 100644 --- a/src/metabase/xrays/automagic_dashboards/populate.clj +++ b/src/metabase/xrays/automagic_dashboards/populate.clj @@ -79,7 +79,7 @@ ensure-distinct-colors)) (defn- colorize - "Pick the chart colors acording to the following rules: + "Pick the chart colors according to the following rules: * If there is more than one breakout dimension let the frontend do it as presumably the second dimension will be used as color key and we can't know the values it will take at this stage. @@ -87,7 +87,7 @@ (ie. a frequency chart), use field IDs referenced in `:breakout` as color key. * Else use `:aggregation` as color key. - Colors are then determined by using the hashs of color keys to index into the vector + Colors are then determined by using the hashes of color keys to index into the vector of available colors." [{:keys [visualization dataset_query], :as _dashcard}] (let [display (first visualization) @@ -210,9 +210,9 @@ y (range y (+ y width))] [x y]))) -(mu/defn- accomodates? +(mu/defn- accommodates? "Can we place card on grid starting at [x y] (top left corner)? - Since we are filling the grid top to bottom and the cards are rectangulard, + Since we are filling the grid top to bottom and the cards are rectangular, it suffices to check just the first (top) row." [grid :- ::grid [x y] :- [:tuple nat-int? nat-int?] @@ -226,14 +226,14 @@ (mu/defn- dashcard-position "Find position on the grid where to put the card. We use the dumbest possible algorithm (the grid size is relatively small, so - we should be fine): startting at top left move along the grid from left to + we should be fine): starting at top left move along the grid from left to right, row by row and try to place the card at each position until we find an unoccupied area. Mark the area as occupied." [grid :- ::grid start-row dashcard] (reduce (fn [grid xy] - (if (accomodates? grid xy dashcard) + (if (accommodates? grid xy dashcard) (reduced xy) grid)) grid @@ -288,7 +288,7 @@ "Pick up to `max-cards` with the highest `:card-score`. Keep groups together if possible by pulling all the cards within together and using the same (highest) card-score for all. - Among cards with the same card-score those beloning to the largest group are + Among cards with the same card-score those belonging to the largest group are favourized, but it is still possible that not all cards in a group make it (consider a group of 4 cards which starts as 7/9; in that case only 2 cards from the group will be picked)." diff --git a/src/metabase/xrays/related.clj b/src/metabase/xrays/related.clj index 1eb180d1213..54b810acefe 100644 --- a/src/metabase/xrays/related.clj +++ b/src/metabase/xrays/related.clj @@ -63,10 +63,10 @@ (defn- similarity "How similar are entities `a` and `b` based on a structural comparison of their definition (MBQL). - For the purposes of finding related entites we are only interested in + For the purposes of finding related entities we are only interested in context-bearing subforms (field, segment, and metric references). We also don't care about generalizations (less context-bearing forms) and refinements - (more context-bearing forms), so we just check if the less specifc form is a + (more context-bearing forms), so we just check if the less specific form is a subset of the more specific one." [a b] (let [context-a (-> a definition collect-context-bearing-forms lib.schema.util/remove-lib-uuids) diff --git a/src/metabase/xrays/transforms/core.clj b/src/metabase/xrays/transforms/core.clj index 7b5fcc4a6f9..af9bb7a3a46 100644 --- a/src/metabase/xrays/transforms/core.clj +++ b/src/metabase/xrays/transforms/core.clj @@ -199,7 +199,7 @@ The algorithm is as follows: 1) Try to find a set of tables in the given schema that have required domain entities. 2) If found, use these tables and their fields as the initial bindings. - 3) Go through the transform steps, materialize them as cards, and accure these and their result + 3) Go through the transform steps, materialize them as cards, and accrue these and their result cols to the bindings. 4) Check that all output cards have the expected result shape. 5) Return the output cards." diff --git a/test/metabase/lib/underlying_test.cljc b/test/metabase/lib/underlying_test.cljc index e4b37dcb924..cb2bfe7950e 100644 --- a/test/metabase/lib/underlying_test.cljc +++ b/test/metabase/lib/underlying_test.cljc @@ -105,7 +105,7 @@ (deftest ^:parallel top-level-column-rename-options-test (testing `lib.underlying/top-level-column - (testing "respects rename-superflous-options?" + (testing "respects rename-superfluous-options?" (let [query (-> (lib/query meta/metadata-provider (meta/table-metadata :orders)) (lib/aggregate (lib/sum (meta/field-metadata :orders :subtotal))) (lib/breakout (-> (meta/field-metadata :orders :created-at) @@ -125,7 +125,7 @@ rename? [true false]] (let [orig-key (keyword "metabase.lib.field" key-name) renamed-key (keyword "metabase.lib.underlying" key-name) - top-level-col (lib.underlying/top-level-column query col :rename-superflous-options? rename?)] + top-level-col (lib.underlying/top-level-column query col :rename-superfluous-options? rename?)] (testing (str "\nrename? " rename? "\norig-key " orig-key "\nrenamed-key " renamed-key