You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "betodealmeida (via GitHub)" <gi...@apache.org> on 2026/04/24 14:29:59 UTC

[PR] feat(semantic layers): edit modal for semantic views [superset]

betodealmeida opened a new pull request, #39628:
URL: https://github.com/apache/superset/pull/39628

   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   <img width="1728" height="1080" alt="Screenshot 2026-04-24 at 10 29 18 AM" src="https://github.com/user-attachments/assets/29176dfb-6421-4e58-8800-daadfe0d5e37" />
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] 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
   - [ ] 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: 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 layers): edit modal for semantic views [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 #39628:
URL: https://github.com/apache/superset/pull/39628#discussion_r3138399553


##########
superset-frontend/src/features/semanticViews/SemanticViewEditModal.tsx:
##########
@@ -62,6 +117,30 @@ export default function SemanticViewEditModal({
     }
   }, [semanticView]);
 
+  useEffect(() => {
+    if (show && semanticView) {
+      setStructureLoading(true);
+      SupersetClient.get({
+        endpoint: `/api/v1/semantic_view/${semanticView.id}/structure`,
+      })
+        .then(({ json }) => {
+          setStructure(json.result);
+        })

Review Comment:
   **Suggestion:** The async fetch response is applied unconditionally, so an older in-flight request can overwrite state after the modal is closed/reopened or after the selected semantic view changes. Add cancellation/ignore logic (AbortController or request token check) so only the latest active request updates `structure` and loading state. [race condition]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Semantic view edit modal can show wrong structure data.
   - ⚠️ Dimensions/metrics tabs may reflect previously edited semantic view.
   - ⚠️ Users could misinterpret schema when switching views quickly.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Navigate to the dataset list page rendered by
   `superset-frontend/src/pages/DatasetList/index.tsx`, which imports `SemanticViewEditModal`
   at line 88 and renders it at lines 1453–1460 with `show={!!svCurrentlyEditing}` and
   `semanticView={svCurrentlyEditing}`.
   
   2. Click the semantic view edit icon for Dataset A in the list (click handler at
   `DatasetList/index.tsx:816–817` calls `setSvCurrentlyEditing(original)`), causing
   `svCurrentlyEditing` to be set and the modal to open with `show` true and `semanticView`
   set to Dataset A.
   
   3. With network throttling or a slow backend, observe that `SemanticViewEditModal`
   (`SemanticViewEditModal.tsx:97–142`) runs the effect at lines 120–128 when `show &&
   semanticView` is true, issuing `SupersetClient.get({ endpoint:
   \`/api/v1/semantic_view/${semanticView.id}/structure\` })` at line 123 and starting an
   in-flight request for A's structure while `structureLoading` is set to true at line 122.
   
   4. Before the first request completes, close the modal via its close button, which
   triggers `onHide={() => setSvCurrentlyEditing(null)}` at
   `DatasetList/index.tsx:1453–1456`, making `show` false and `semanticView` null; then
   immediately click the edit icon for Dataset B so `setSvCurrentlyEditing(original)` runs
   again (lines 816–817), reopening the modal with `semanticView` set to B and causing a
   second `SupersetClient.get` call for B's structure via the same effect at
   `SemanticViewEditModal.tsx:120–128`.
   
   5. When the older request for Dataset A resolves after the newer request for Dataset B,
   its `.then(({ json }) => { setStructure(json.result); })` callback at
   `SemanticViewEditModal.tsx:126–127` still executes unconditionally, overwriting
   `structure` with A's result even though the modal title and details (bound to
   `semanticView` B at lines 177–195) now refer to Dataset B.
   
   6. Observe that the Dimensions and Metrics tabs in the modal (rendered at
   `SemanticViewEditModal.tsx:204–235`) now display A's dimensions and metrics while the
   modal header (`Edit %s` title using `semanticView?.table_name` at line 177) and
   description/cache timeout fields are for B, demonstrating stale, out-of-order structure
   data due to the missing cancellation/ignore logic for earlier in-flight requests.
   ```
   </details>
   
   [Fix in Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt=This%20is%20a%20comment%20left%20during%20a%20code%20review.%0A%0A%2A%2APath%3A%2A%2A%20superset-frontend%2Fsrc%2Ffeatures%2FsemanticViews%2FSemanticViewEditModal.tsx%0A%2A%2ALine%3A%2A%2A%20123%3A128%0A%2A%2AComment%3A%2A%2A%0A%09%2ARace%20Condition%3A%20The%20async%20fetch%20response%20is%20applied%20unconditionally%2C%20so%20an%20older%20in-flight%20request%20can%20overwrite%20state%20after%20the%20modal%20is%20closed%2Freopened%20or%20after%20the%20selected%20semantic%20view%20changes.%20Add%20cancellation%2Fignore%20logic%20%28AbortController%20or%20request%20token%20check%29%20so%20only%20the%20latest%20active%20request%20updates%20%60structure%60%20and%20loading%20state.%0A%0AValidate%20the%20correctness%20of%20the%20flagged%20issue.%20If%20correct%2C%20How%20can%20I%20resolve%20this%3F%20If%20you%20propose%20a%20fix%2C%20implement%20it%20and%20please%20make%20it%20concise.%0AOnce%20fix%20is%20implemented%
 2C%20also%20check%20other%20comments%20on%20the%20same%20PR%2C%20and%20ask%20user%20if%20the%20user%20wants%20to%20fix%20the%20rest%20of%20the%20comments%20as%20well.%20if%20said%20yes%2C%20then%20fetch%20all%20the%20comments%20validate%20the%20correctness%20and%20implement%20a%20minimal%20fix%0A) | [Fix in VSCode Claude](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt=This%20is%20a%20comment%20left%20during%20a%20code%20review.%0A%0A%2A%2APath%3A%2A%2A%20superset-frontend%2Fsrc%2Ffeatures%2FsemanticViews%2FSemanticViewEditModal.tsx%0A%2A%2ALine%3A%2A%2A%20123%3A128%0A%2A%2AComment%3A%2A%2A%0A%09%2ARace%20Condition%3A%20The%20async%20fetch%20response%20is%20applied%20unconditionally%2C%20so%20an%20older%20in-flight%20request%20can%20overwrite%20state%20after%20the%20modal%20is%20closed%2Freopened%20or%20after%20the%20selected%20semantic%20view%20changes.%20Add%20cancellation%2Fignore%20logic%20%28AbortController%20or%20request%20token%20check%29%20so%20only%20the%20lates
 t%20active%20request%20updates%20%60structure%60%20and%20loading%20state.%0A%0AValidate%20the%20correctness%20of%20the%20flagged%20issue.%20If%20correct%2C%20How%20can%20I%20resolve%20this%3F%20If%20you%20propose%20a%20fix%2C%20implement%20it%20and%20please%20make%20it%20concise.%0AOnce%20fix%20is%20implemented%2C%20also%20check%20other%20comments%20on%20the%20same%20PR%2C%20and%20ask%20user%20if%20the%20user%20wants%20to%20fix%20the%20rest%20of%20the%20comments%20as%20well.%20if%20said%20yes%2C%20then%20fetch%20all%20the%20comments%20validate%20the%20correctness%20and%20implement%20a%20minimal%20fix%0A)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/src/features/semanticViews/SemanticViewEditModal.tsx
   **Line:** 123:128
   **Comment:**
   	*Race Condition: The async fetch response is applied unconditionally, so an older in-flight request can overwrite state after the modal is closed/reopened or after the selected semantic view changes. Add cancellation/ignore logic (AbortController or request token check) so only the latest active request updates `structure` and loading state.
   
   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%2F39628&comment_hash=b0fa10795563025a0b00b2a68629ce03a7a8da00b8a7a2296819552a25bc2b7a&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39628&comment_hash=b0fa10795563025a0b00b2a68629ce03a7a8da00b8a7a2296819552a25bc2b7a&reaction=dislike'>👎</a>



##########
superset/semantic_layers/api.py:
##########
@@ -183,6 +186,76 @@ class SemanticViewRestApi(BaseSupersetModelRestApi):
 
     edit_model_schema = SemanticViewPutSchema()
 
+    @expose("/<int:pk>/structure", methods=("GET",))
+    @protect()
+    @safe
+    @statsd_metrics
+    @event_logger.log_this_with_context(
+        action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.structure",
+        log_to_statsd=False,
+    )
+    def structure(self, pk: int) -> Response:
+        """Get the structure (dimensions and metrics) of a semantic view.
+        ---
+        get:
+          summary: Get semantic view structure
+          parameters:
+          - in: path
+            schema:
+              type: integer
+            name: pk
+          responses:
+            200:
+              description: Semantic view structure
+            401:
+              $ref: '#/components/responses/401'
+            404:
+              $ref: '#/components/responses/404'
+            422:
+              $ref: '#/components/responses/422'
+        """
+        if not is_feature_enabled("SEMANTIC_LAYERS"):
+            return self.response_404()
+
+        view = db.session.query(SemanticView).filter_by(id=pk).first()
+        if not view:
+            return self.response_404()
+
+        try:
+            dimensions = [
+                {
+                    "name": dim.name,
+                    "type": str(dim.type),
+                    "definition": dim.definition,
+                    "description": dim.description,
+                    "grain": dim.grain.name if dim.grain else None,
+                }
+                for dim in sorted(
+                    view.implementation.get_dimensions(), key=lambda d: d.name
+                )
+            ]
+            metrics = [
+                {
+                    "name": metric.name,
+                    "type": str(metric.type),
+                    "definition": metric.definition,
+                    "description": metric.description,
+                }
+                for metric in sorted(
+                    view.implementation.get_metrics(), key=lambda m: m.name
+                )
+            ]
+        except Exception as ex:  # pylint: disable=broad-except
+            logger.error(
+                "Error fetching structure for semantic view %d: %s",
+                pk,
+                str(ex),
+                exc_info=True,
+            )
+            return self.response_422(message=str(ex))

Review Comment:
   **Suggestion:** The handler returns raw exception text to clients for all unexpected failures, which can leak internal implementation details (upstream errors, connection details, stack-context messages). Return a generic user-facing error message and keep full exception details only in server logs. [security]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ Internal error messages leaked in 422 response bodies.
   - ⚠️ Backend or connection details exposed to API consumers.
   - ⚠️ Inconsistent with sanitized error handling in `views` endpoint.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Start Superset with the `SEMANTIC_LAYERS` feature flag enabled (checked at
   `superset/semantic_layers/api.py:217-218` inside `SemanticViewRestApi.structure`).
   
   2. Create or configure a semantic view such that calling its implementation methods
   `get_dimensions()` or `get_metrics()` raises a runtime exception (e.g., misconfigured
   underlying semantic layer plugin or backend error). The structure endpoint at
   `superset/semantic_layers/api.py:224-247` calls `view.implementation.get_dimensions()` and
   `view.implementation.get_metrics()` inside a `try` block.
   
   3. Call `GET /api/v1/semantic_view/<pk>/structure` against that view as any user with
   class-level read permission (the route is implemented by `SemanticViewRestApi.structure`
   at `superset/semantic_layers/api.py:189-257` and guarded only by `@protect()` with
   `"structure": "read"` in `method_permission_name`).
   
   4. When the implementation raises, execution enters the broad `except Exception as ex`
   block at `superset/semantic_layers/api.py:248-255`, which logs the error and returns
   `self.response_422(message=str(ex))`. The standard error payload wiring in
   `BaseSupersetApiMixin.responses` (`superset/views/base_api.py:196-207`) causes the HTTP
   422 JSON response body to include the raw string form of the exception, exposing internal
   details (e.g., backend error messages, connection strings, or stack-context text) directly
   to the client instead of a generic user-facing error. This contrasts with the nearby
   `views` endpoint at `superset/semantic_layers/api.py:713-725`, which logs the exception
   but returns a sanitized, translated message to the client.
   ```
   </details>
   
   [Fix in Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt=This%20is%20a%20comment%20left%20during%20a%20code%20review.%0A%0A%2A%2APath%3A%2A%2A%20superset%2Fsemantic_layers%2Fapi.py%0A%2A%2ALine%3A%2A%2A%20248%3A255%0A%2A%2AComment%3A%2A%2A%0A%09%2ASecurity%3A%20The%20handler%20returns%20raw%20exception%20text%20to%20clients%20for%20all%20unexpected%20failures%2C%20which%20can%20leak%20internal%20implementation%20details%20%28upstream%20errors%2C%20connection%20details%2C%20stack-context%20messages%29.%20Return%20a%20generic%20user-facing%20error%20message%20and%20keep%20full%20exception%20details%20only%20in%20server%20logs.%0A%0AValidate%20the%20correctness%20of%20the%20flagged%20issue.%20If%20correct%2C%20How%20can%20I%20resolve%20this%3F%20If%20you%20propose%20a%20fix%2C%20implement%20it%20and%20please%20make%20it%20concise.%0AOnce%20fix%20is%20implemented%2C%20also%20check%20other%20comments%20on%20the%20same%20PR%2C%20and%20ask%20user%20if%20the%20user%20wants%20t
 o%20fix%20the%20rest%20of%20the%20comments%20as%20well.%20if%20said%20yes%2C%20then%20fetch%20all%20the%20comments%20validate%20the%20correctness%20and%20implement%20a%20minimal%20fix%0A) | [Fix in VSCode Claude](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt=This%20is%20a%20comment%20left%20during%20a%20code%20review.%0A%0A%2A%2APath%3A%2A%2A%20superset%2Fsemantic_layers%2Fapi.py%0A%2A%2ALine%3A%2A%2A%20248%3A255%0A%2A%2AComment%3A%2A%2A%0A%09%2ASecurity%3A%20The%20handler%20returns%20raw%20exception%20text%20to%20clients%20for%20all%20unexpected%20failures%2C%20which%20can%20leak%20internal%20implementation%20details%20%28upstream%20errors%2C%20connection%20details%2C%20stack-context%20messages%29.%20Return%20a%20generic%20user-facing%20error%20message%20and%20keep%20full%20exception%20details%20only%20in%20server%20logs.%0A%0AValidate%20the%20correctness%20of%20the%20flagged%20issue.%20If%20correct%2C%20How%20can%20I%20resolve%20this%3F%20If%20you%20propose%20a%20fix
 %2C%20implement%20it%20and%20please%20make%20it%20concise.%0AOnce%20fix%20is%20implemented%2C%20also%20check%20other%20comments%20on%20the%20same%20PR%2C%20and%20ask%20user%20if%20the%20user%20wants%20to%20fix%20the%20rest%20of%20the%20comments%20as%20well.%20if%20said%20yes%2C%20then%20fetch%20all%20the%20comments%20validate%20the%20correctness%20and%20implement%20a%20minimal%20fix%0A)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <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:** 248:255
   **Comment:**
   	*Security: The handler returns raw exception text to clients for all unexpected failures, which can leak internal implementation details (upstream errors, connection details, stack-context messages). Return a generic user-facing error message and keep full exception details only in server logs.
   
   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%2F39628&comment_hash=cccab99b2b4034540decafbd79af870b2420927244487b08592a88e9a60f5b9f&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39628&comment_hash=cccab99b2b4034540decafbd79af870b2420927244487b08592a88e9a60f5b9f&reaction=dislike'>👎</a>



##########
superset/semantic_layers/api.py:
##########
@@ -183,6 +186,76 @@ class SemanticViewRestApi(BaseSupersetModelRestApi):
 
     edit_model_schema = SemanticViewPutSchema()
 
+    @expose("/<int:pk>/structure", methods=("GET",))
+    @protect()
+    @safe
+    @statsd_metrics
+    @event_logger.log_this_with_context(
+        action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.structure",
+        log_to_statsd=False,
+    )
+    def structure(self, pk: int) -> Response:
+        """Get the structure (dimensions and metrics) of a semantic view.
+        ---
+        get:
+          summary: Get semantic view structure
+          parameters:
+          - in: path
+            schema:
+              type: integer
+            name: pk
+          responses:
+            200:
+              description: Semantic view structure
+            401:
+              $ref: '#/components/responses/401'
+            404:
+              $ref: '#/components/responses/404'
+            422:
+              $ref: '#/components/responses/422'
+        """
+        if not is_feature_enabled("SEMANTIC_LAYERS"):
+            return self.response_404()
+
+        view = db.session.query(SemanticView).filter_by(id=pk).first()
+        if not view:
+            return self.response_404()

Review Comment:
   **Suggestion:** This endpoint fetches a semantic view by raw ID and returns its full structure without any object-level authorization check, unlike the update/delete flows that enforce ownership. Users who only have class-level read permission can enumerate IDs and retrieve metric/dimension definitions for views they should not be able to inspect. Route this through an authorization-aware command/DAO path (or explicitly enforce ownership/access checks before returning data). [security]
   
   <details>
   <summary><b>Severity Level:</b> Critical 🚨</summary>
   
   ```mdx
   - ❌ Non-owners can read semantic view dimension definitions.
   - ❌ Non-owners can read semantic view metric definitions.
   - ⚠️ Bypasses ownership checks used in update/delete commands.
   - ⚠️ Leaks semantic modeling logic across user boundaries.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Start Superset with the `SEMANTIC_LAYERS` feature flag enabled (feature flag defined in
   `superset/config.py:576` and checked in `superset/semantic_layers/api.py:217-218` inside
   `SemanticViewRestApi.structure`).
   
   2. As User A, create a semantic layer and at least one semantic view (e.g. via the POST
   handler `SemanticViewRestApi.post` at `superset/semantic_layers/api.py:259-340`, which
   internally calls `CreateSemanticViewCommand.run()` in
   `superset/commands/semantic_layer/create.py:74-91` and persists a `SemanticView` row with
   an integer `id`).
   
   3. As User B, ensure they have class-level read permission on `SemanticView` (the API
   exposes `base_permissions = ["can_read", "can_write"]` and maps `"structure": "read"` in
   `method_permission_name` at `superset/semantic_layers/api.py:173-179`, so `@protect()` on
   `structure` only requires the `can_read` permission) but are not an owner of User A's
   semantic view. Ownership-based checks for views are enforced only in commands:
   `UpdateSemanticViewCommand.validate` (`superset/commands/semantic_layer/update.py:64-72`)
   and `DeleteSemanticViewCommand.validate`
   (`superset/commands/semantic_layer/delete.py:81-88`) both call
   `security_manager.raise_for_ownership(self._model)` and raise `SemanticViewForbiddenError`
   if User B is not an owner.
   
   4. While logged in as User B, call the structure endpoint for User A's view by ID: `GET
   /api/v1/semantic_view/<pk>/structure` (route implemented by
   `SemanticViewRestApi.structure` at `superset/semantic_layers/api.py:189-257`, which loads
   the row via `db.session.query(SemanticView).filter_by(id=pk).first()` at line 220 without
   any ownership check). Observe that the response is `200 OK` with full `dimensions` and
   `metrics` metadata derived from `view.implementation.get_dimensions()` / `get_metrics()`
   instead of a `403`/`404` as would happen on update/delete. This demonstrates that
   object-level access control (ownership) is bypassed for reading semantic view structure,
   unlike the update/delete flows that go through the command layer with
   `security_manager.raise_for_ownership`.
   ```
   </details>
   
   [Fix in Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt=This%20is%20a%20comment%20left%20during%20a%20code%20review.%0A%0A%2A%2APath%3A%2A%2A%20superset%2Fsemantic_layers%2Fapi.py%0A%2A%2ALine%3A%2A%2A%20220%3A222%0A%2A%2AComment%3A%2A%2A%0A%09%2ASecurity%3A%20This%20endpoint%20fetches%20a%20semantic%20view%20by%20raw%20ID%20and%20returns%20its%20full%20structure%20without%20any%20object-level%20authorization%20check%2C%20unlike%20the%20update%2Fdelete%20flows%20that%20enforce%20ownership.%20Users%20who%20only%20have%20class-level%20read%20permission%20can%20enumerate%20IDs%20and%20retrieve%20metric%2Fdimension%20definitions%20for%20views%20they%20should%20not%20be%20able%20to%20inspect.%20Route%20this%20through%20an%20authorization-aware%20command%2FDAO%20path%20%28or%20explicitly%20enforce%20ownership%2Faccess%20checks%20before%20returning%20data%29.%0A%0AValidate%20the%20correctness%20of%20the%20flagged%20issue.%20If%20correct%2C%20How%20can%20I%20resolve%20this%3F
 %20If%20you%20propose%20a%20fix%2C%20implement%20it%20and%20please%20make%20it%20concise.%0AOnce%20fix%20is%20implemented%2C%20also%20check%20other%20comments%20on%20the%20same%20PR%2C%20and%20ask%20user%20if%20the%20user%20wants%20to%20fix%20the%20rest%20of%20the%20comments%20as%20well.%20if%20said%20yes%2C%20then%20fetch%20all%20the%20comments%20validate%20the%20correctness%20and%20implement%20a%20minimal%20fix%0A) | [Fix in VSCode Claude](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt=This%20is%20a%20comment%20left%20during%20a%20code%20review.%0A%0A%2A%2APath%3A%2A%2A%20superset%2Fsemantic_layers%2Fapi.py%0A%2A%2ALine%3A%2A%2A%20220%3A222%0A%2A%2AComment%3A%2A%2A%0A%09%2ASecurity%3A%20This%20endpoint%20fetches%20a%20semantic%20view%20by%20raw%20ID%20and%20returns%20its%20full%20structure%20without%20any%20object-level%20authorization%20check%2C%20unlike%20the%20update%2Fdelete%20flows%20that%20enforce%20ownership.%20Users%20who%20only%20have%20class-level%20read%20p
 ermission%20can%20enumerate%20IDs%20and%20retrieve%20metric%2Fdimension%20definitions%20for%20views%20they%20should%20not%20be%20able%20to%20inspect.%20Route%20this%20through%20an%20authorization-aware%20command%2FDAO%20path%20%28or%20explicitly%20enforce%20ownership%2Faccess%20checks%20before%20returning%20data%29.%0A%0AValidate%20the%20correctness%20of%20the%20flagged%20issue.%20If%20correct%2C%20How%20can%20I%20resolve%20this%3F%20If%20you%20propose%20a%20fix%2C%20implement%20it%20and%20please%20make%20it%20concise.%0AOnce%20fix%20is%20implemented%2C%20also%20check%20other%20comments%20on%20the%20same%20PR%2C%20and%20ask%20user%20if%20the%20user%20wants%20to%20fix%20the%20rest%20of%20the%20comments%20as%20well.%20if%20said%20yes%2C%20then%20fetch%20all%20the%20comments%20validate%20the%20correctness%20and%20implement%20a%20minimal%20fix%0A)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <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:** 220:222
   **Comment:**
   	*Security: This endpoint fetches a semantic view by raw ID and returns its full structure without any object-level authorization check, unlike the update/delete flows that enforce ownership. Users who only have class-level read permission can enumerate IDs and retrieve metric/dimension definitions for views they should not be able to inspect. Route this through an authorization-aware command/DAO path (or explicitly enforce ownership/access checks before returning data).
   
   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%2F39628&comment_hash=eaf5046889339ad2f23aaf2d535eb1643adc29e4bd27fc30e1cd9a4b3911147c&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39628&comment_hash=eaf5046889339ad2f23aaf2d535eb1643adc29e4bd27fc30e1cd9a4b3911147c&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


Re: [PR] feat(semantic layers): edit modal for semantic views [superset]

Posted by "betodealmeida (via GitHub)" <gi...@apache.org>.
betodealmeida merged PR #39628:
URL: https://github.com/apache/superset/pull/39628


-- 
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 layers): edit modal for semantic views [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #39628:
URL: https://github.com/apache/superset/pull/39628#issuecomment-4313942491

   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 layers): edit modal for semantic views [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #39628:
URL: https://github.com/apache/superset/pull/39628#issuecomment-4314046070

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/39628?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 60.96%. Comparing base ([`2347705`](https://app.codecov.io/gh/apache/superset/commit/234770511e0db5dc5514acbd37cd8148a067bc96?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`04e768f`](https://app.codecov.io/gh/apache/superset/commit/04e768f9473874477b0682909563815d596d6024?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 1 commits behind head on semantic-layer-extension.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@                     Coverage Diff                      @@
   ##           semantic-layer-extension   #39628      +/-   ##
   ============================================================
   + Coverage                     60.90%   60.96%   +0.05%     
   ============================================================
     Files                           741      741              
     Lines                         61035    60862     -173     
     Branches                       7355     7331      -24     
   ============================================================
   - Hits                          37175    37104      -71     
   + Misses                        22352    22248     -104     
   - Partials                       1508     1510       +2     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/39628/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hive](https://app.codecov.io/gh/apache/superset/pull/39628/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `39.47% <0.00%> (+0.02%)` | :arrow_up: |
   | [mysql](https://app.codecov.io/gh/apache/superset/pull/39628/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [postgres](https://app.codecov.io/gh/apache/superset/pull/39628/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `59.57% <0.00%> (+0.07%)` | :arrow_up: |
   | [presto](https://app.codecov.io/gh/apache/superset/pull/39628/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `41.20% <0.00%> (+0.02%)` | :arrow_up: |
   | [python](https://app.codecov.io/gh/apache/superset/pull/39628/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `60.94% <100.00%> (+0.06%)` | :arrow_up: |
   | [sqlite](https://app.codecov.io/gh/apache/superset/pull/39628/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `59.21% <0.00%> (+0.07%)` | :arrow_up: |
   | [unit](https://app.codecov.io/gh/apache/superset/pull/39628/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `100.00% <100.00%> (ø)` | |
   
   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 Sentry](https://app.codecov.io/gh/apache/superset/pull/39628?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 layers): edit modal for semantic views [superset]

Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #39628:
URL: https://github.com/apache/superset/pull/39628#issuecomment-4313954631

   ### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">🔨</span> Latest commit | 04e768f9473874477b0682909563815d596d6024 |
   |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/69eb7e6730419400080fa197 |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-39628--superset-docs-preview.netlify.app](https://deploy-preview-39628--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTM5NjI4LS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.qZRQ59oDpABxBacvJJ30ug0pUa1yMUxBynWugB3xx5c)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-39628--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