bito-code-review[bot] commented on code in PR #40007:
URL: https://github.com/apache/superset/pull/40007#discussion_r3216316098
##########
superset/commands/dashboard/export.py:
##########
@@ -146,6 +146,17 @@ def _file_content(model: Dashboard) -> str:
if dataset:
target["datasetUuid"] = str(dataset.uuid)
+ # Replace display control dataset references with uuid
+ for customization in payload.get("metadata", {}).get(
+ "chart_customization_config", []
+ ):
+ for target in customization.get("targets", []):
+ dataset_id = target.pop("datasetId", None)
+ if dataset_id is not None:
+ dataset = DatasetDAO.find_by_id(dataset_id)
+ if dataset:
+ target["datasetUuid"] = str(dataset.uuid)
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Semantic duplication risk</b></div>
<div id="fix">
The added code for handling chart_customization_config duplicates the
traversal and dataset lookup logic already present in the _export method (lines
245-254). This introduces maintenance risk as changes to one section may not be
reflected in the other. Consider refactoring into a shared helper function.
</div>
</div>
<small><i>Code Review Run #d03052</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: [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]