in google-datacatalog-apache-atlas-connector/src/google/datacatalog_connectors/apache_atlas/prepare/datacatalog_tag_factory.py [0:0]
def make_tag_for_classification(self,
entity_classification,
classifications,
enum_types_dict,
column_name=None):
tag = datacatalog.Tag()
classification_name = entity_classification['typeName']
classification = classifications[classification_name]
classification_data = classification['data']
formatted_name = attr_normalizer.DataCatalogAttributeNormalizer.\
format_name(classification_name)
version = classification_data.get('version')
tag_template_id = attr_normalizer.DataCatalogAttributeNormalizer.\
create_tag_template_id(formatted_name,
constant.CLASSIFICATION_PREFIX,
version)
tag.template = datacatalog.DataCatalogClient.tag_template_path(
project=self.__project_id,
location=self.__location_id,
tag_template=tag_template_id)
super()._set_bool_field(tag, formatted_name, True)
attributes = entity_classification.get('attributes')
attribute_defs = classification_data['attributeDefs']
if attributes:
self.__add_fields_from_attributes(tag, attributes, attribute_defs,
enum_types_dict)
if column_name:
tag.column = attr_normalizer.DataCatalogAttributeNormalizer.\
format_name(column_name)
return tag