You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "VanessaGiannoni (via GitHub)" <gi...@apache.org> on 2026/01/08 22:42:22 UTC
[PR] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [superset]
VanessaGiannoni opened a new pull request, #36990:
URL: https://github.com/apache/superset/pull/36990
<!---
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 -->
Fixes a case-sensitivity issue causing table aggregation to break when a temporal column is renamed with different casing. The `time_grain_sqla` visibility check in the AG Grid Table control panel is made case-insensitive, ensuring time grain aggregation is applied even after renaming. Adds a unit test to prevent regressions.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
### TESTING INSTRUCTIONS
<!--- Required! What steps can be taken to manually verify the changes? -->
1. In Explore, create a Table chart with a dataset that has an uppercase temporal column (e.g., `ORDERDATE`).
2. Enable Aggregate, add the temporal column to Dimensions, set Month time grain, update chart. Verify aggregation works.
3. Rename the temporal column to lowercase (e.g., `orderdate`) and update chart.
4. Verify aggregation still follows the selected time grain.
Unit test:
- From superset-frontend, run:
- `npm run test -- plugins/plugin-chart-ag-grid-table/test/controlPanel.test.ts`
### 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] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #36990:
URL: https://github.com/apache/superset/pull/36990#issuecomment-3738356588
CodeAnt AI is reviewing your PR.
---
### Thanks for using CodeAnt! ๐
We're free for open-source projects. if you're enjoying it, help us grow by sharing.
[Share on X](https://twitter.com/intent/tweet?text=Just%20tried%20%40CodeAntAI%20for%20automated%20code%20review%20and%20I%27m%20impressed%21%20Free%20for%20open%20source%20with%20a%20free%20trial%20for%20private%20repos.%20Worth%20checking%20out%3A&url=https%3A//codeant.ai) ยท
[Reddit](https://www.reddit.com/submit?title=Check%20out%20CodeAnt%20for%20automated%20code%20review&text=Just%20tried%20CodeAnt%20for%20automated%20code%20review%20and%20I%27m%20impressed%21%20Free%20for%20open%20source%20with%20a%20free%20trial%20for%20private%20repos.%20Worth%20checking%20out%3A%20https%3A//codeant.ai) ยท
[LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcodeant.ai&mini=true&title=Check%20out%20CodeAnt%20for%20automated%20code%20review&summary=Just%20tried%20CodeAnt%20for%20automated%20code%20review%20and%20I%27m%20impressed%21%20Free%20for%20open%20source%20with%20a%20free%20trial%20for%20private%20repos)
--
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] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [superset]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #36990:
URL: https://github.com/apache/superset/pull/36990#issuecomment-3737731051
โ ๏ธ **DEPRECATED WORKFLOW** โ ๏ธ
@alexandrusoare This workflow is deprecated! Please use the new **Superset Showtime** system instead:
- Replace "testenv-up" label with "๐ช trigger-start"
- Better reliability and easier management
- See https://github.com/mistercrunch/superset-showtime for details
Processing your ephemeral environment request [here](https://github.com/apache/superset/actions/runs/20915112124). Action: **up**. More information on [how to use or configure ephemeral environments](https://superset.apache.org/docs/contributing/howtos/#github-ephemeral-environments)
--
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] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [superset]
Posted by "amaannawab923 (via GitHub)" <gi...@apache.org>.
amaannawab923 commented on code in PR #36990:
URL: https://github.com/apache/superset/pull/36990#discussion_r2686169462
##########
superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx:
##########
@@ -252,7 +252,7 @@ const config: ControlPanelConfig = {
visibility: ({ controls }) => {
const dttmLookup = Object.fromEntries(
ensureIsArray(controls?.groupby?.options).map(option => [
- option.column_name,
+ (option.column_name || '').toLowerCase(),
option.is_dttm,
]),
Review Comment:
@VanessaGiannoni Yes, this is an excessive check and we can safely ignore it.
Here's why:
controls?.groupby?.options contains ColumnMeta[] objects - these are datasource metadata (column definitions from the database schema), not user selections.
The ColumnMeta interface extends Column which defines column_name: string - it's always a string at the type level, and at runtime these objects come directly from the dataset schema where column names are inherently strings.
The confusion here is that CodeAnt AI conflated two different things:
1.groupby.value (user selections) โ Can be string OR object (AdhocColumn)
2. groupby.options (datasource metadata) โ Always ColumnMeta objects with column_name: string
I verified this locally by logging controls?.groupby?.options?.map(o => o.column_name) and confirmed all values are strings.
--
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] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [superset]
Posted by "VanessaGiannoni (via GitHub)" <gi...@apache.org>.
VanessaGiannoni commented on code in PR #36990:
URL: https://github.com/apache/superset/pull/36990#discussion_r2682105969
##########
superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx:
##########
@@ -252,7 +252,7 @@ const config: ControlPanelConfig = {
visibility: ({ controls }) => {
const dttmLookup = Object.fromEntries(
ensureIsArray(controls?.groupby?.options).map(option => [
- option.column_name,
+ option.column_name.toLowerCase(),
Review Comment:
Good catch! Fixed
--
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] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #36990:
URL: https://github.com/apache/superset/pull/36990#issuecomment-3738369068
CodeAnt AI finished reviewing your 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] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [superset]
Posted by "amaannawab923 (via GitHub)" <gi...@apache.org>.
amaannawab923 commented on code in PR #36990:
URL: https://github.com/apache/superset/pull/36990#discussion_r2682077477
##########
superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx:
##########
@@ -252,7 +252,7 @@ const config: ControlPanelConfig = {
visibility: ({ controls }) => {
const dttmLookup = Object.fromEntries(
ensureIsArray(controls?.groupby?.options).map(option => [
- option.column_name,
+ option.column_name.toLowerCase(),
Review Comment:
(option.column_name || '').toLowerCase()
Can we please add better null safety here
--
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] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe merged PR #36990:
URL: https://github.com/apache/superset/pull/36990
--
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] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #36990:
URL: https://github.com/apache/superset/pull/36990#issuecomment-3738366057
## Nitpicks ๐
<table>
<tr><td>๐ <strong>No security issues identified</strong></td></tr>
<tr><td>โก <strong>Recommended areas for review</strong><br><br>
- [ ] <a href='https://github.com/apache/superset/pull/36990/files#diff-284708d992f68953fcc53db62a3973d8182944146110ec8b630aa2694cc37f40R260-R267'><strong>Runtime type assumption</strong></a><br>The new lookup uses (selection || '').toLowerCase() and assumes `selection` is a string. If `isPhysicalColumn(selection)` can be true for objects (e.g., objects with `column_name`), calling `toLowerCase()` directly may throw at runtime. Verify the guard guarantees a string or coerce/extract the column name safely.<br>
- [ ] <a href='https://github.com/apache/superset/pull/36990/files#diff-284708d992f68953fcc53db62a3973d8182944146110ec8b630aa2694cc37f40R253-R257'><strong>Prototype key / lookup safety</strong></a><br>`Object.fromEntries` builds a plain object for `dttmLookup`. Using user-controlled column names as keys may create collisions with special keys like `__proto__`, or other inherited properties. Consider using a Map or an object with null prototype to avoid prototype pollution and accidental collisions.<br>
- [ ] <a href='https://github.com/apache/superset/pull/36990/files#diff-284708d992f68953fcc53db62a3973d8182944146110ec8b630aa2694cc37f40R249-R271'><strong>Case-collisions</strong></a><br>Converting column names to lowercase intentionally collapses columns that only differ by case. This resolves the case-insensitivity bug but may hide columns that legitimately differ only by casing. Confirm this behavior is desirable across consumers and document/handle any unexpected duplicates.<br>
- [ ] <a href='https://github.com/apache/superset/pull/36990/files#diff-fc79d7f1ec660a1b22f37eb1c00181fceafd31e30066c9c719830782b204361eR56-R68'><strong>Column options casing scenarios</strong></a><br>The default `options` only contains an uppercase `ORDERDATE`. The code path being fixed concerns renamed columns (different casing). Add tests that simulate the dataset options changing to a lowercase `orderdate` (i.e., the option list itself containing a different-cased column_name) to ensure visibility remains correct.<br>
- [ ] <a href='https://github.com/apache/superset/pull/36990/files#diff-fc79d7f1ec660a1b22f37eb1c00181fceafd31e30066c9c719830782b204361eR70-R77'><strong>Multi-value groupby not tested</strong></a><br>The new test only asserts visibility when a single groupby value is present. In real usage, users can select multiple groupby columns; ensure the visibility remains true when a temporal column appears alongside other columns (mixed arrays). Add coverage for multi-selection cases to prevent regressions.<br>
</td></tr>
</table>
--
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] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [superset]
Posted by "dirivasm (via GitHub)" <gi...@apache.org>.
dirivasm commented on PR #36990:
URL: https://github.com/apache/superset/pull/36990#issuecomment-3801455972
# Test Summary
This has been tested - and the issue is fixed :white_check_mark: - agg tables are working fine with uppercase or lowercase column names
It is ready to be merged!
--
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] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on PR #36990:
URL: https://github.com/apache/superset/pull/36990#issuecomment-3801853033
Verified by QA
--
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] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [superset]
Posted by "VanessaGiannoni (via GitHub)" <gi...@apache.org>.
VanessaGiannoni commented on code in PR #36990:
URL: https://github.com/apache/superset/pull/36990#discussion_r2682195333
##########
superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx:
##########
@@ -252,7 +252,7 @@ const config: ControlPanelConfig = {
visibility: ({ controls }) => {
const dttmLookup = Object.fromEntries(
ensureIsArray(controls?.groupby?.options).map(option => [
- option.column_name,
+ (option.column_name || '').toLowerCase(),
option.is_dttm,
]),
Review Comment:
@amaannawab923 I'd love to hear your thoughts on this. It seems valid to me, but perhaps it's excessive. Do you know if we're always going to have a `string` as an `option.column_name`? If so, I can ignore this comment.
--
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] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #36990:
URL: https://github.com/apache/superset/pull/36990#issuecomment-3738600315
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 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] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [superset]
Posted by "VanessaGiannoni (via GitHub)" <gi...@apache.org>.
VanessaGiannoni commented on PR #36990:
URL: https://github.com/apache/superset/pull/36990#issuecomment-3781284673
@rusackas, would you be able to merge this PR for me? It was already approved last week. Appreciate it
--
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] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #36990:
URL: https://github.com/apache/superset/pull/36990#issuecomment-3729243290
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 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] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [superset]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #36990:
URL: https://github.com/apache/superset/pull/36990#issuecomment-3737805626
@alexandrusoare Ephemeral environment spinning up at http://34.218.59.7:8080. Credentials are 'admin'/'admin'. Please allow several minutes for bootstrapping and startup.
--
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] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #36990:
URL: https://github.com/apache/superset/pull/36990#issuecomment-3738331908
<!-- Bito Reply -->
To improve null safety, use optional chaining on `option` in case it's null, combined with the fallback: `(option?.column_name || '').toLowerCase()`. This prevents errors if `option` is undefined while still handling `column_name` being null.
**superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx**
```
(option?.column_name || '').toLowerCase(),
```
--
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] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [superset]
Posted by "amaannawab923 (via GitHub)" <gi...@apache.org>.
amaannawab923 commented on code in PR #36990:
URL: https://github.com/apache/superset/pull/36990#discussion_r2682078640
##########
superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx:
##########
@@ -263,7 +263,7 @@ const config: ControlPanelConfig = {
return true;
}
if (isPhysicalColumn(selection)) {
- return !!dttmLookup[selection];
+ return !!dttmLookup[selection.toLowerCase()];
Review Comment:
(selection || '').toLowerCase()
Can we please add better null safety here
--
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] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [superset]
Posted by "amaannawab923 (via GitHub)" <gi...@apache.org>.
amaannawab923 commented on code in PR #36990:
URL: https://github.com/apache/superset/pull/36990#discussion_r2686170249
##########
superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx:
##########
@@ -263,7 +263,7 @@ const config: ControlPanelConfig = {
return true;
}
if (isPhysicalColumn(selection)) {
- return !!dttmLookup[selection];
+ return !!dttmLookup[(selection || '').toLowerCase()];
Review Comment:
Same as above , Should be Safe to Ignore
--
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] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [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 #36990:
URL: https://github.com/apache/superset/pull/36990#discussion_r2682116249
##########
superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx:
##########
@@ -252,7 +252,7 @@ const config: ControlPanelConfig = {
visibility: ({ controls }) => {
const dttmLookup = Object.fromEntries(
ensureIsArray(controls?.groupby?.options).map(option => [
- option.column_name,
+ (option.column_name || '').toLowerCase(),
option.is_dttm,
]),
Review Comment:
**Suggestion:** Robustness bug: the mapping uses `option.column_name` without guarding against `option` being null/other types; accessing `.column_name` on `null`/`undefined` would throw. Normalize option names defensively (handle string vs object vs null) before calling `.toLowerCase()`. [possible bug]
**Severity Level:** Critical ๐จ
```suggestion
ensureIsArray(controls?.groupby?.options).map(option => {
const name =
typeof option === 'string' ? option : option?.column_name ?? '';
return [name.toLowerCase(), option?.is_dttm];
}),
```
<details>
<summary><b>Why it matters? โญ </b></summary>
The suggestion to defensive-check option (string vs object vs null) is sensible โ the current code assumes option is an object with column_name.
Using a small normalization (typeof option === 'string' ? option : option?.column_name ?? '') prevents potential exceptions and handles more input shapes robustly.
</details>
<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-ag-grid-table/src/controlPanel.tsx
**Line:** 254:257
**Comment:**
*Possible Bug: Robustness bug: the mapping uses `option.column_name` without guarding against `option` being null/other types; accessing `.column_name` on `null`/`undefined` would throw. Normalize option names defensively (handle string vs object vs null) before calling `.toLowerCase()`.
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.
```
</details>
##########
superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx:
##########
@@ -263,7 +263,7 @@ const config: ControlPanelConfig = {
return true;
}
if (isPhysicalColumn(selection)) {
- return !!dttmLookup[selection];
+ return !!dttmLookup[(selection || '').toLowerCase()];
Review Comment:
**Suggestion:** Runtime TypeError: the code calls `.toLowerCase()` on `selection` without ensuring it's a string. When `selection` is an object (e.g. a column object), `(selection || '').toLowerCase()` will attempt to call `toLowerCase` on an object and throw. Extract the column name safely (handle string vs object) before lowercasing and looking up in `dttmLookup`. [type error]
**Severity Level:** Minor โ ๏ธ
```suggestion
const colKey =
typeof selection === 'string'
? selection.toLowerCase()
: (selection?.column_name || '').toLowerCase();
return !!dttmLookup[colKey];
```
<details>
<summary><b>Why it matters? โญ </b></summary>
This is a valid runtime bug: selection can be an object (column descriptor) not a string,
so (selection || '').toLowerCase() may attempt to call toLowerCase on an object and throw.
The improved code safely extracts a string key (handles string vs object) before lowercasing
and fixes the potential TypeError.
</details>
<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-ag-grid-table/src/controlPanel.tsx
**Line:** 266:266
**Comment:**
*Type Error: Runtime TypeError: the code calls `.toLowerCase()` on `selection` without ensuring it's a string. When `selection` is an object (e.g. a column object), `(selection || '').toLowerCase()` will attempt to call `toLowerCase` on an object and throw. Extract the column name safely (handle string vs object) before lowercasing and looking up in `dttmLookup`.
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.
```
</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] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #36990:
URL: https://github.com/apache/superset/pull/36990#issuecomment-3726198171
### <span aria-hidden="true">โ
</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">๐จ</span> Latest commit | f4746807e5e855fcc4fb854708de3337548e60ef |
|<span aria-hidden="true">๐</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/696032d01dbeb500082f8775 |
|<span aria-hidden="true">๐</span> Deploy Preview | [https://deploy-preview-36990--superset-docs-preview.netlify.app](https://deploy-preview-36990--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> |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-36990--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] fix(ag-grid-table): preserve time grain aggregation when temporal column casing changes [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #36990:
URL: https://github.com/apache/superset/pull/36990#issuecomment-3726171503
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