You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "michael-s-molina (via GitHub)" <gi...@apache.org> on 2025/07/25 13:58:59 UTC
[PR] fix: Charts list is displaying empty dataset names when there's no schema [superset]
michael-s-molina opened a new pull request, #34315:
URL: https://github.com/apache/superset/pull/34315
### SUMMARY
https://github.com/apache/superset/pull/29944 changed the logic to display only the dataset name in the charts list but didn't account for the fact that datasets can have no schemas as defined in [slice.py#L188](https://github.com/apache/superset/blob/9c771fb2baf78488f85dd3acad5af3538fb46077/superset/models/slice.py#L188). This PR fixes the issue where the names of the datasets where empty for datasets with no schemas.
### TESTING INSTRUCTIONS
Check that dataset names are displayed for datasets with or without schemas.
### ADDITIONAL INFORMATION
- [ ] 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: Charts list is displaying empty dataset names when there's no schema [superset]
Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina merged PR #34315:
URL: https://github.com/apache/superset/pull/34315
--
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: Charts list is displaying empty dataset names when there's no schema [superset]
Posted by "korbit-ai[bot] (via GitHub)" <gi...@apache.org>.
korbit-ai[bot] commented on code in PR #34315:
URL: https://github.com/apache/superset/pull/34315#discussion_r2231167035
##########
superset-frontend/src/pages/ChartList/index.tsx:
##########
@@ -387,7 +387,10 @@ function ChartList(props: ChartListProps) {
},
}: any) => (
<Tooltip title={dsNameTxt} placement="top">
- <GenericLink to={dsUrl}>{dsNameTxt?.split('.')[1]}</GenericLink>
+ {/* dsNameTxt can be undefined, schema.name or just name */}
+ <GenericLink to={dsUrl}>
+ {dsNameTxt ? dsNameTxt.split('.')[1] || dsNameTxt : ''}
Review Comment:
### Unsafe Array Access After Split <sub></sub>
<details>
<summary>Tell me more</summary>
###### What is the issue?
The code attempts to split and access index 1 of the split array without first checking if the split operation returns an array with at least 2 elements.
###### Why this matters
If dsNameTxt contains no dots, split('.') will return an array with only one element, making index 1 undefined. The current code will then fall back to dsNameTxt, which is not the intended behavior as per the developer's intent to show the name part after the dot.
###### Suggested change ∙ *Feature Preview*
Add a check for the split array length to ensure proper fallback behavior:
```typescript
{
const parts = dsNameTxt?.split('.');
parts?.length > 1 ? parts[1] : dsNameTxt || ''
}
```
###### Provide feedback to improve future suggestions
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/4ff6f664-1f28-45d5-bd73-1ace21709cec/upvote) [](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/4ff6f664-1f28-45d5-bd73-1ace21709cec?what_not_true=true) [](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/4ff6f664-1f28-45d5-bd73-1ace21709cec?what_out_of_scope=true) [](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/4ff6f664-1f28-45d5-bd73-1ace21709cec?what_not_in_standard=true) [](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/4ff6f664-1f28-45d5-bd73-1ace21709cec)
</details>
<sub>
💬 Looking for more details? Reply to this comment to chat with Korbit.
</sub>
<!--- korbi internal id:c8c2d3e0-6e8a-466f-917a-ff6f3859accc -->
[](c8c2d3e0-6e8a-466f-917a-ff6f3859accc)
--
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