mikebridge opened a new pull request, #45393: URL: https://github.com/apache/superset/pull/45393
### SUMMARY **TL;DR:** Provider authors can test a semantic-layer extension without starting Superset and can find the host's existing configuration and result-naming expectations in the SDK. **Background:** Providers implement the public semantic-layer classes and register through a decorator supplied by the host. **Problem:** Several expectations are implicit, and importing a decorated provider in an isolated test raises before the provider can be exercised. **What this changes:** - Declare the parsed `configuration` attribute with the provider's configuration type. - Document static, no-I/O configuration schemas, value-result column names, and the selection-version guard's error boundary. - Supply an opt-in pytest registration fixture and an executable SDK-only authoring example. - Explain why storing a cache token without partitioning real cache lookups is insufficient. The detailed design follows. `semantic_layer_registration` temporarily substitutes the SDK decorator during a test. Provider imports must happen after the fixture starts. The class remains intact; there is no new registry, registration lifecycle, or production hook. Host namespacing and lifecycle remain host integration concerns. `configuration` is a type declaration, so providers retain their own storage and construction choices. Factory and schema signatures are unchanged. The example implements discovery and values and deliberately refuses table/count operations. It has no shared cache. This is an authoring example, not a full conformance claim. The provider conformance kit follows separately. Default chronological ordering is handled in #45389. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF Not applicable: SDK documentation and test support only. No application UI or query execution behavior changes. ### TESTING INSTRUCTIONS Run from the repository root with SDK dependencies and pytest available: ```bash PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 PYTHONPATH=$PWD/superset-core/src python -m pytest -q -o addopts='' superset-core/tests/semantic_layers/test_registration.py superset-core/tests/semantic_layers/test_view.py ``` The configuration contract test fails without the declaration. The registration tests import and exercise the decorated example through the fixture, then verify registration is unavailable after teardown. No Flask application or live provider is used. ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [x] Introduces new feature or API - [ ] Removes existing feature or API -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
