in common/data_mesh/src/data_mesh_client.py [0:0]
def __init__(self,
location: str,
overwrite: bool = False,
bq_client=cortex_bq_client.CortexBQClient(),
bq_datapolicy_client=(
bigquery_datapolicies_v1.DataPolicyServiceClient()),
catalog_client=datacatalog_v1.DataCatalogClient(),
policy_tag_client=datacatalog_v1.PolicyTagManagerClient(),
dataplex_client=dataplex_v1.DataplexServiceClient(),
retry_timeout: float = _RETRY_TIMEOUT_SEC):
"""Initializes a client for the given project & location.
Args:
project: String representing the GCP project id.
location: String representing the location where the data in the
mesh is stored. This value should match the location field in
Cortex config.json.
overwrite: Boolean indicating whether existing resources and
annotations should be overwritten.
bq_datapolicy_client: BigQuery data policy client.
catalog_client: Data Catalog client.
policy_tag_client: Data Catalog policy tag client.
dataplex_client: Dataplex client, which still behaves asynchronously
for some long running requests which return ops.
retry_timeout: Float specifying the timeout duration in seconds for
API request retries. Sets google.api_core.retry.Retry.timeout on
requests that create operations, and also sets the timeout and
retry for polling the operation results.
"""
self._location = location
self.overwrite = overwrite
self._bq_client = bq_client
self._bq_datapolicy_client = bq_datapolicy_client
self._catalog_client = catalog_client
self._policy_tag_client = policy_tag_client
self._dataplex_client = dataplex_client
self._retry_timeout = retry_timeout
self._retry_options = retry.Retry(timeout=retry_timeout)
# Dictionary of {display_name: unique_name} containing existing tag
# templates, which is populated before annotating BQ assets.
self._existing_tag_templates: Optional[Dict[str, str]] = None