graceguo-supercat commented on a change in pull request #11970:
URL: 
https://github.com/apache/incubator-superset/pull/11970#discussion_r543780615



##########
File path: superset/connectors/sqla/models.py
##########
@@ -1467,6 +1473,29 @@ class and any keys added via `ExtraCache`.
             extra_cache_keys += sqla_query.extra_cache_keys
         return extra_cache_keys
 
+    def health_check(self, commit: bool = False, force: bool = False) -> None:
+        check = config["DATASET_HEALTH_CHECK"]
+        if check is None:
+            return
+
+        extra = self.extra_dict
+        # force re-run health check, or health check is updated
+        if force or extra.get("health_check", {}).get("version") != 
check.version:
+            with event_logger.log_context(action="dataset_health_check"):
+                message = check(self)
+                if message:
+                    extra["health_check"] = {
+                        "version": check.version,
+                        "message": message,
+                    }

Review comment:
       thanks. i will keep this work in mind. If we see this feature is useful, 
will polish it with localization and other re-usable UI component.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to