in src/package/dataplexutils/metadata/wizard.py [0:0]
def _get_table_scan_reference(self, table_fqn):
"""Add stringdocs
Args:
Add stringdocs
Raises:
Add stringdocs
"""
try:
scan_references = None
scan_client = self._cloud_clients[
constants["CLIENTS"]["DATAPLEX_DATA_SCAN"]
]
logger.info(f"Getting table scan reference for table:{table_fqn}.")
data_scans = scan_client.list_data_scans(
parent=f"projects/{self._project_id}/locations/{self._dataplex_location}"
)
bq_resource_string = self._construct_bq_resource_string(table_fqn)
scan_references = []
for scan in data_scans:
if scan.data.resource == bq_resource_string:
scan_references.append(scan.name)
return scan_references
except Exception as e:
logger.error(f"Exception: {e}.")
raise e