I'm getting an error trying of use the code of this link: Data Catalog Example. At the step 4, just copy pasting all the code provided, authenticating into my GCP Project and testing it.
Everything is ok until it start creating tag template fields...
tag_template = datacatalog_v1.types.TagTemplate()
tag_template.display_name = 'On-premises Tag Template'
tag_template.fields['source'].display_name = 'Source of the data asset'
tag_template.fields['source'].type.primitive_type = \
datacatalog_v1.FieldType.PrimitiveType.STRING.value
it always crash with the same error.
tag_template <proto.marshal.collections.maps.MapComposite object at 0x10fe23310>
Traceback (most recent call last):
File "/Users/ac/Documents/DataCatalog/python_datacatalog/application/sample.py", line 149, in <module>
tag_template.fields['source'].display_name = 'Source of the data asset'
File "/Users/ac/Documents/DataCatalog/python_datacatalog/venv/lib/python3.8/site-packages/proto/marshal/collections/maps.py", line 56, in __getitem__
raise KeyError(key)
KeyError: 'source'
Someone can help me sharing alternatives to do this?


