From cf268c9cdd56c8904a917835581c6542a4cea7a0 Mon Sep 17 00:00:00 2001 From: Mayur Singal <39544459+ulixius9@users.noreply.github.com> Date: Thu, 26 May 2022 18:45:12 +0530 Subject: [PATCH] Fix #5167: Fix Tag Category Creating Issue (#5168) --- .../ingestion/source/database/bigquery.py | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/ingestion/src/metadata/ingestion/source/database/bigquery.py b/ingestion/src/metadata/ingestion/source/database/bigquery.py index 3c11944aaed..f6617d12ff9 100644 --- a/ingestion/src/metadata/ingestion/source/database/bigquery.py +++ b/ingestion/src/metadata/ingestion/source/database/bigquery.py @@ -94,20 +94,6 @@ class BigquerySource(CommonDbSourceService): ) self.temp_credentials = None - # and "policy_tags" in column and column["policy_tags"] - def prepare(self): - try: - if self.connection_config.enablePolicyTagImport: - self.metadata.create_tag_category( - CreateTagCategoryRequest( - name=self.connection_config.tagCategoryName, - description="", - categoryType="Classification", - ) - ) - except Exception as err: - logger.error(err) - @classmethod def create(cls, config_dict, metadata_config: OpenMetadataConnection): config: WorkflowSource = WorkflowSource.parse_obj(config_dict) @@ -131,6 +117,18 @@ class BigquerySource(CommonDbSourceService): def prepare(self): self.service_connection.database = self.service_connection.projectId + # and "policy_tags" in column and column["policy_tags"] + try: + if self.source_config.includeTags: + self.metadata.create_tag_category( + CreateTagCategoryRequest( + name=self.connection_config.tagCategoryName, + description="", + categoryType="Classification", + ) + ) + except Exception as err: + logger.error(err) return super().prepare() def fetch_sample_data(self, schema: str, table: str) -> Optional[TableData]: