Registry / gcp / google-cloud-dataplex

google-cloud-dataplex

JSON →
library2.17.0pypypi✓ verified 52d ago

Google Cloud Dataplex is a unified data governance platform that provides an intelligent data fabric to centrally manage, monitor, and govern data across data lakes, data warehouses, and data marts. It enables consistent controls, trusted data access, and powers analytics at scale. The Python client library is currently at version 2.17.0 and is actively maintained with frequent releases.

gcpdata
pip install google-cloud-dataplex
Install & Compatibility
Where this runs
tested against v2.20.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.925 runs
installs and imports cleanly · install 0.0s · import 3.280s · 78.6MB
glibc
py 3.103.925 runs
installs and imports cleanly · install 5.7s · import 1.938s · 76MB
78MB installed
● package 78MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DataplexServiceClient
from google.cloud import dataplex_v1
The v1 suffix indicates the API version. Always import the versioned client.

This quickstart demonstrates how to instantiate the Dataplex client and list existing lakes within a specified Google Cloud project and location. Ensure your Google Cloud project ID and an appropriate location are set.

import os from google.cloud import dataplex_v1 def list_lakes(project_id: str, location: str): """Lists Dataplex lakes in a given project and location.""" try: client = dataplex_v1.DataplexServiceClient() parent = f"projects/{project_id}/locations/{location}" print(f"Listing lakes in {parent}:") # API calls often return an iterable (pager) for list methods for lake in client.list_lakes(parent=parent): print(f"- {lake.name} (State: {lake.state.name})") print("Lakes listed successfully.") except Exception as e: print(f"An error occurred: {e}") print("Ensure 'gcloud auth application-default login' has been run or GOOGLE_APPLICATION_CREDENTIALS is set.") print("Also, verify that the Dataplex API is enabled for your project and the service account has necessary permissions.") if __name__ == "__main__": PROJECT_ID = os.environ.get("GOOGLE_CLOUD_PROJECT", "your-gcp-project-id") LOCATION = "us-central1" # Or your desired region, e.g., "global" for some resources if PROJECT_ID == "your-gcp-project-id": print("Please set the 'GOOGLE_CLOUD_PROJECT' environment variable or replace 'your-gcp-project-id' with your actual GCP project ID.") else: list_lakes(PROJECT_ID, LOCATION)
Debug
Known issues
breakingSome metadata stored in Dataplex Universal Catalog changed on January 12, 2026, to align with original source systems (e.g., Vertex AI, Bigtable, Spanner). Workloads that depend on the specific structure or content of this metadata will need to be adjusted to preserve continuity.
fix
Review release notes and documentation for specific metadata changes and update your code to reflect the new structure or consistency with source systems.
affects: All versions consuming Dataplex Catalog metadata after 2026-01-12
gotchaDataplex enforces strict location constraints for resources. Zones (regional or multi-regional) and their associated assets (e.g., GCS buckets, BigQuery datasets) must strictly match the zone's location type. Attempting to add an asset that violates these constraints (e.g., a 'EU' multi-region BigQuery dataset to a 'europe-west1' regional zone) will result in asset attachment failures.
fix
Ensure that the location of your Dataplex zones and the underlying data assets (GCS buckets, BigQuery datasets) are compatible and correctly aligned according to Dataplex's strict location hierarchy rules.
affects: All versions
deprecatedDataplex Explore was deprecated on July 22, 2024. Functionality provided by Dataplex Explore is now expected to be handled by BigQuery Studio.
fix
Migrate any existing Dataplex Explore workloads or functionalities to BigQuery Studio as per the official migration instructions.
affects: All versions after 2024-07-22
gotchaWhen programmatically querying Dataplex Catalog Entries using the Python client, you might only retrieve custom Aspect *names* but not their corresponding *values* by default.
fix
To retrieve the full Aspect values, ensure you set the `view` parameter (e.g., `EntryView.FULL` or `EntryView.ALL`) when calling methods like `CatalogServiceClient.get_entry` or `CatalogServiceClient.list_entries`.
affects: All versions
gotchaRunning `google-cloud-dataplex_v1` on Python 3.9 or older versions will trigger `FutureWarning` messages because these Python versions are unsupported by the library and its core dependencies. Google will not post any further updates for these older Python versions, potentially leading to critical bug fixes or features being missed.
fix
Upgrade your Python environment to version 3.10 or higher, and then ensure `google-cloud-dataplex_v1` and its dependencies (e.g., `google-api-core`, `google-auth`) are updated to their latest compatible versions.
affects: All versions of `google-cloud-dataplex_v1` when used with Python 3.9 or older.
gotchaThe Dataplex client library requires a Google Cloud Project ID for most operations. If not explicitly provided in the client configuration, it defaults to checking the 'GOOGLE_CLOUD_PROJECT' environment variable or the project associated with the default credentials. Failure to provide a project ID will prevent successful API calls.
fix
Ensure the 'GOOGLE_CLOUD_PROJECT' environment variable is set, or provide the project ID explicitly when initializing Dataplex client objects (e.g., `client = dataplex.DataplexServiceClient(project='your-gcp-project-id')`).
affects: All versions
Errors
Common errors & fixes
Permission denied
The service account or user account performing the operation lacks the necessary IAM permissions for the requested Dataplex resource or action.
fix
Grant the appropriate IAM roles (e.g., `roles/dataplex.admin`, `roles/dataplex.viewer`, `roles/dataplex.editor`, or specific granular permissions like `dataplex.metadataFeeds.create`, `bigquery.dataOwner`) to the service account or user on the relevant Google Cloud project, lake, zone, or resource via the Google Cloud Console or `gcloud` CLI.
API not enabled or Service unavailable
The Google Cloud Dataplex API, or a related required API such as the Data Lineage API, has not been enabled in your Google Cloud project.
fix
Enable the required API(s) through the Google Cloud Console by navigating to 'APIs & Services' > 'Library', searching for the specific API (e.g., 'Dataplex API'), and clicking 'Enable'. Allow a few minutes for the API to fully activate before retrying.
Resource 'projects/<project_id>/locations/<location>/lakes/<lake_name>' has nested resources. If the API supports cascading delete, set 'force' to true to delete it and its nested resources.
You are attempting to delete a Dataplex lake that still contains dependent nested resources (such as zones or assets) without specifying a cascading delete operation.
fix
Either manually delete all nested resources (zones, assets) within the lake before attempting to delete the lake, or, if using the Python client library, set the `force=True` parameter in the `DeleteLakeRequest` to perform a cascading deletion.
google.api_core.exceptions.MethodNotImplemented: 501 Received http2 header with status: 404
This error typically indicates that the `DataplexServiceClient` is attempting to access Dataplex resources in an incorrect, unsupported, or misconfigured Google Cloud region.
fix
Ensure the `DataplexServiceClient` is initialized with the correct region where your Dataplex resources are located. You can specify the endpoint by setting `client_options={'api_endpoint': 'dataplex.<REGION>.googleapis.com'}` during client initialization. Also, verify the project ID is correct and the service account has permissions in that specific region.
Upgrade
Version history
2.20.0latest on PyPI
Audit
Dependencies

No dependency data recorded yet.

Agent activity
52 hits · last 30 days
node
4
mj12bot
4
ahrefsbot
3
bytedance
2
seranking-bot
2
Resources