def __enrich_relationship_dict()

in google-datacatalog-apache-atlas-connector/src/google/datacatalog_connectors/apache_atlas/scrape/metadata_event_enricher.py [0:0]


    def __enrich_relationship_dict(self, 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']
                    fetched_entity = relationship_entities.get(guid)
                    if not fetched_entity:
                        entities_dict = \
                            self.\
                            enrich_entities_attributes_and_classifications(
                                [guid])
                        if entities_dict:
                            fetched_entity_dict = entities_dict.get(guid)
                            if fetched_entity_dict:
                                relationship_entities[
                                    guid] = fetched_entity_dict