in google-datacatalog-apache-atlas-connector/src/google/datacatalog_connectors/apache_atlas/prepare/datacatalog_tag_template_factory.py [0:0]
def __create_classification_tag_template(self, classification_dict,
classifications_dict,
enum_types_dict):
tag_template = datacatalog.TagTemplate()
classification_data = classification_dict['data']
name = classification_data['name']
formatted_name = attr_normalizer.DataCatalogAttributeNormalizer.\
format_name(name)
version = classification_data.get('version')
tag_template_id = attr_normalizer.DataCatalogAttributeNormalizer.\
create_tag_template_id(formatted_name,
constant.CLASSIFICATION_PREFIX,
version)
tag_template.name = self.get_tag_template_path(tag_template_id)
tag_template.display_name = '{}'.format(name)
classification_data = classification_dict['data']
classification_super_types = classification_data.get('superTypes')
attribute_defs = classification_data['attributeDefs']
if classification_super_types:
self.__add_fields_from_super_types(tag_template,
classification_super_types,
classifications_dict,
enum_types_dict)
self.__add_fields_from_attribute_defs(tag_template, attribute_defs,
enum_types_dict)
self._add_primitive_type_field(tag_template, formatted_name,
self.__BOOL_TYPE, formatted_name)
return {tag_template_id: tag_template}