villebro commented on a change in pull request #16017:
URL: https://github.com/apache/superset/pull/16017#discussion_r680872347
##########
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:
I assume `payload` will always have the `metadata` property, as a
dashboard will not function without it. But let me change that.
I'd prefer to not change the sig of `DatasetDAO.find_by_id` to keep it
consistent with the sig of `BaseDAO.find_by_id` which is `model_id: int`:
https://github.com/apache/superset/blob/475f9cdc35aa325f98bfbd03e04c70ef3a53db28/superset/dao/base.py#L50
--
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]