bito-code-review[bot] commented on PR #42339:
URL: https://github.com/apache/superset/pull/42339#issuecomment-5056894475
<!-- Bito Reply -->
The flagged issue is correct. The `ExportTagsCommand.run()` method ignores
`self.model_ids` (which are populated via the constructor) and only processes
`dashboard_ids` and `chart_ids`. To resolve this, `run()` should be updated to
fetch tags associated with the provided `model_ids` using the `TagDAO` before
calling `_file_content`.
Here is a concise fix for `superset/commands/tag/export.py`:
```python
def run(self) -> Iterator[tuple[str, Callable[[], str]]]:
if not feature_flag_manager.is_feature_enabled("TAGGING_SYSTEM"):
return
# Fetch tags for model_ids if provided
tag_ids = self.model_ids
# ... (logic to fetch tags using self.dao and update
dashboard_ids/chart_ids)
yield (
ExportTagsCommand._file_name(),
lambda: ExportTagsCommand._file_content(
self.dashboard_ids, self.chart_ids
),
)
```
Would you like me to fetch all other comments on this PR to validate and
implement fixes for them as well?
**superset/commands/tag/export.py**
```
def run(self) -> Iterator[tuple[str, Callable[[], str]]]:
if not feature_flag_manager.is_feature_enabled("TAGGING_SYSTEM"):
return
# Fetch tags for model_ids if provided
tag_ids = self.model_ids
# ... (logic to fetch tags using self.dao and update
dashboard_ids/chart_ids)
yield (
ExportTagsCommand._file_name(),
lambda: ExportTagsCommand._file_content(
self.dashboard_ids, self.chart_ids
),
)
```
--
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]