{"id":7265,"library":"google-cloud-datacatalog-lineage","title":"Google Cloud Datacatalog Lineage","description":"The `google-cloud-datacatalog-lineage` client library allows Python developers to interact with the Google Cloud Datacatalog Lineage API. This API helps track the origin and transformation of data within Google Cloud, providing visibility into data pipelines. The current version is 0.6.0, and it follows Google Cloud's frequent release cadence for client libraries, often aligning with underlying API changes or bug fixes.","status":"active","version":"0.6.0","language":"en","source_language":"en","source_url":"https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-datacatalog-lineage","tags":["google-cloud","datacatalog","lineage","data-governance","etl","observability"],"install":[{"cmd":"pip install google-cloud-datacatalog-lineage","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"note":"The official client for the Datacatalog Lineage API is exposed through the versioned module `datacatalog_lineage_v1`, not the base `datacatalog_lineage` module.","wrong":"from google.cloud import datacatalog_lineage","symbol":"LineageClient","correct":"from google.cloud import datacatalog_lineage_v1"}],"quickstart":{"code":"import os\nfrom google.cloud import datacatalog_lineage_v1\n\n# Ensure GOOGLE_APPLICATION_CREDENTIALS is set, or running in a GCP environment.\n# For local development, set GOOGLE_APPLICATION_CREDENTIALS environment variable:\n# export GOOGLE_APPLICATION_CREDENTIALS=\"/path/to/your/keyfile.json\"\n\n# Replace with your actual GCP project ID and desired location\nproject_id = os.environ.get(\"GCP_PROJECT_ID\", \"your-gcp-project-id\")\nlocation = \"us-central1\" # e.g., \"us-central1\", \"europe-west1\"\n\ntry:\n    client = datacatalog_lineage_v1.LineageClient()\n    parent = f\"projects/{project_id}/locations/{location}\"\n\n    print(f\"Listing processes in {parent}...\")\n    # The list_processes method returns an iterable\n    for process in client.list_processes(parent=parent):\n        print(f\"Found Process: {process.name}\")\n\n    print(\"Successfully listed processes (or completed iteration if none found).\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Ensure 'GCP_PROJECT_ID' environment variable is set or replace placeholder.\")\n    print(\"Ensure `google-cloud-datacatalog-lineage` is installed and authenticated.\")\n","lang":"python","description":"This quickstart demonstrates how to initialize the `LineageClient` and list data lineage processes within a specified Google Cloud project and location. It includes basic error handling and emphasizes proper project ID and authentication setup."},"warnings":[{"fix":"Always pin to a specific minor version (e.g., `google-cloud-datacatalog-lineage==0.6.*`) and test thoroughly before deploying new versions to production. Consult release notes for any breaking changes.","message":"The library is currently in version 0.x.x, indicating that the API surface may not be fully stable and could introduce breaking changes in minor versions without a major version bump. Always review release notes when upgrading.","severity":"breaking","affected_versions":"0.x.x (all versions before 1.0.0)"},{"fix":"Ensure `GOOGLE_APPLICATION_CREDENTIALS` environment variable points to a valid service account key file, or run your application in a Google Cloud environment (e.g., GCE, Cloud Run, GKE) with appropriate permissions configured for the default service account.","message":"Incorrect or missing Google Cloud authentication credentials will lead to `DefaultCredentialsError` or `PermissionDenied` errors when making API calls.","severity":"gotcha","affected_versions":"All versions"},{"fix":"To get all items at once, use `list(client.list_processes(...))` or iterate directly: `for item in client.list_processes(...): ...`.","message":"List operations (e.g., `list_processes`, `list_runs`) return iterators. If you need all results in a single list, you must explicitly convert the iterator to a list or iterate through it.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your environment uses Python 3.9 or a newer supported version. Upgrade Python if necessary.","message":"The library requires Python 3.9 or newer. Running with older Python versions will result in installation failures or runtime errors.","severity":"gotcha","affected_versions":"<=0.6.0 (and likely future versions)"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Change your import statement to `from google.cloud import datacatalog_lineage_v1`.","cause":"Attempting to import the client from an unversioned or incorrect module path.","error":"ModuleNotFoundError: No module named 'google.cloud.datacatalog_lineage'"},{"fix":"Set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to the path of your service account key file, or ensure your application is running in a Google Cloud environment with default credentials configured.","cause":"The application could not find valid Google Cloud credentials in the environment.","error":"google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials."},{"fix":"Double-check the `project_id`, `location`, and any resource names. Verify that the service account or user has the necessary Data Catalog Lineage Viewer/Editor roles (`roles/datacatalog.viewer`, `roles/datacatalog.editor`) for the project.","cause":"The specified project, location, or resource path (e.g., for `parent`) does not exist or is incorrect, or the authenticated principal lacks permission to access it.","error":"google.api_core.exceptions.NotFound: 404 Not Found: Requested entity was not found"}]}