in google-datacatalog-apache-atlas-connector/src/google/datacatalog_connectors/apache_atlas/scrape/metadata_enricher.py [0:0]
def __enrich_relationship_dict(cls, attribute_dict, entity_types_dict):
if isinstance(attribute_dict, dict):
type_name = attribute_dict.get('typeName')
guid = attribute_dict.get('guid')
data = attribute_dict.get('data')
# Verify if the attribute implements an entity type
# and if the attribute data is not fetched.
if type_name and guid and not data:
entity_type = entity_types_dict.get(type_name)
if entity_type:
relationship_entities = entity_type['entities']
if relationship_entities:
fetched_entity = relationship_entities.get(guid)
if fetched_entity:
fetched_entity_data = fetched_entity['data']
fetched_classification_names = fetched_entity.get(
'classifications')
attribute_dict['data'] = fetched_entity_data
attribute_dict[
'classifications'] =\
fetched_classification_names