GitHub user dosubot[bot] added a comment to the discussion: How to trigger side effects in Superset 6.0 for DAO CRUD operations
<!-- Answer --> Glad the `after_flush_postexec` + `after_request` combination worked for you — that's a solid pattern for deferring work until after the flush is fully complete. Regarding your question about `apache-superset-core` and a `Dataset` class: there is actually **no separate `Dataset` ORM model class** in the Superset codebase. "Dataset" is API/UI-layer terminology — the underlying ORM model is `SqlaTable` (defined in `superset/connectors/sqla/models.py`), which maps to the `tables` database table [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/connectors/sqla/models.py#L1155). Classes like `DatasetRestApi` and `DatasetDAO` simply wrap `SqlaTable` under the hood [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/datasets/api.py#L94-L96) [[3]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/daos/dataset.py#L39-L40). There is also no separate `apache-superset-core` Python package — Apache Superset ships as a single package (`apache_superset`) [[4]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/setup.py#L55). So for your extension project, you'll still need to import `SqlaTable` from `superset.connectors.sqla.models` to register your event listeners. There's no public/stable "core" API that re-exports these models under different names. If you're building a separate extension that gets installed alongside Superset, your listener registration code would import directly from the main package: ```python from superset.connectors.sqla.models import SqlaTable from sqlalchemy import event @event.listens_for(SqlaTable, "after_flush_postexec") def my_handler(session, flush_context): ... ``` The trade-off is that your extension would depend on Superset's internal module structure, which isn't guaranteed to be stable across major versions. But this is the same approach the tagging system and permission listeners use internally [[5]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/tags/core.py#L36-L38), so it's the established pattern. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).* --- Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=de33bf29-a8bc-4b83-acd0-113282e43845) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset) GitHub link: https://github.com/apache/superset/discussions/39841#discussioncomment-16858286 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
