codeant-ai-for-open-source[bot] commented on code in PR #37516:
URL: https://github.com/apache/superset/pull/37516#discussion_r3689715561


##########
superset/commands/chart/data/get_data_command.py:
##########
@@ -69,5 +73,33 @@ def run(self, **kwargs: Any) -> dict[str, Any]:
 
         return return_value
 
+    def execute(self, **kwargs: Any) -> ChartDataExecutionResult:
+        """Execute and return timing as a typed sidecar."""
+        cache_query_context = kwargs.get("cache", False)
+        force_cached = kwargs.get("force_cached", False)
+        try:
+            result = self._query_context.get_payload_result(
+                cache_query_context=cache_query_context,
+                force_cached=force_cached,
+            )
+        except CacheLoadError as ex:
+            raise ChartDataCacheLoadError(ex.message) from ex
+
+        for query in result.queries:
+            emit_query_timing(query.timing)

Review Comment:
   **Suggestion:** Timing emission is implemented only in `execute()`, while 
existing chart-data callers such as cache loading, cache warmup, and MCP 
execution continue calling `run()`. Those executions therefore collect timing 
through the new result path but never call `emit_query_timing`, so the promised 
per-query timing metrics are silently missing outside the HTTP response path. 
Route `run()` through the timing-aware execution flow or emit the sidecar 
timing for every chart-data command execution. [incomplete implementation]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ Cache warmup timing metrics are silently omitted.
   - ⚠️ Celery chart-cache executions omit query phase metrics.
   - ⚠️ MCP query executions omit `chart_data.query.*` metrics.
   - ⚠️ Observability is inconsistent across chart-data entry points.
   ```
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=23698c7f2c7345088305b9f1a8810e86&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=23698c7f2c7345088305b9f1a8810e86&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(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/commands/chart/data/get_data_command.py
   **Line:** 80:89
   **Comment:**
        *Incomplete Implementation: Timing emission is implemented only in 
`execute()`, while existing chart-data callers such as cache loading, cache 
warmup, and MCP execution continue calling `run()`. Those executions therefore 
collect timing through the new result path but never call `emit_query_timing`, 
so the promised per-query timing metrics are silently missing outside the HTTP 
response path. Route `run()` through the timing-aware execution flow or emit 
the sidecar timing for every chart-data command execution.
   
   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%2F37516&comment_hash=ce5cbc7d0149423352d1a0c1b8029c64d22b5bafb9011d3c0a86bf94d1de1e0a&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F37516&comment_hash=ce5cbc7d0149423352d1a0c1b8029c64d22b5bafb9011d3c0a86bf94d1de1e0a&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: [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]

Reply via email to