You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "mikebridge (via GitHub)" <gi...@apache.org> on 2026/09/29 23:06:21 UTC
[PR] feat(semantic-layer): sync metadata from the view editor [superset]
mikebridge opened a new pull request, #44808:
URL: https://github.com/apache/superset/pull/44808
### SUMMARY
**Draft — not ready to merge or deploy.** SC-121047 adds permission-checked **Sync metadata** to the right end of the semantic-view editor's Details / Dimensions / Metrics tabs. It refreshes the selected view's owning connection and preserves unsaved Description/Cache timeout and the active tab. Manual-first: no polling or webhook.
The additive SDK contract lets participating providers share immutable, connection-scoped catalog snapshots. The host fences Redis publication, rechecks persisted access/configuration before publication, and namespaces compatibility by the captured snapshot so stale compatibility entries cannot hide new metrics. The UI reloads metadata/compatibility without saving the chart or automatically running a query.
`SEMANTIC_LAYER_METADATA_REFRESH_ENABLED` defaults to `False`; `SEMANTIC_LAYERS` and provider support are also required. Existing providers retain default non-participating behavior.
Companion shell branch: `preset-io/superset-shell:sc-121047-metadata-refresh` (draft link will be added in this publication batch). Tracking: https://app.shortcut.com/preset/story/121047 and https://app.shortcut.com/preset/story/123223.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Candidate browser screenshots are pending. Component tests cover the tab-row button, counts, preserved drafts, overlap prevention and stale asynchronous responses. No browser acceptance claim.
### TESTING INSTRUCTIONS
Use the paired core/MetricFlow candidate with isolated Redis and a trusted namespace. Enable the refresh setting only in that isolated environment, sign in with view read/access plus owning-layer read/write/edit/access, open a semantic view from Dataset List or Explore, and select **Sync metadata**. Verify inline changed/unchanged/error feedback and preserved drafts. Denied, guest, disabled and unsupported requests must perform no refresh discovery/publication.
Existing evidence includes Redis13 (two processes/100 reads, expired writer, owner death, lost acknowledgement and restored-state namespace), PostgreSQL20 + MySQL20 persisted access/configuration race cases, four frontend suites78, and compatibility11. Targeted negative controls fail before their fixes. Final Python/hooks/review results: Final bounded checks: core217 unit tests; MetricFlow provider333 tests (including21 metadata tests); core MyPy21 files and shell MyPy360 files; changed-file Python hooks, pinned frontend formatter/linter equivalents, source-resolved TypeScript, and explicit production Pylint10/10. Independent Claude Fable 5.1 approved the exact published trees for draft publication; the remaining findings are listed below. Earlier unchanged frontend implementation passed78 tests across four suites; actual browser acceptance remains open..
**Required before merge:**
- Actual candidate-browser/two-worker journey: a newly introduced raw metric ID becomes selectable and queries Big Number **17** without waiting for compatibility TTL; include both editor callers and preserved drafts. This has not run.
- Finish browser fixture/CI flag wiring and obtain new-head CI results. Local frontend tooling uses pinned direct tool versions with a documented shared dependency/transitive-lock mismatch; this is not pristine `npm ci` evidence.
- Coordinate a released/approved core SDK artifact, the shell core pin, and MetricFlow's minimum SDK dependency. The shell draft's old pin lacks the new module and cannot load the new provider, even with refresh off. The drafts are tested as a paired source checkout, not a deployable shell assembly.
- Verify homogeneous worker versions, shared Redis primary/namespace, disable-before-rollback and deployment acceptance. No live dbt access or production deployment was performed.
### ADDITIONAL INFORMATION
- [x] Has associated issue: SC-121047 / SC-123223
- [x] Required feature flags: `SEMANTIC_LAYERS`; default-off configuration `SEMANTIC_LAYER_METADATA_REFRESH_ENABLED`
- [x] Changes UI
- [ ] Includes DB Migration
- [x] Introduces new feature or API
- [ ] Removes existing feature or API
### Independent review: remaining merge gates
Claude approved the reviewed candidates **for draft publication only**. Its review also leaves these concrete follow-ups before merge:
- Cold/expired concurrent reads can return `in_progress` (and500 on compatibility/chart paths) while one writer refills; cover contention and decide bounded retry/error mapping in the browser/worker acceptance work. Warm-snapshot two-process evidence does not cover this.
- An identical catalog after expiry receives a new revision; evaluate stable scoped content identity and compatibility-cache churn.
- Prove the tenant namespace through the actual multi-tenant configuration with A/B/unbound contexts; the existing plain-Flask adapter test is insufficient for the unbound-context claim.
- Validate the DNS deadline subprocess under deployed worker/process limits and consistently categorize residual transport failures.
The existing SDK/pin and browser blockers above remain. Additional lower-priority review notes cover operational logging, error presentation, read parsing cost, Redis test-host portability and redirect coverage; none is claimed resolved by draft publication.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(semantic-layer): sync metadata from the view editor [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on code in PR #44808:
URL: https://github.com/apache/superset/pull/44808#discussion_r4139778455
##########
superset/semantic_layers/models.py:
##########
@@ -506,6 +512,33 @@ def table_name(self) -> str:
def kind(self) -> str:
return "semantic_view"
+ @property
+ def metadata_cache_token(self) -> str | None:
Review Comment:
A metadata sync can change a metric's definition without changing the semantic-view row, but this snapshot token is only used for compatibility caching; query-result cache keys still remain unchanged. Could `get_extra_cache_keys` include the captured metadata token so Sync metadata does not keep returning the previous chart result until its cache TTL expires?
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(semantic-layer): sync metadata from the view editor [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44808:
URL: https://github.com/apache/superset/pull/44808#issuecomment-5901547957
<!-- Bito Reply -->
The issue is valid. The current implementation likely uses a generic error handler that defaults to HTTP 400 for exceptions raised during the metadata refresh process, which incorrectly categorizes server-side issues (like storage outages or timeouts) as client-side errors. To resolve this, you should implement a specific exception handler in the API layer that catches these runtime errors and maps them to appropriate HTTP 5xx status codes (e.g., 503 Service Unavailable or 500 Internal Server Error).
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(semantic-layer): sync metadata from the view editor [superset]
Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on PR #44808:
URL: https://github.com/apache/superset/pull/44808#issuecomment-5920495587
Second piece of the split is up as a draft: #44835. It adds the shared metadata snapshot store and includes the captured catalog token in query-result cache keys, which is the fix for the stale-result issue raised above. Default-off, stacked on #44834.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(semantic-layer): sync metadata from the view editor [superset]
Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on PR #44808:
URL: https://github.com/apache/superset/pull/44808#issuecomment-5942861378
@rusackas this PR is superseded by the four-part split (#44834, #44835, #44849, #44851). I have carried your question about a chart cache serving pre-sync results over to the store layer, with the answer and the test that covers it: https://github.com/apache/superset/pull/44835#issuecomment-5942859361
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(semantic-layer): sync metadata from the view editor [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44808:
URL: https://github.com/apache/superset/pull/44808#issuecomment-5900774850
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(semantic-layer): sync metadata from the view editor [superset]
Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on PR #44808:
URL: https://github.com/apache/superset/pull/44808#issuecomment-5919101991
First piece of the split is up as a draft: #44834, the optional `superset-core` metadata refresh SDK contract. It has no host or runtime changes; the store/cache-identity PR with the result-key fix is next.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(semantic-layer): sync metadata from the view editor [superset]
Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on PR #44808:
URL: https://github.com/apache/superset/pull/44808#issuecomment-5942879990
Closing as superseded by the four-part split: #44834, #44835, #44849 and #44851.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(semantic-layer): sync metadata from the view editor [superset]
Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge closed pull request #44808: feat(semantic-layer): sync metadata from the view editor
URL: https://github.com/apache/superset/pull/44808
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(semantic-layer): sync metadata from the view editor [superset]
Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on PR #44808:
URL: https://github.com/apache/superset/pull/44808#issuecomment-5922272515
Third piece is up as a draft: #44849. It adds the authorized refresh/clear operations, authorizes requests before any catalog acquisition, and maps discovery errors consistently (the runtime-schema 400 and outage-as-404 issues raised here). Default-off, stacked on #44835.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(semantic-layer): sync metadata from the view editor [superset]
Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on PR #44808:
URL: https://github.com/apache/superset/pull/44808#issuecomment-5922523736
Last piece is up as a draft: #44851, which adds the Sync metadata action in the semantic view editor and reloads Explore afterwards. The full stack is #44834 → #44835 → #44849 → #44851; once these land, this draft can be closed.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(semantic-layer): sync metadata from the view editor [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #44808:
URL: https://github.com/apache/superset/pull/44808#issuecomment-5900796054
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/44808?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 81.57%. Comparing base ([`f639b22`](https://app.codecov.io/gh/apache/superset/commit/f639b22c6c869dde21c1fb22c416085745202341?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`932e9dc`](https://app.codecov.io/gh/apache/superset/commit/932e9dc712a0bf2fb4acf5c96aac0aa4e769d5c9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 7 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #44808 +/- ##
==========================================
+ Coverage 81.54% 81.57% +0.03%
==========================================
Files 2974 2979 +5
Lines 180444 181045 +601
Branches 41765 41752 -13
==========================================
+ Hits 147141 147687 +546
- Misses 30583 30638 +55
Partials 2720 2720
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/44808/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [superset-extensions-cli](https://app.codecov.io/gh/apache/superset/pull/44808/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `91.24% <ø> (?)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/44808?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(semantic-layer): sync metadata from the view editor [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #44808:
URL: https://github.com/apache/superset/pull/44808#issuecomment-5916158721
It seems that if Sync metadata can change a metric definition without bumping the semantic-view row, a chart's query cache could keep serving the pre-sync result until TTL expires, which seems to undercut the point of a manual sync button. Worth confirming that's handled before this goes up for review.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(semantic-layer): sync metadata from the view editor [superset]
Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on code in PR #44808:
URL: https://github.com/apache/superset/pull/44808#discussion_r4148649606
##########
superset/semantic_layers/models.py:
##########
@@ -506,6 +512,33 @@ def table_name(self) -> str:
def kind(self) -> str:
return "semantic_view"
+ @property
+ def metadata_cache_token(self) -> str | None:
Review Comment:
Good catch, and you're right: the captured snapshot token only reaches compatibility caching, so a Sync that changes an existing metric's definition could keep serving the pre-sync chart result until the result TTL expires. We're restructuring this work into a smaller stack of PRs. The store/cache-identity PR will include the captured metadata token in `get_extra_cache_keys`, with a regression test for a same-name metric whose definition changed. I'll link it here when it's up, and keep this draft as the reference until then.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(semantic-layer): sync metadata from the view editor [superset]
Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on PR #44808:
URL: https://github.com/apache/superset/pull/44808#issuecomment-5918460543
@rusackas thanks. Yes, same issue as Joe's thread: result keys need the captured catalog token. This PR has grown too large to review comfortably, so we're splitting it into four smaller ones (SDK contract → store and cache identity → refresh API → UI). The cache-key fix lands in the second. I'll link the stack here as each one opens.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(semantic-layer): sync metadata from the view editor [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44808:
URL: https://github.com/apache/superset/pull/44808#issuecomment-5903231391
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**Commands**
Type the following command in the pull request comment and save the comment.
- `/review` - Manually triggers an incremental AI Review.
- `/review full` - Manually triggers a full AI Review.
- `/pause` - Pauses automatic reviews on this pull request.
- `/resume` - Resumes automatic reviews.
- `/resolve` - Marks all Bito-posted review comments as resolved.
- `/abort` - Cancels all in-progress reviews.
Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(semantic-layer): sync metadata from the view editor [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #44808:
URL: https://github.com/apache/superset/pull/44808#issuecomment-5900793079
### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | 932e9dc712a0bf2fb4acf5c96aac0aa4e769d5c9 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6abc446cf79bfc0008bd9a77 |
|<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-44808--superset-docs-preview.netlify.app](https://deploy-preview-44808--superset-docs-preview.netlify.app) |
|<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br /><br /><br />_Use your smartphone camera to open QR code link._</details> |
|<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DcoxDoAgDADAv3SWBAwB8Qc-oy0QBhFSWYzx77LdcC90abUP2AEWIMGLy_TNyqxGW69qGhhxoJKUJd1lrpj62Z4jzueQ2FrH2QfKrLXeKAb0Hr4f) |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-44808--superset-docs-preview.netlify.app) -->
_To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(semantic-layer): sync metadata from the view editor [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #44808:
URL: https://github.com/apache/superset/pull/44808#discussion_r4139613797
##########
superset/semantic_layers/api.py:
##########
@@ -728,10 +883,20 @@ def runtime_schema(self, uuid: str) -> FlaskResponse:
return self.response_400(message=f"Unknown type: {layer.type}")
try:
- schema = cls.get_runtime_schema(
- layer.implementation.configuration, # type: ignore[attr-defined]
- runtime_data,
+ from superset.semantic_layers.metadata import metadata_refresh_enabled
+
+ implementation: SemanticLayerABC[Any, SemanticViewABC] = (
+ layer.implementation
)
+ schema: dict[str, Any]
+ adapter: MetadataRefreshAdapter | None = implementation.metadata_refresh
+ if metadata_refresh_enabled() and adapter is not None:
+ schema = adapter.get_runtime_schema(runtime_data)
Review Comment:
**Suggestion:** Runtime schema refresh errors such as storage outages or deadlines reach the existing broad handler and become HTTP 400 responses, misclassifying server failures as invalid client input.
**Assessment:** 🟠 `Major` · 🔁 `Occurrence: Rarely` · 🏷️ `Api mismatch`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill) [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=00b4d3363d284f78a1a17fb6e8bb5955&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=00b4d3363d284f78a1a17fb6e8bb5955&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset/semantic_layers/api.py
**Line:** 886:894
**Comment:**
*Api Mismatch: Runtime schema refresh errors such as storage outages or deadlines reach the existing broad handler and become HTTP 400 responses, misclassifying server failures as invalid client input.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44808&comment_hash=b3cc0f8dabedbd461e30ce404abdd00c98a38d6eba042403b267ee434f52ddd3&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44808&comment_hash=b3cc0f8dabedbd461e30ce404abdd00c98a38d6eba042403b267ee434f52ddd3&reaction=dislike'>👎</a>
##########
superset/daos/semantic_layer.py:
##########
@@ -123,6 +123,14 @@ class SemanticViewDAO(BaseDAO[SemanticView], AbstractSemanticViewDAO):
model_cls = SemanticView
+ @staticmethod
+ def find_by_uuid(uuid_str: str) -> SemanticView | None:
+ """Resolve a public UUID; callers must enforce view and connection access."""
+ try:
+ return db.session.query(SemanticView).filter_by(uuid=uuid_str).one_or_none()
+ except (ValueError, StatementError):
+ return None
Review Comment:
**Suggestion:** Catching `StatementError` also catches database connection failures, so outages become a missing view and incorrectly return not-found instead of exposing the database error.
**Assessment:** 🟠 `Major` · 🔁 `Occurrence: Rarely` · 🏷️ `Possible bug`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill) [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=73f74a3828514556a95400d9cc21d8a9&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=73f74a3828514556a95400d9cc21d8a9&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset/daos/semantic_layer.py
**Line:** 131:132
**Comment:**
*Possible Bug: Catching `StatementError` also catches database connection failures, so outages become a missing view and incorrectly return not-found instead of exposing the database error.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44808&comment_hash=a9440b4f962108f15a0d797d16c2dcd670203766bc6bba9753bd26602efc45e8&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44808&comment_hash=a9440b4f962108f15a0d797d16c2dcd670203766bc6bba9753bd26602efc45e8&reaction=dislike'>👎</a>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org