zhaoyongjie commented on a change in pull request #16017:
URL: https://github.com/apache/superset/pull/16017#discussion_r680826409
##########
File path: superset/dashboards/commands/export.py
##########
@@ -126,6 +128,16 @@ def _export(model: Dashboard) -> Iterator[Tuple[str, str]]:
logger.info("Unable to decode `%s` field: %s", key, value)
payload[new_name] = {}
+ # Extract all native filter datasets and replace native
+ # filter dataset references with uuid
+ for native_filter in
payload["metadata"].get("native_filter_configuration", []):
+ for target in native_filter.get("targets", []):
+ dataset_id = target.pop("datasetId", None)
+ if dataset_id is not None:
+ dataset = DatasetDAO.find_by_id(dataset_id)
Review comment:
also need to change DatasetDAO.find_by_id argument type hint.
```suggestion
for native_filter in payload.get("metadata",
{}).get("native_filter_configuration", []):
for target in native_filter.get("targets", []):
dataset_id = target.pop("datasetId", None)
dataset = DatasetDAO.find_by_id(dataset_id)
if dataset:
```
--
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]