You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "lilykuang (via GitHub)" <gi...@apache.org> on 2024/03/08 20:07:09 UTC
[PR] feat(time-comparison-table): show and hide time comparison columns [superset]
lilykuang opened a new pull request, #27446:
URL: https://github.com/apache/superset/pull/27446
<!---
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 -->
Add a dropdown in the top-right to select time comparison columns to display. Include '-' and '+' buttons in all columns for visibility control:
- Dropdown: Selects columns to show.
- '-' Button: Hides all time comparison columns.
- '+' Button: Shows selected columns based on the dropdown choice.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->

### 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(time-comparison-table): show and hide time comparison columns [superset]
Posted by "ajdioka (via GitHub)" <gi...@apache.org>.
ajdioka commented on PR #27446:
URL: https://github.com/apache/superset/pull/27446#issuecomment-1986820346
**[Persistent review](https://github.com/apache/superset/pull/27446#issuecomment-1986820024)** updated to latest commit https://github.com/apache/superset/commit/51758617b36b870b8f2c52f368d7ec1af8221f1f
--
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(time-comparison-table): show and hide time comparison columns [superset]
Posted by "yousoph (via GitHub)" <gi...@apache.org>.
yousoph commented on PR #27446:
URL: https://github.com/apache/superset/pull/27446#issuecomment-1986486773
/testenv up FEATURE_CHART_PLUGINS_EXPERIMENTAL = True
--
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(time-comparison-table): show and hide time comparison columns [superset]
Posted by "ajdioka (via GitHub)" <gi...@apache.org>.
ajdioka commented on PR #27446:
URL: https://github.com/apache/superset/pull/27446#issuecomment-1986820024
## PR Review
<table>
<tr>
<tr><td> โฑ๏ธ <strong>Estimated effort to review [1-5]</strong></td><td>
4, due to the complexity of the feature being added, the number of files changed, and the need to understand the context of how these changes integrate with the existing codebase. The addition of a new UI component (dropdown for time comparison columns) and its interaction with the table chart component requires careful review to ensure it meets the project's standards for performance, usability, and maintainability.
</td></tr>
<tr><td> ๐งช <strong>Relevant tests</strong></td><td>
No
</td></tr>
<tr><td rowspan=2> ๐ <strong>Possible issues</strong></td>
<td>
<strong>Possible Bug:</strong> The `handleOnClick` function in `TableChart.tsx` does not handle the case where a user deselects all options except 'All'. This could lead to unexpected behavior or UI state.</td></tr>
<tr>
<td>
<strong>Performance Concern:</strong> The `filteredColumnsMeta` useMemo hook in `TableChart.tsx` could potentially cause performance issues if the `columnsMeta` array is large. The filter operation is run every time any of its dependencies change, which might be more frequent than necessary.</td></tr>
<tr><td> ๐ <strong>Security concerns</strong></td><td>
No
</td></tr>
</table>
<details><summary> <strong>Code feedback:</strong></summary>
<hr><table><tr><td>relevant file</td><td>superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
</td></tr><tr><td>suggestion </td><td>
<strong>
Consider adding a condition to reset the `selectedComparisonColumns` to include only the 'All' key if all other keys are deselected. This ensures that there is always at least one column selected, preventing a scenario where no columns are displayed. [important]
</strong>
</td></tr><tr><td>relevant line</td><td><a href='https://github.com/apache/superset/pull/27446/files#diff-d987d4addee4ccb4cccae5bb4376bdf7915776d6e8631f9a777abfa98c08c9a0R510'>selectedComparisonColumns.includes(key)</a></td></tr></table><hr>
<table><tr><td>relevant file</td><td>superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
</td></tr><tr><td>suggestion </td><td>
<strong>
To improve performance, consider memoizing the filter operation in `filteredColumnsMeta` or reducing the frequency of its execution. This could be achieved by debouncing the state updates that trigger the re-calculation or by using a more efficient data structure for `columnsMeta`. [medium]
</strong>
</td></tr><tr><td>relevant line</td><td><a href='https://github.com/apache/superset/pull/27446/files#diff-d987d4addee4ccb4cccae5bb4376bdf7915776d6e8631f9a777abfa98c08c9a0R401'>return columnsMeta.filter(({ label, key }) => {</a></td></tr></table><hr>
<table><tr><td>relevant file</td><td>superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
</td></tr><tr><td>suggestion </td><td>
<strong>
Implement error handling for the dropdown component interactions. For instance, when the dropdown fails to render or an action within it fails (e.g., due to a state update issue), there should be a fallback UI or a user-friendly error message. [medium]
</strong>
</td></tr><tr><td>relevant line</td><td><a href='https://github.com/apache/superset/pull/27446/files#diff-d987d4addee4ccb4cccae5bb4376bdf7915776d6e8631f9a777abfa98c08c9a0R524'><Dropdown</a></td></tr></table><hr>
<table><tr><td>relevant file</td><td>superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
</td></tr><tr><td>suggestion </td><td>
<strong>
Consider abstracting the dropdown and its logic into a separate component. This would improve the modularity and readability of `TableChart.tsx`. The new component could accept props for handling selection changes, which would simplify the logic within `TableChart.tsx`. [medium]
</strong>
</td></tr><tr><td>relevant line</td><td><a href='https://github.com/apache/superset/pull/27446/files#diff-d987d4addee4ccb4cccae5bb4376bdf7915776d6e8631f9a777abfa98c08c9a0R498'>const renderTimeComparisonDropdown = (): JSX.Element => {</a></td></tr></table><hr>
</details><hr>
<details> <summary><strong>โจ Review tool usage guide:</strong></summary><hr>
**Overview:**
The `review` tool scans the PR code changes, and generates a PR review. The tool can be triggered [automatically](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#github-app-automatic-tools) every time a new PR is opened, or can be invoked manually by commenting on any PR.
When commenting, to edit [configurations](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L19) related to the review tool (`pr_reviewer` section), use the following template:
```
/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...
```
With a [configuration file](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#working-with-github-app), use the following template:
```
[pr_reviewer]
some_config1=...
some_config2=...
```
<table><tr><td><details> <summary><strong> Utilizing extra instructions</strong></summary><hr>
The `review` tool can be configured with extra instructions, which can be used to guide the model to a feedback tailored to the needs of your project.
Be specific, clear, and concise in the instructions. With extra instructions, you are the prompter. Specify the relevant sub-tool, and the relevant aspects of the PR that you want to emphasize.
Examples for extra instructions:
```
[pr_reviewer] # /review #
extra_instructions="""
In the 'possible issues' section, emphasize the following:
- Does the code logic cover relevant edge cases?
- Is the code logic clear and easy to understand?
- Is the code logic efficient?
...
"""
```
Use triple quotes to write multi-line instructions. Use bullet points to make the instructions more readable.
</details></td></tr>
<tr><td><details> <summary><strong> How to enable\disable automation</strong></summary><hr>
- When you first install PR-Agent app, the [default mode](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#github-app-automatic-tools) for the `review` tool is:
```
pr_commands = ["/review", ...]
```
meaning the `review` tool will run automatically on every PR, with the default configuration.
Edit this field to enable/disable the tool, or to change the used configurations
</details></td></tr>
<tr><td><details> <summary><strong> Auto-labels</strong></summary><hr>
The `review` tool can auto-generate two specific types of labels for a PR:
- a `possible security issue` label, that detects possible [security issues](https://github.com/Codium-ai/pr-agent/blob/tr/user_description/pr_agent/settings/pr_reviewer_prompts.toml#L136) (`enable_review_labels_security` flag)
- a `Review effort [1-5]: x` label, where x is the estimated effort to review the PR (`enable_review_labels_effort` flag)
</details></td></tr>
<tr><td><details> <summary><strong> Extra sub-tools</strong></summary><hr>
The `review` tool provides a collection of possible feedbacks about a PR.
It is recommended to review the [possible options](https://github.com/Codium-ai/pr-agent/blob/main/docs/REVIEW.md#enabledisable-features), and choose the ones relevant for your use case.
Some of the feature that are disabled by default are quite useful, and should be considered for enabling. For example:
`require_score_review`, `require_soc2_ticket`, and more.
</details></td></tr>
<tr><td><details> <summary><strong> Auto-approve PRs</strong></summary><hr>
By invoking:
```
/review auto_approve
```
The tool will automatically approve the PR, and add a comment with the approval.
To ensure safety, the auto-approval feature is disabled by default. To enable auto-approval, you need to actively set in a pre-defined configuration file the following:
```
[pr_reviewer]
enable_auto_approval = true
```
(this specific flag cannot be set with a command line argument, only in the configuration file, committed to the repository)
You can also enable auto-approval only if the PR meets certain requirements, such as that the `estimated_review_effort` is equal or below a certain threshold, by adjusting the flag:
```
[pr_reviewer]
maximal_review_effort = 5
```
</details></td></tr>
<tr><td><details> <summary><strong> More PR-Agent commands</strong></summary><hr>
> To invoke the PR-Agent, add a comment using one of the following commands:
> - **/review**: Request a review of your Pull Request.
> - **/describe**: Update the PR title and description based on the contents of the PR.
> - **/improve [--extended]**: Suggest code improvements. Extended mode provides a higher quality feedback.
> - **/ask \<QUESTION\>**: Ask a question about the PR.
> - **/update_changelog**: Update the changelog based on the PR's contents.
> - **/add_docs** ๐: Generate docstring for new components introduced in the PR.
> - **/generate_labels** ๐: Generate labels for the PR based on the PR's contents.
> - **/analyze** ๐: Automatically analyzes the PR, and presents changes walkthrough for each component.
>See the [tools guide](https://github.com/Codium-ai/pr-agent/blob/main/docs/TOOLS_GUIDE.md) for more details.
>To list the possible configuration parameters, add a **/config** comment.
</details></td></tr>
</table>
See the [review usage](https://github.com/Codium-ai/pr-agent/blob/main/docs/REVIEW.md) page for a comprehensive guide on using this tool.
</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(time-comparison-table): show and hide time comparison columns [superset]
Posted by "ajdioka (via GitHub)" <gi...@apache.org>.
ajdioka commented on PR #27446:
URL: https://github.com/apache/superset/pull/27446#issuecomment-1986820246
Preparing review...
--
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(time-comparison-table): show and hide time comparison columns [superset]
Posted by "eschutho (via GitHub)" <gi...@apache.org>.
eschutho commented on PR #27446:
URL: https://github.com/apache/superset/pull/27446#issuecomment-2021069605
I'm going to remove the hold label because this PR is being merged into a feature branch, and will put another hold label on the feature branch PR when ready if the SIP hasn't been voted on by then. We just want to keep iterating on some ideas 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] feat(time-comparison-table): show and hide time comparison columns [superset]
Posted by "eschutho (via GitHub)" <gi...@apache.org>.
eschutho commented on PR #27446:
URL: https://github.com/apache/superset/pull/27446#issuecomment-1989636790
Hi @john-bodley, yeah it's dependent on the SIP. Thanks for the callout.
--
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(time-comparison-table): show and hide time comparison columns [superset]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27446:
URL: https://github.com/apache/superset/pull/27446#issuecomment-2021209855
Ephemeral environment shutdown and build artifacts deleted.
--
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(time-comparison-table): show and hide time comparison columns [superset]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27446:
URL: https://github.com/apache/superset/pull/27446#issuecomment-1986495693
@yousoph Ephemeral environment spinning up at http://34.213.222.222: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] feat(time-comparison-table): show and hide time comparison columns [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #27446:
URL: https://github.com/apache/superset/pull/27446#issuecomment-1986375092
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/27446?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
Attention: Patch coverage is `23.40426%` with `36 lines` in your changes are missing coverage. Please review.
> :exclamation: No coverage uploaded for pull request base (`table-time-comparison@6c11355`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#section-missing-base-commit).
| [Files](https://app.codecov.io/gh/apache/superset/pull/27446?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...tend/plugins/plugin-chart-table/src/TableChart.tsx](https://app.codecov.io/gh/apache/superset/pull/27446?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtdGFibGUvc3JjL1RhYmxlQ2hhcnQudHN4) | 23.25% | [31 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/superset/pull/27446?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...ins/plugin-chart-table/src/DataTable/DataTable.tsx](https://app.codecov.io/gh/apache/superset/pull/27446?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtdGFibGUvc3JjL0RhdGFUYWJsZS9EYXRhVGFibGUudHN4) | 25.00% | [1 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/superset/pull/27446?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## table-time-comparison #27446 +/- ##
========================================================
Coverage ? 69.61%
========================================================
Files ? 1907
Lines ? 74638
Branches ? 8372
========================================================
Hits ? 51959
Misses ? 20605
Partials ? 2074
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/27446/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage ฮ | |
|---|---|---|
| [javascript](https://app.codecov.io/gh/apache/superset/pull/27446/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `57.13% <23.40%> (?)` | |
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/27446?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).
--
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(time-comparison-table): show and hide time comparison columns [superset]
Posted by "ajdioka (via GitHub)" <gi...@apache.org>.
ajdioka commented on PR #27446:
URL: https://github.com/apache/superset/pull/27446#issuecomment-1986819898
Preparing review...
--
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(time-comparison-table): show and hide time comparison columns [superset]
Posted by "john-bodley (via GitHub)" <gi...@apache.org>.
john-bodley commented on PR #27446:
URL: https://github.com/apache/superset/pull/27446#issuecomment-1989228739
@eschutho is this dependent on https://github.com/apache/superset/issues/27432? If so @lilykuang it might be worth referencing said SIP in the PR description.
--
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(time-comparison-table): show and hide time comparison columns [superset]
Posted by "lilykuang (via GitHub)" <gi...@apache.org>.
lilykuang merged PR #27446:
URL: https://github.com/apache/superset/pull/27446
--
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