fix(ingest): remove duplication of tags (#8532)

This commit is contained in:
Aseem Bansal 2023-08-01 19:31:26 +05:30 committed by GitHub
parent 0593e23558
commit 09ef6e080c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,7 +75,11 @@ class DatasetTagsTransformer(DatasetTransformer, metaclass=ABCMeta):
) -> None:
"""Check if user want to keep existing tags"""
if in_global_tags_aspect is not None and config.replace_existing is False:
out_global_tags_aspect.tags.extend(in_global_tags_aspect.tags)
tags_seen = set()
for item in in_global_tags_aspect.tags:
if item.tag not in tags_seen:
out_global_tags_aspect.tags.append(item)
tags_seen.add(item.tag)
@staticmethod
def get_result_semantics(