mirror of
				https://github.com/open-metadata/OpenMetadata.git
				synced 2025-10-31 02:29:03 +00:00 
			
		
		
		
	Fixes: GetTags-403 Permission denied on resource project None. (#14521)
				
					
				
			* Fix "GetTags-403 Permission denied on resource project None." Signed-off-by: Takahiro Nakayama <civitaspo@gmail.com>
This commit is contained in:
		
							parent
							
								
									e4ea06834f
								
							
						
					
					
						commit
						7d05d9f50a
					
				| @ -44,6 +44,9 @@ from metadata.ingestion.connections.test_connections import ( | |||||||
| from metadata.ingestion.ometa.ometa_api import OpenMetadata | from metadata.ingestion.ometa.ometa_api import OpenMetadata | ||||||
| from metadata.ingestion.source.database.bigquery.queries import BIGQUERY_TEST_STATEMENT | from metadata.ingestion.source.database.bigquery.queries import BIGQUERY_TEST_STATEMENT | ||||||
| from metadata.utils.credentials import set_google_credentials | from metadata.utils.credentials import set_google_credentials | ||||||
|  | from metadata.utils.logger import ingestion_logger | ||||||
|  | 
 | ||||||
|  | logger = ingestion_logger() | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def get_connection_url(connection: BigQueryConnection) -> str: | def get_connection_url(connection: BigQueryConnection) -> str: | ||||||
| @ -107,9 +110,27 @@ def test_connection( | |||||||
|             return policy_tags |             return policy_tags | ||||||
| 
 | 
 | ||||||
|     def test_tags(): |     def test_tags(): | ||||||
|         taxonomies = PolicyTagManagerClient().list_taxonomies( |         taxonomy_project_ids = [] | ||||||
|             parent=f"projects/{engine.url.host}/locations/{service_connection.taxonomyLocation}" |         if engine.url.host: | ||||||
|         ) |             taxonomy_project_ids.append(engine.url.host) | ||||||
|  |         if service_connection.taxonomyProjectId: | ||||||
|  |             taxonomy_project_ids.extend(service_connection.taxonomyProjectId) | ||||||
|  |         if not taxonomy_project_ids: | ||||||
|  |             logger.info("'taxonomyProjectID' is not set, so skipping this test.") | ||||||
|  |             return None | ||||||
|  | 
 | ||||||
|  |         taxonomy_location = service_connection.taxonomyLocation | ||||||
|  |         if not taxonomy_location: | ||||||
|  |             logger.info("'taxonomyLocation' is not set, so skipping this test.") | ||||||
|  |             return None | ||||||
|  | 
 | ||||||
|  |         taxonomies = [] | ||||||
|  |         for project_id in taxonomy_project_ids: | ||||||
|  |             taxonomies.extend( | ||||||
|  |                 PolicyTagManagerClient().list_taxonomies( | ||||||
|  |                     parent=f"projects/{project_id}/locations/{taxonomy_location}" | ||||||
|  |                 ) | ||||||
|  |             ) | ||||||
|         return get_tags(taxonomies) |         return get_tags(taxonomies) | ||||||
| 
 | 
 | ||||||
|     def test_connection_inner(engine): |     def test_connection_inner(engine): | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Takahiro Nakayama
						Takahiro Nakayama