{"record":{"id":"635908d9f5231f0d","repo":"apache/superset","slug":"dataset-config-table-name-r-uuid-config-uu","errorCode":null,"errorMessage":"Dataset {config['table_name']!r} (uuid {config['uuid']}) could not be imported because one of its metrics or columns matches two different existing ones — one by name and another by UUID. The import was aborted so it is not applied partially. Rename or delete the conflicting metric/column in the target instance, or remove the UUID from the uploaded file, and retry.","messagePattern":"Dataset (.+?) \\(uuid (.+?)\\) could not be imported because one of its metrics or columns matches two different existing ones — one by name and another by UUID\\. The import was aborted so it is not applied partially\\. Rename or delete the conflicting metric/column in the target instance, or remove the UUID from the uploaded file, and retry\\.","errorType":"exception","errorClass":"ImportFailedError","httpStatus":500,"severity":"error","filePath":"superset/commands/dataset/importers/v1/utils.py","lineNumber":454,"sourceCode":"    # from the upload should be removed, not silently merged. This matches\n    # what an explicit overwrite would do.\n    sync = [\"columns\", \"metrics\"] if (overwrite or is_soft_deleted_match) else []\n\n    # should we also load data into the dataset?\n    data_uri = config.get(\"data\")\n\n    # import recursively to include columns and metrics\n    try:\n        dataset = SqlaTable.import_from_dict(config, recursive=True, sync=sync)\n    except ChildMultipleResultsFound as ex:\n        # An ambiguous *child* (metric/column) lookup. Unlike the dataset-level\n        # case handled below, this is raised after the dataset's own fields were\n        # updated and after earlier siblings were already imported, so there is\n        # no unmodified row to fall back to — silently returning one would\n        # report success over a half-applied import (parent scalars written,\n        # children not synced, the ``sync`` deletion never run). Raise instead\n        # so the command's transaction wrapper rolls the whole thing back.\n        raise ImportFailedError(\n            f\"Dataset {config['table_name']!r} (uuid {config['uuid']}) \"\n            \"could not be imported because one of its metrics or columns \"\n            \"matches two different existing ones — one by name and another by \"\n            \"UUID. The import was aborted so it is not applied partially. \"\n            \"Rename or delete the conflicting metric/column in the target \"\n            \"instance, or remove the UUID from the uploaded file, and retry.\"\n        ) from ex\n    except MultipleResultsFound as ex:\n        # Finding multiple results when importing a dataset only happens because initially  # noqa: E501\n        # datasets were imported without schemas (eg, `examples.NULL.users`), and later\n        # they were fixed to have the default schema (eg, `examples.public.users`). If a\n        # user created `examples.public.users` during that time the second import will\n        # fail because the UUID match will try to update `examples.NULL.users` to\n        # `examples.public.users`, resulting in a conflict.\n        #\n        # In the soft-deleted-restore case we cannot silently return\n        # the unmodified row: ``existing.deleted_at`` was already\n        # cleared above and the operator expects a restore-with-update.","sourceCodeStart":436,"sourceCodeEnd":472,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/dataset/importers/v1/utils.py#L436-L472","documentation":"SqlaTable.import_from_dict(recursive=True) raises ChildMultipleResultsFound when a child metric or column in the upload matches two different existing children — one by name and another by UUID — so the child lookup is ambiguous. Because this happens after parent fields are written and earlier siblings imported, the error is raised (not swallowed) so the command's transaction wrapper rolls back the entire import, avoiding a half-applied state.","triggerScenarios":"Importing a bundle where, say, a metric's UUID matches metric A on the target dataset while its name matches metric B: the recursive child import cannot decide which row to update.","commonSituations":"Long-lived datasets where a metric was renamed on one side and duplicated on the other; bundles hand-merged from two environments so children carry mixed name/UUID provenance.","solutions":["On the target dataset, rename or delete the child (metric/column) that clashes by name or by UUID so the upload matches exactly one row, then retry","Edit the uploaded YAML: remove the UUID from the conflicting child (or make its name/UUID pair consistent with one target row)","As a last resort, delete and re-create the target dataset so children resolve unambiguously"],"exampleFix":"# before (YAML metric)\n- metric_name: revenue\n  uuid: <matches metric A, name matches metric B>\n# after — drop the uuid so it matches by name only\n- metric_name: revenue","handlingStrategy":"validation","validationCode":"def find_ambiguous_children(config, existing_dataset):\n    by_uuid = {c.uuid: c for c in existing_dataset.columns + existing_dataset.metrics if c.uuid}\n    by_name = {c.column_name_or_metric_name: c for c in existing_dataset.columns + existing_dataset.metrics}\n    ambiguous = []\n    for child in config.get('columns', []) + config.get('metrics', []):\n        a, b = by_uuid.get(child.get('uuid')), by_name.get(child.get('column_name') or child.get('metric_name'))\n        if a is not None and b is not None and a.id != b.id:\n            ambiguous.append(child)\n    return ambiguous","typeGuard":null,"tryCatchPattern":"from superset.commands.exceptions import ImportFailedError\ntry:\n    import_dataset(config, overwrite=True)\nexcept ImportFailedError as ex:\n    if 'matches two different existing ones' in str(ex):\n        # rename/delete the clashing child on the target, or strip its uuid from the YAML; retry once\n        ...","preventionTips":["Keep metric/column names and UUIDs in sync across environments","After renaming a child on either side, re-export the bundle before importing","Treat this error as a data-integrity signal, never ignore it — the import rolled back"],"tags":["dataset-import","children","ambiguity","transaction","superset"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}