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 Tue Feb 27 17:24:31 UTC 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Feb 27, 2024
1 parent c3ed79b commit 20318a5
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7079,7 +7079,7 @@ <h2>Important Libraries</h2>
::browse_data &quot;1-0-0&quot;
::invite &quot;1-0-1&quot;
::csvupload &quot;1-0-0&quot;
::dashboard &quot;1-1-3&quot;
::dashboard &quot;1-1-4&quot;
::database &quot;1-0-1&quot;
::instance &quot;1-1-2&quot;
::metabot &quot;1-0-1&quot;
Expand Down Expand Up @@ -9253,7 +9253,8 @@ <h2>Important Libraries</h2>
timed-out? (= port metadata-timeout)
card-updates (cond-&gt; card-updates
(not timed-out?)
(assoc :result_metadata fresh-metadata))]
(assoc :result_metadata fresh-metadata
:verified-result-metadata? true))]
(u/prog1 (-&gt; (card/update-card! {:card-before-update card-before-update
:card-updates card-updates
:actor @api/*current-user*})
Expand Down Expand Up @@ -60325,16 +60326,22 @@ <h3>`&match` and `&parents` anaphors</h3>
(field-values/update-field-values-for-on-demand-dbs! field-ids))
(parameter-card/upsert-or-delete-from-parameters! &quot;card&quot; (:id card) (:parameters card))))</pre></td></tr><tr><td class="docs">
</td><td class="codes"><pre class="brush: clojure">(t2/define-before-update :model/Card
[card]
[{:keys [verified-result-metadata?] :as card}]
;; remove all the unchanged keys from the map, except for `:id`, so the functions below can do the right thing since
;; they were written pre-Toucan 2 and don't know about [[t2/changes]]...
;;
;; We have to convert this to a plain map rather than a Toucan 2 instance at this point to work around upstream bug
;; https://github.com/camsaul/toucan2/issues/145 .
(-&gt; (into {:id (:id card)} (t2/changes card))
(-&gt; (into {:id (:id card)} (t2/changes (dissoc card :verified-result-metadata?)))
ensure-type-and-dataset-are-consistent
maybe-normalize-query
populate-result-metadata
;; If we have fresh result_metadata, we don't have to populate it anew. When result_metadata doesn't
;; change for a native query, populate-result-metadata removes it (set to nil) unless prevented by the
;; verified-result-metadata? flag (see #37009).
(cond-&gt; #_changes
(or (empty? (:result_metadata card))
(not verified-result-metadata?))
populate-result-metadata)
pre-update
populate-query-fields
maybe-populate-initially-published-at
Expand Down Expand Up @@ -60587,12 +60594,14 @@ <h3>`&match` and `&parents` anaphors</h3>
:text (tru &quot;Unverified due to edit&quot;)}))
;; ok, now save the Card
(t2/update! Card (:id card-before-update)
;; `collection_id` and `description` can be `nil` (in order to unset them). Other values should only be
;; modified if they're passed in as non-nil
;; `collection_id` and `description` can be `nil` (in order to unset them).
;; Other values should only be modified if they're passed in as non-nil
(u/select-keys-when card-updates
:present #{:collection_id :collection_position :description :cache_ttl :dataset :type}
:non-nil #{:dataset_query :display :name :visualization_settings :archived :enable_embedding
:parameters :parameter_mappings :embedding_params :result_metadata :collection_preview}))))
:present #{:collection_id :collection_position :description :cache_ttl :dataset
:type}
:non-nil #{:dataset_query :display :name :visualization_settings :archived
:enable_embedding :parameters :parameter_mappings :embedding_params
:result_metadata :collection_preview :verified-result-metadata?}))))
;; Fetch the updated Card from the DB
(let [card (t2/select-one Card :id (:id card-before-update))]
(delete-alerts-if-needed! :old-card card-before-update, :new-card card, :actor actor)
Expand Down

0 comments on commit 20318a5

Please sign in to comment.