Search code examples
pythongoogle-cloud-platformairflowgoogle-data-catalog

Error while creating Taxonomy in Google Data Catalog using Apache Airflow


Experts,

I'm trying to create a Taxonomy in Google Data Catalog using Apache Airflow. When I trigger the job in Airflow, it fails with below error.

Error

> google.api_core.exceptions.PermissionDenied: 403 The caller does not have permission
rpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
    status = StatusCode.PERMISSION_DENIED
    details = "The caller does not have permission"
    debug_error_string = "{"created":"@1660850910.057899765","description":"Error received from peer ipv4:173.194.216.95:443","file":"src/core/lib/surface/call.cc","file_line":1074,"grpc_message":"The caller does not have permission","grpc_status":7}"

although, it states Permission denied, I'm able to create Tagging Templates and tags using Apache Airflow operators. I'd appreciate if anyone help me figure out and fix the actual issue.

Code

def sample_create_taxonomy():
    client = datacatalog_v1.PolicyTagManagerClient()
    request = datacatalog_v1.CreateTaxonomyRequest
    (
    parent='projects/sample-project-name/locations/us-central1',
    )
    response = client.create_taxonomy(request=request)
    print(response)

Solution

  • According to the Data Catalog documentation you need to have datacatalog.taxonomies.create IAM permission on projects/sample-project-name/locations/us-central1.