diff --git a/index.html b/index.html index 152a974..144788e 100644 --- a/index.html +++ b/index.html @@ -7079,7 +7079,7 @@

Important Libraries

::browse_data "1-0-0" ::invite "1-0-1" ::csvupload "1-0-0" - ::dashboard "1-1-3" + ::dashboard "1-1-4" ::database "1-0-1" ::instance "1-1-2" ::metabot "1-0-1" @@ -9253,7 +9253,8 @@

Important Libraries

timed-out? (= port metadata-timeout) card-updates (cond-> card-updates (not timed-out?) - (assoc :result_metadata fresh-metadata))] + (assoc :result_metadata fresh-metadata + :verified-result-metadata? true))] (u/prog1 (-> (card/update-card! {:card-before-update card-before-update :card-updates card-updates :actor @api/*current-user*}) @@ -60325,16 +60326,22 @@

`&match` and `&parents` anaphors

(field-values/update-field-values-for-on-demand-dbs! field-ids)) (parameter-card/upsert-or-delete-from-parameters! "card" (:id card) (:parameters card))))
(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 .
-  (-> (into {:id (:id card)} (t2/changes card))
+  (-> (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-> #_changes
+        (or (empty? (:result_metadata card))
+            (not verified-result-metadata?))
+        populate-result-metadata)
       pre-update
       populate-query-fields
       maybe-populate-initially-published-at
@@ -60587,12 +60594,14 @@ 

`&match` and `&parents` anaphors

:text (tru "Unverified due to edit")})) ;; 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)