Google Cloud Datacatalog API client library for data discovery and metadata management
—
Quality
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Management of entry overview information, contacts, and starring functionality for organizing and maintaining entry metadata beyond basic properties.
Manage high-level overview information for entries including business context and descriptive metadata.
def modify_entry_overview(
self,
request: ModifyEntryOverviewRequest = None,
*,
name: str = None,
entry_overview: EntryOverview = None,
**kwargs
) -> EntryOverview:
"""
Modify the overview information of an entry.
Args:
request: The request object
name: str - Required. Format: projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}
entry_overview: EntryOverview - Required. Updated overview information
Returns:
EntryOverview: The updated entry overview
Raises:
google.api_core.exceptions.NotFound: Entry not found
google.api_core.exceptions.InvalidArgument: Invalid overview data
"""Manage contact information for entries, including individuals and groups responsible for the data asset.
def modify_entry_contacts(
self,
request: ModifyEntryContactsRequest = None,
*,
name: str = None,
contacts: Contacts = None,
**kwargs
) -> Contacts:
"""
Modify the contacts of an entry.
Args:
request: The request object
name: str - Required. Format: projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}
contacts: Contacts - Required. Updated contact information
Returns:
Contacts: The updated contacts
Raises:
google.api_core.exceptions.NotFound: Entry not found
google.api_core.exceptions.InvalidArgument: Invalid contact data
"""Star and unstar entries to mark them as important or frequently accessed resources.
def star_entry(
self,
request: StarEntryRequest = None,
*,
name: str = None,
**kwargs
) -> StarEntryResponse:
"""
Mark an entry as starred by the current user.
Args:
request: The request object
name: str - Required. Format: projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}
Returns:
StarEntryResponse: Empty response indicating success
Raises:
google.api_core.exceptions.NotFound: Entry not found
"""
def unstar_entry(
self,
request: UnstarEntryRequest = None,
*,
name: str = None,
**kwargs
) -> UnstarEntryResponse:
"""
Remove a star from an entry.
Args:
request: The request object
name: str - Required. Format: projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}
Returns:
UnstarEntryResponse: Empty response indicating success
Raises:
google.api_core.exceptions.NotFound: Entry not found
"""Usage Example:
from google.cloud import datacatalog_v1
client = datacatalog_v1.DataCatalogClient()
entry_name = "projects/my-project/locations/us-central1/entryGroups/customer-data/entries/customer-table"
# Update entry overview
overview = datacatalog_v1.EntryOverview(
overview="This table contains customer master data including contact information, "
"preferences, and account details. Updated daily from the CRM system."
)
modify_overview_request = datacatalog_v1.ModifyEntryOverviewRequest(
name=entry_name,
entry_overview=overview
)
updated_overview = client.modify_entry_overview(request=modify_overview_request)
# Update entry contacts
contacts = datacatalog_v1.Contacts(
people=[
datacatalog_v1.Contacts.Person(
designation="Data Owner",
email="data-owner@company.com"
),
datacatalog_v1.Contacts.Person(
designation="Data Steward",
email="data-steward@company.com"
)
]
)
modify_contacts_request = datacatalog_v1.ModifyEntryContactsRequest(
name=entry_name,
contacts=contacts
)
updated_contacts = client.modify_entry_contacts(request=modify_contacts_request)
# Star the entry
star_request = datacatalog_v1.StarEntryRequest(name=entry_name)
client.star_entry(request=star_request)
print("Entry metadata updated successfully")class ModifyEntryOverviewRequest:
name: str # Required entry name
entry_overview: EntryOverview # Required updated overview
class ModifyEntryContactsRequest:
name: str # Required entry name
contacts: Contacts # Required updated contacts
class StarEntryRequest:
name: str # Required entry name
class UnstarEntryRequest:
name: str # Required entry nameclass StarEntryResponse:
"""Empty response for successful star operation."""
pass
class UnstarEntryResponse:
"""Empty response for successful unstar operation."""
passclass EntryOverview:
overview: str # Optional overview text providing business context and description
class Contacts:
people: Sequence[Person] # List of contact persons
class Person:
designation: str # Optional role designation (e.g., "Data Owner", "Data Steward")
email: str # Optional email address
class BusinessContext:
entry_overview: EntryOverview # Optional entry overview
contacts: Contacts # Optional contacts informationInstall with Tessl CLI
npx tessl i tessl/pypi-google-cloud-datacatalog