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


##########
superset-frontend/plugins/plugin-chart-table/src/buildQuery.ts:
##########
@@ -41,6 +42,36 @@ import { isEmpty } from 'lodash-es';
 import { TableChartFormData } from './types';
 import { updateTableOwnState } from './DataTable/utils/externalAPIs';
 
+// Only recognized duration choices are safe to treat as dormant. Legacy date
+// formats and anchored week intervals are not semantic-layer durations.
+const DURATION_GRAINS = new Set<string>(
+  Object.values(TimeGranularity).filter(
+    grain => grain.startsWith('P') && !grain.includes('/'),
+  ),
+);
+
+function omitDormantGrain(
+  query: QueryObject,
+  temporalColumns: Record<string, boolean> | undefined,
+): QueryObject {
+  const grain = query.extras?.time_grain_sqla;
+  if (
+    typeof grain !== 'string' ||
+    !DURATION_GRAINS.has(grain) ||
+    query.granularity ||
+    query.is_timeseries ||
+    !Array.isArray(query.columns) ||
+    !query.columns.every(
+      column => isPhysicalColumn(column) && temporalColumns?.[column] === 
false,

Review Comment:
   **Suggestion:** Column metadata keys preserve case, but selected columns may 
differ in case; known non-temporal columns then look unknown and retain the 
dormant grain.
   
   **Assessment:** ๐ŸŸ  `Major` ยท ๐Ÿ” `Occurrence: Rarely` ยท ๐Ÿท๏ธ `Logic error`
   
   [![Use CodeAnt 
Skill](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/use-codeant-skill-flat-v2.svg)](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
 [![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=cff3bea541774170acd9c05b623e942b&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=cff3bea541774170acd9c05b623e942b&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-frontend/plugins/plugin-chart-table/src/buildQuery.ts
   **Line:** 64:65
   **Comment:**
        *Logic Error: Column metadata keys preserve case, but selected columns 
may differ in case; known non-temporal columns then look unknown and retain the 
dormant grain.
   
   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%2F44455&comment_hash=88d92960dc354ed84b28a1e94f7d0872a53ed9cea9c17214190ad3f181f5cbc5&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44455&comment_hash=88d92960dc354ed84b28a1e94f7d0872a53ed9cea9c17214190ad3f181f5cbc5&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