From 1fa49e2b79861daa94a2bf4b57e68c5d8dca77fa Mon Sep 17 00:00:00 2001 From: Gabe Lyons Date: Thu, 21 Oct 2021 22:21:23 -0700 Subject: [PATCH] feat(ingestion): support custom properties to be ingested via business glossary yaml (#3438) --- .../examples/bootstrap_data/business_glossary.yml | 8 +++++++- .../ingestion/source/metadata/business_glossary.py | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/metadata-ingestion/examples/bootstrap_data/business_glossary.yml b/metadata-ingestion/examples/bootstrap_data/business_glossary.yml index 8e6b3cd1ee..1e59335921 100644 --- a/metadata-ingestion/examples/bootstrap_data/business_glossary.yml +++ b/metadata-ingestion/examples/bootstrap_data/business_glossary.yml @@ -10,10 +10,16 @@ nodes: terms: - name: Sensitive description: Sensitive Data + custom_properties: + is_confidential: false - name: Confidential description: Confidential Data + custom_properties: + is_confidential: true - name: HighlyConfidential - description: Highly Confidential Data + description: Highly Confidential Data + custom_properties: + is_confidential: true - name: PersonalInformation description: All terms related to personal information owners: diff --git a/metadata-ingestion/src/datahub/ingestion/source/metadata/business_glossary.py b/metadata-ingestion/src/datahub/ingestion/source/metadata/business_glossary.py index 503a7edf29..3382fbafa9 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/metadata/business_glossary.py +++ b/metadata-ingestion/src/datahub/ingestion/source/metadata/business_glossary.py @@ -1,6 +1,6 @@ import logging from dataclasses import dataclass, field -from typing import Any, Iterable, List, Optional, Union +from typing import Any, Dict, Iterable, List, Optional, Union from pydantic import validator @@ -34,6 +34,7 @@ class GlossaryTermConfig(ConfigModel): owners: Optional[Owners] inherits: Optional[List[str]] contains: Optional[List[str]] + custom_properties: Optional[Dict[str, str]] class GlossaryNodeConfig(ConfigModel): @@ -209,6 +210,7 @@ def get_mces_from_term( else defaults.source, sourceUrl=glossaryTerm.source_url if glossaryTerm.source_url else defaults.url, parentNode=parentNode, + customProperties=glossaryTerm.custom_properties, ) aspects.append(term_info)