You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/09/10 03:04:42 UTC

(superset) branch docs/pr-42837-needs-docs-feat-hooks-add-configurable-p created (now 889017fce7b)

This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a change to branch docs/pr-42837-needs-docs-feat-hooks-add-configurable-p
in repository https://gitbox.apache.org/repos/asf/superset.git


      at 889017fce7b docs(config): document AFTER_ASSET_CREATE hook

This branch includes the following new commits:

     new 889017fce7b docs(config): document AFTER_ASSET_CREATE hook

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(superset) 01/01: docs(config): document AFTER_ASSET_CREATE hook

Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch docs/pr-42837-needs-docs-feat-hooks-add-configurable-p
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 889017fce7b696dc21ae8cf060dda8941005efe6
Author: rusackas <ev...@rusackas.com>
AuthorDate: Wed Sep 9 20:04:09 2026 -0700

    docs(config): document AFTER_ASSET_CREATE hook
    
    AFTER_ASSET_CREATE was added in #40707 and wired into the legacy
    dashboard-creation view in #42837, but was never mentioned in the
    config reference. Document its signature and no-op-by-default
    behavior alongside the other chart/dashboard extension hooks.
    
    Co-Authored-By: Evan Rusackas <ev...@preset.io>
    Co-Authored-By: Claude Sonnet 5 <no...@anthropic.com>
---
 .../configuration/configuring-superset.mdx         | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/docs/admin_docs/configuration/configuring-superset.mdx b/docs/admin_docs/configuration/configuring-superset.mdx
index e974394e7c5..07a7a46ef5b 100644
--- a/docs/admin_docs/configuration/configuring-superset.mdx
+++ b/docs/admin_docs/configuration/configuring-superset.mdx
@@ -606,6 +606,28 @@ def FLASK_APP_MUTATOR(app: Flask) -> None:
     app.before_request_funcs.setdefault(None, []).append(make_session_permanent)
 ```
 
+## Reacting to chart and dashboard creation
+
+`AFTER_ASSET_CREATE` is an optional hook that runs after a chart or dashboard
+is created, letting deployments react to new assets without forking the
+creation commands or views — for example to auto-categorize the asset, write
+an audit log entry, or fire a notification.
+
+The hook receives the model instance and the asset type string (`"chart"` or
+`"dashboard"`):
+
+```python
+# superset_config.py
+def _after_asset_create(model, asset_type):
+    audit_log.write(f"{asset_type} {model.id} created by {model.created_by}")
+
+
+AFTER_ASSET_CREATE = _after_asset_create
+```
+
+It defaults to `None`, which is a no-op: with nothing configured, chart and
+dashboard creation behaves exactly as it did before this hook existed.
+
 ## Carrying extra data through chart and dashboard exports
 
 Deployments often attach their own metadata to charts and dashboards — an owning