You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "Mayankaggarwal8055 (via GitHub)" <gi...@apache.org> on 2026/03/16 16:37:45 UTC
[PR] fix(echarts): improve dash patterns for time-shifted series [superset]
Mayankaggarwal8055 opened a new pull request, #38680:
URL: https://github.com/apache/superset/pull/38680
Fixes #38639.
This PR improves the dash styles used for time-shifted derived series in ECharts timeseries charts.
Previously, derived series used small generated dash patterns that could look too similar when multiple offsets were shown together, especially for comparisons like `1 year ago` and `2 years ago`. That made the lines harder to distinguish even when the colors were aligned through `timeShiftColor`.
This change assigns clearer and more visible dash patterns per time offset, while keeping the pattern consistent for the same offset within the chart.
## What changed
- replaced the incremental generated dash logic with a fixed set of more distinct dash patterns
- mapped each time offset to a stable pattern index
- preserved existing derived series opacity styling
- kept compatibility with existing time-shift color behavior
## Why
This makes multiple derived series easier to visually distinguish in time comparison charts without changing the intended color grouping.
## Testing
- reproduced issue #38639 locally
- verified the chart locally with multiple time offsets
- confirmed the updated dash patterns are more visually distinct for derived series
--
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(echarts): improve dash patterns for time-shifted series [superset]
Posted by "Mayankaggarwal8055 (via GitHub)" <gi...@apache.org>.
Mayankaggarwal8055 commented on PR #38680:
URL: https://github.com/apache/superset/pull/38680#issuecomment-4131805376
Thanks @justinpark for the feedback and improvements!
I see that a more complete solution (including symbol markers and additional fixes) has been proposed in a separate PR. That approach makes the comparison much clearer and also addresses cases I missed.
Closing this PR to avoid duplication and will incorporate these learnings into future contributions.
--
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(echarts): improve dash patterns for time-shifted series [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38680:
URL: https://github.com/apache/superset/pull/38680#issuecomment-4069035136
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] fix(echarts): improve dash patterns for time-shifted series [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 #38680:
URL: https://github.com/apache/superset/pull/38680#discussion_r2969656809
##########
superset/models/helpers.py:
##########
@@ -2735,6 +2735,20 @@ def get_sqla_query( # pylint: disable=too-many-arguments,too-many-locals,too-ma
m.metric_name: m for m in self.metrics
}
+ metric_names = {
+ m.metric_name
+ for m in self.metrics
+ if getattr(m, "metric_name", None)
+ }
+
+ for col in self.columns:
+ if (
+ col.verbose_name
+ and col.verbose_name not in columns_by_name
+ and col.verbose_name not in metric_names
+ ):
+ columns_by_name[col.verbose_name] = col
+
Review Comment:
**Suggestion:** The new verbose-name mapping only updates `columns_by_name`, but `quoted_columns_by_name` is built earlier and never updated. In non-grouped column queries, lookup happens against `quoted_columns_by_name`, so a verbose label can be treated as a raw SQL literal instead of a real dataset column, causing invalid SQL or wrong column resolution. Update the quoted map at the same time you add verbose-name aliases. [logic error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ⚠️ Non-grouped verbose-column selects can resolve incorrect SQL expressions.
- ⚠️ Query generation path becomes inconsistent across grouped versus non-grouped.
```
</details>
```suggestion
quoted_columns_by_name[quote(col.verbose_name)] = col
```
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Trigger SQL generation through chart query flow (`superset/charts/data/api.py:140` POST
`/api/v1/chart/data` or `:22` saved chart path), which builds a `QueryContext` and
eventually calls datasource query execution.
2. Execution reaches `QueryContextProcessor.get_df_payload()`
(`superset/common/query_context_processor.py:62`) → `get_query_result()` (`:166-174`) →
datasource `get_sqla_query()` in `superset/models/helpers.py`.
3. In `get_sqla_query()`, verbose aliases are added only to `columns_by_name`
(`helpers.py:2744-2750`), but `quoted_columns_by_name` was already frozen earlier
(`helpers.py:2732`).
4. For non-grouped column selects (`need_groupby` false at `helpers.py:2722`; branch at
`helpers.py:2905+`), lookup uses `quoted_columns_by_name` (`helpers.py:2923-2928`). A
verbose-name column misses that map and falls back to `literal_column(selected)`
(`helpers.py:2929-2930`), producing raw SQL literal handling instead of dataset-column
resolution.
```
</details>
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset/models/helpers.py
**Line:** 2751:2751
**Comment:**
*Logic Error: The new verbose-name mapping only updates `columns_by_name`, but `quoted_columns_by_name` is built earlier and never updated. In non-grouped column queries, lookup happens against `quoted_columns_by_name`, so a verbose label can be treated as a raw SQL literal instead of a real dataset column, causing invalid SQL or wrong column resolution. Update the quoted map at the same time you add verbose-name aliases.
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>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38680&comment_hash=bf53d830f26de8f6d42369b0c40a907c46c85c4b8103c6174deba4aac8fc9616&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38680&comment_hash=bf53d830f26de8f6d42369b0c40a907c46c85c4b8103c6174deba4aac8fc9616&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] fix(echarts): improve dash patterns for time-shifted series [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on code in PR #38680:
URL: https://github.com/apache/superset/pull/38680#discussion_r2988651402
##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts:
##########
@@ -987,8 +943,18 @@ export default function transformProps(
scrollDataIndex: legendIndex || 0,
data:
colorByPrimaryAxis && groupBy.length === 0
- ? colorByPrimaryAxisLegendData
- : sortedLegendData,
+ ? // When colorByPrimaryAxis, configure legend items with roundRect icons
+ legendData.map(name => ({
+ name,
+ icon: 'roundRect',
+ }))
+ : // Otherwise use normal legend data
+ legendData.sort((a: string, b: string) => {
+ if (!legendSort) return 0;
+ return legendSort === 'asc'
+ ? a.localeCompare(b)
+ : b.localeCompare(a);
+ }),
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Array mutation changes return value</b></div>
<div id="fix">
Calling sort() directly on legendData mutates the array in place, which changes the order of the legendData returned in the transformed props. This alters the API behavior compared to the original code that used a sorted copy. Use a spread copy to maintain the original array's order.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
````suggestion
[...legendData].sort((a: string, b: string) => {
if (!legendSort) return 0;
return legendSort === 'asc'
? a.localeCompare(b)
: b.localeCompare(a);
}),
````
</div>
</details>
</div>
<small><i>Code Review Run #420fd9</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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(echarts): improve dash patterns for time-shifted series [superset]
Posted by "justinpark (via GitHub)" <gi...@apache.org>.
justinpark commented on PR #38680:
URL: https://github.com/apache/superset/pull/38680#issuecomment-4101534820
@Mayankaggarwal8055 Thanks for the contribution.
The following files do not seem to be related to this issue.
[UploadDataModal.test.tsx](https://github.com/apache/superset/pull/38680/changes#diff-7a0a682e53c3c72886076d2348540440a428aa3813c0bb7de7474827bec94b54)
superset/models
[helpers.py](https://github.com/apache/superset/pull/38680/changes#diff-595987046ff00d1af428f8b7360bdd1372bef133a42e58ff8ede585ea98cd254)
tests/unit_tests/models
[helpers_test.py](https://github.com/apache/superset/pull/38680/changes#diff-a81ff36c0086b2ec0776dd690bbb7f31e901f37e4597b030388f685d64481cfb)
Looking at the commit history, it seems multiple topics are mixed together. Could you please rebase the branch and separate out only the necessary commits?
--
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(echarts): improve dash patterns for time-shifted series [superset]
Posted by "justinpark (via GitHub)" <gi...@apache.org>.
justinpark commented on PR #38680:
URL: https://github.com/apache/superset/pull/38680#issuecomment-4130875642
@Mayankaggarwal8055 Your suggested changes included [code unrelated](https://github.com/apache/superset/pull/38680/changes#diff-88cfb8074eec39fa78997341a017c9b8251c54d19a2ab8e188b9e8bcfad7e00bR672-R687) to changing the line style, so I created a separate [PR](https://github.com/apache/superset/pull/38866) for it. Additionally, since it was difficult to distinguish differences in the tooltip using only line types, I modified the symbol markers to display differently, making it easier to identify the differences between each line value. Furthermore, this change also fixes a bug where the modification persisted even when the timeShift option was turned off.
--
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(echarts): improve dash patterns for time-shifted series [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38680:
URL: https://github.com/apache/superset/pull/38680#issuecomment-4097968533
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(echarts): improve dash patterns for time-shifted series [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38680:
URL: https://github.com/apache/superset/pull/38680#issuecomment-4097030941
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(echarts): improve dash patterns for time-shifted series [superset]
Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on PR #38680:
URL: https://github.com/apache/superset/pull/38680#issuecomment-4134022242
Closing due to https://github.com/apache/superset/pull/38866
--
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(echarts): improve dash patterns for time-shifted series [superset]
Posted by "hainenber (via GitHub)" <gi...@apache.org>.
hainenber commented on PR #38680:
URL: https://github.com/apache/superset/pull/38680#issuecomment-4091094064
@Mayankaggarwal8055 can you please address Copilot's comments and provide before/after screenshots?
--
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(echarts): improve dash patterns for time-shifted series [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38680:
URL: https://github.com/apache/superset/pull/38680#issuecomment-4126949364
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(echarts): improve dash patterns for time-shifted series [superset]
Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina closed pull request #38680: fix(echarts): improve dash patterns for time-shifted series
URL: https://github.com/apache/superset/pull/38680
--
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