Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Update backend docs on Sat Jan 6 01:39:42 UTC 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Jan 6, 2024
1 parent c2545d5 commit 9a4702e
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11725,7 +11725,7 @@ <h2>Important Libraries</h2>
(let [dashboard (t2/hydrate dashboard :resolved-params)
constraints (chain-filter-constraints dashboard constraint-param-key-&gt;value)
param (get-in dashboard [:resolved-params param-key])
field-ids (map :field-id (param-&gt;fields param))]
field-ids (into #{} (map :field-id (param-&gt;fields param)))]
(if (empty? field-ids)
(or (filter-values-from-field-refs dashboard param-key)
(throw (ex-info (tru &quot;Parameter {0} does not have any Fields associated with it&quot; (pr-str param-key))
Expand Down Expand Up @@ -36504,17 +36504,15 @@ <h6>`:abstract?` (default = false)</h6>
(when (integer? id-or-name)
(:name (lib.metadata/field (qp.store/metadata-provider) id-or-name)))))</pre></td></tr><tr><td class="docs">
</td><td class="codes"><pre class="brush: clojure">(defmethod -&gt;honeysql [:sql :field]
[driver [_ id-or-name {:keys [database-type]
::nest-query/keys [outer-select]
:as options}
[driver [_ id-or-name {:keys [database-type] :as options}
:as field-clause]]
(try
(let [source-table-aliases (field-source-table-aliases field-clause)
source-alias (field-source-alias field-clause)
field (when (integer? id-or-name)
(lib.metadata/field (qp.store/metadata-provider) id-or-name))
allow-casting? (and field
(not outer-select))
(not (:qp/ignore-coercion options)))
database-type (or database-type
(:database-type field))
;; preserve metadata attached to the original field clause, for example BigQuery temporal type information.
Expand Down Expand Up @@ -36833,8 +36831,8 @@ <h6>`:abstract?` (default = false)</h6>
true
(assoc ::add/source-alias (::add/desired-alias opts)
::add/source-table ::add/none
;; sort of a HACK but this key will tell the SQL QP not to apply casting here either.
::nest-query/outer-select true
;; this key will tell the SQL QP not to apply casting here either.
:qp/ignore-coercion true
;; used to indicate that this is a forced alias
::forced-alias true)
;; don't want to do temporal bucketing or binning inside the order by only.
Expand Down Expand Up @@ -79556,20 +79554,22 @@ <h6>`:fallback`</h6>
&quot;Get implicit Fields for a query with a `:source-query` that has `source-metadata`.&quot;
[source-metadata :- [:sequential {:min 1} mbql.s/SourceQueryMetadata]]
(distinct
(for [{field-name :name, base-type :base_type, field-id :id, [ref-type :as field-ref] :field_ref} source-metadata]
(for [{field-name :name, base-type :base_type, field-id :id, [ref-type :as field-ref] :field_ref coercion-strategy :coercion_strategy} source-metadata]
;; return field-ref directly if it's a `:field` clause already. It might include important info such as
;; `:join-alias` or `:source-field`. Remove binning/temporal bucketing info. The Field should already be getting
;; bucketed in the source query; don't need to apply bucketing again in the parent query.
;; bucketed in the source query; don't need to apply bucketing again in the parent query. Mark the field as
;; `qp/ignore-coercion` here so that it doesn't happen again in the parent query.
(or (some-&gt; (mbql.u/match-one field-ref :field)
(mbql.u/update-field-options dissoc :binning :temporal-unit))
(mbql.u/update-field-options dissoc :binning :temporal-unit)
(cond-&gt; coercion-strategy (mbql.u/assoc-field-options :qp/ignore-coercion true)))
;; otherwise construct a field reference that can be used to refer to this Field.
;; Force string id field if expression contains just field. See issue #28451.
(if (and (not= ref-type :expression)
field-id)
;; If we have a Field ID, return a `:field` (id) clause
[:field field-id nil]
[:field field-id (cond-&gt; nil coercion-strategy (assoc :qp/ignore-coercion true))]
;; otherwise return a `:field` (name) clause, e.g. for a Field that's the result of an aggregation or
;; expression
;; expression. We don't need to mark as ignore-coercion here because these won't grab the field metadata
[:field field-name {:base-type base-type}])))))</pre></td></tr><tr><td class="docs"><p>Whether we should add implicit Fields to this query. True if all of the following are true:</p>

<ul>
Expand Down Expand Up @@ -86908,10 +86908,10 @@ <h3>`::position`</h3>
&amp;match
:expression
(raise-source-query-expression-ref query &amp;match)
;; mark all Fields at the new top level as `::outer-select` so QP implementations know not to apply coercion or
;; mark all Fields at the new top level as `:qp/ignore-coercion` so QP implementations know not to apply coercion or
;; whatever to them a second time.
[:field _id-or-name (_opts :guard (every-pred :temporal-unit (complement ::outer-select)))]
(recur (mbql.u/update-field-options &amp;match assoc ::outer-select true))
[:field _id-or-name (_opts :guard (every-pred :temporal-unit (complement :qp/ignore-coercion)))]
(recur (mbql.u/update-field-options &amp;match assoc :qp/ignore-coercion true))
[:field id-or-name (opts :guard :join-alias)]
(let [{::add/keys [desired-alias]} (mbql.u/match-one (:source-query query)
[:field
Expand Down

0 comments on commit 9a4702e

Please sign in to comment.