@@ -134,24 +134,27 @@ def yield_tag(self, _: str) -> Iterable[OMetaTagAndCategory]:
134134 :param _:
135135 :return:
136136 """
137- taxonomies = PolicyTagManagerClient ().list_taxonomies (
138- parent = f"projects/{ self .project_id } /locations/{ self .service_connection .taxonomyLocation } "
139- )
140- for taxonomy in taxonomies :
141- policiy_tags = PolicyTagManagerClient ().list_policy_tags (
142- parent = taxonomy .name
137+ try :
138+ taxonomies = PolicyTagManagerClient ().list_taxonomies (
139+ parent = f"projects/{ self .project_id } /locations/{ self .service_connection .taxonomyLocation } "
143140 )
144- for tag in policiy_tags :
145- yield OMetaTagAndCategory (
146- category_name = CreateTagCategoryRequest (
147- name = self .service_connection .tagCategoryName ,
148- description = "" ,
149- categoryType = "Classification" ,
150- ),
151- category_details = CreateTagRequest (
152- name = tag .display_name , description = "Bigquery Policy Tag"
153- ),
141+ for taxonomy in taxonomies :
142+ policiy_tags = PolicyTagManagerClient ().list_policy_tags (
143+ parent = taxonomy .name
154144 )
145+ for tag in policiy_tags :
146+ yield OMetaTagAndCategory (
147+ category_name = CreateTagCategoryRequest (
148+ name = self .service_connection .tagCategoryName ,
149+ description = "" ,
150+ categoryType = "Classification" ,
151+ ),
152+ category_details = CreateTagRequest (
153+ name = tag .display_name , description = "Bigquery Policy Tag"
154+ ),
155+ )
156+ except Exception as err :
157+ logger .error (err )
155158
156159 def get_tag_labels (self , table_name : str ) -> Optional [List [TagLabel ]]:
157160 """
0 commit comments