You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 96d47ca
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/developer_docs/extensions/dependencies.md
+36-16Lines changed: 36 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,29 +30,45 @@ This guide explains how to manage dependencies in your Superset extensions, incl
30
30
31
31
Extensions run in the same context as Superset during runtime. This means extension developers can technically import any module from the Superset codebase, not just the public APIs. Understanding the distinction between public and internal code is critical for building maintainable extensions.
32
32
33
-
### Public APIs (Stable)
33
+
### Documented APIs
34
34
35
-
The core packages follow[semantic versioning](https://semver.org/) and provide stable, documented APIs:
35
+
The core packages use[semantic versioning](https://semver.org/). A package name alone does not make every import in it a supported API. Use the documented imports for your audience:
|`apache-superset-core`| Backend host extensions | Documented host-bound APIs, including models and DAOs |
41
42
42
-
**Benefits of using core packages:**
43
+
The `apache-superset-core` provider contract is imported from these explicit modules. The `superset_core.semantic_layers` package root also re-exports `SemanticCredentialReadiness`, `SemanticBackendError`, and the transport types; prefer the module paths below:
43
44
44
-
-**Semantic versioning**: Breaking changes are communicated through version numbers
45
-
-**Documentation**: APIs are documented with clear usage examples
46
-
-**Stability commitment**: We strive to maintain backward compatibility
47
-
-**Type safety**: Full TypeScript and Python type definitions
|`semantic_layers.testing`|`SemanticProviderConformance` and the documented pytest fixtures |
56
+
57
+
Prefix each module with `superset_core.` in Python imports. The list covers provider-facing symbols; a type being supported does not imply every feature or enum value is supported by every host version. Check the [semantic-layer provider guide](./extension-points/semantic-layers.md) for usage and the [provider testing guide](../semantic-layer-provider-testing.md) for the test kit.
58
+
59
+
`SemanticCredentials` is a reserved channel for future non-connection credentials; providers must not treat it as cache identity. The host supplies `ExecutionOrigin.REQUEST` during a request and `ExecutionOrigin.BACKGROUND` outside one. For authenticated users, async chart queries and MCP calls outside a Flask request context use `BACKGROUND` while retaining the user's principal. `MCP`, `ASYNC_QUERY`, and `EXPORT` are defined but explicit binders are not yet installed; `CONFIG` is reserved. Providers should handle the origins the host supplies and reject unknown ones.
60
+
61
+
The two context types are both supported and are not interchangeable. `SemanticLayer.from_configuration` receives `SemanticExecutionContext`, the binding identity; `SemanticLayer.get_semantic_cache_context_identity` receives `SemanticCacheExecutionContext`, the containment-cache identity. Rely on each only in the hook that receives it. Merging them would be a breaking change and would be announced in the package changelog.
62
+
63
+
Host extensions are a separate audience. `superset_core.semantic_layers.models.SemanticLayerModel` and `SemanticViewModel`, and `superset_core.semantic_layers.daos.AbstractSemanticLayerDAO` and `AbstractSemanticViewDAO`, are host-bound persistence interfaces. They depend on the Superset host and its Flask-AppBuilder/SQLAlchemy environment; a standalone semantic provider does not need to import them. Other host-extension APIs are supported where their extension-point documentation names the import path.
48
64
49
65
### Internal Code (Unstable)
50
66
51
-
Any code that is not exported through the core packages is considered internal. This includes:
67
+
Code outside the documented API for the relevant audience is internal. This includes:
52
68
53
69
- Direct imports from `superset-frontend/src/` modules
54
70
- Direct imports from `superset/` Python modules (outside of `superset_core`)
55
-
- Undocumented functions, classes, or utilities
71
+
- Undocumented functions, classes, or utilities inside a core package
56
72
57
73
:::warning Use at Your Own Risk
58
74
Internal code can change at any time without notice. If you depend on internal modules, your extension may break when Superset is upgraded. There is no guarantee of backward compatibility for internal code.
@@ -79,7 +95,11 @@ from superset.views.core import SomeInternalClass
79
95
80
96
## API Evolution
81
97
82
-
The core packages are still evolving. While we follow semantic versioning, the APIs may change as we add new extension points and refine existing ones based on community feedback.
98
+
The core packages are still evolving. For `apache-superset-core`, `0.x` minor releases may change documented contracts; patch releases should preserve them except for necessary correctness or security fixes. At `1.0` and later, incompatible documented API changes require a major release, compatible additions a minor release, and fixes a patch release. The package version is the contract version; there is no separate semantic-layer contract number.
99
+
100
+
An unreleased changelog entry describes the next package release without changing the installed version. Version metadata for `apache-superset-core`, `apache-superset-extensions-cli`, and `@apache-superset/core` is bumped together as part of the release process.
101
+
102
+
Before removing or changing a documented Python API, we normally mark it deprecated in documentation and the [package changelog](https://github.com/apache/superset/blob/master/superset-core/CHANGELOG.md), provide a migration path, and emit `DeprecationWarning` where a runtime warning is practical. Keep the deprecated path for at least one minor release when feasible. A security or correctness fix may require a shorter transition; its release note must describe the impact. The changelog records additions, deprecations, removals, and behavior changes starting with the next package release. An unreleased entry is not an installable version.
83
103
84
104
**What this means for extension developers:**
85
105
@@ -135,14 +155,14 @@ When Superset upgrades its core dependencies (e.g., a new major version of Ant D
135
155
136
156
## API Versioning and Changelog
137
157
138
-
Once the extensions API reaches **v1**, we will maintain a dedicated `CHANGELOG.md` file to track all changes to the public APIs. This will include:
158
+
The Python package has its own [changelog](https://github.com/apache/superset/blob/master/superset-core/CHANGELOG.md) before v1. Each published version records changes to documented APIs, including:
139
159
140
160
- New APIs and features
141
161
- Deprecation notices
142
162
- Breaking changes with migration guides
143
163
- Bug fixes affecting API behavior
144
164
145
-
Until then, monitor the Superset release notes and test your extensions with each new release.
165
+
For frontend APIs, monitor the Superset release notes. For either package, test your extension against each target Superset release before deploying it.
Copy file name to clipboardExpand all lines: docs/developer_docs/extensions/extension-points/semantic-layers.md
+47-19Lines changed: 47 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,6 +100,10 @@ class MySemanticLayer(SemanticLayer[MyConfig, MySemanticView]):
100
100
101
101
The decorator registers the class in the semantic layers registry, making it available in the UI for users to create connections. The `configuration_class` should be a Pydantic model that defines the fields needed to connect (credentials, project, database, etc.). Superset uses the model's JSON schema to render the configuration form dynamically.
102
102
103
+
## API permissions and runtime availability
104
+
105
+
The semantic APIs check endpoint permissions before evaluating `SEMANTIC_LAYERS` through the feature flag manager. See [runtime semantic-layer availability](/admin-docs/configuration/feature-flags#runtime-semantic-layer-availability) for permission, Public-role, `OPTIONS`, and `IS_FEATURE_ENABLED_FUNC` behavior.
106
+
103
107
## Provider obligations and isolated tests
104
108
105
109
Store the parsed configuration instance on the writable `self.configuration`
@@ -249,8 +253,11 @@ includes an effective-role derivation marker, so context-scoped containment keys
249
253
change even when the role list is empty. This
250
254
prevents reuse of direct-only identities after group grants are revoked and causes
251
255
a cold context-scoped containment cache; connection-scoped keys are unchanged.
252
-
The SDK `identity_digest` is unchanged. The two SDK context types coexist and
253
-
will be unified before any `superset-core` release.
256
+
The SDK `identity_digest` is unchanged. The two SDK context types coexist:
257
+
`from_configuration` receives `SemanticExecutionContext`, and
0 commit comments