diff --git a/metadata-ingestion/src/datahub/ingestion/graph/client.py b/metadata-ingestion/src/datahub/ingestion/graph/client.py index b2a768099c481d..d1881c75711a95 100644 --- a/metadata-ingestion/src/datahub/ingestion/graph/client.py +++ b/metadata-ingestion/src/datahub/ingestion/graph/client.py @@ -523,8 +523,8 @@ def get_aspects_for_entity( responds to these calls, and will be fixed automatically when the server-side issue is fixed. :param str entity_urn: The urn of the entity - :param List[Type[Aspect]] aspect_type_list: List of aspect type classes being requested (e.g. [datahub.metadata.schema_classes.DatasetProperties]) - :param List[str] aspects_list: List of aspect names being requested (e.g. [schemaMetadata, datasetProperties]) + :param List[str] aspects: List of aspect names being requested (e.g. [schemaMetadata, datasetProperties]) + :param List[Type[Aspect]] aspect_types: List of aspect type classes being requested (e.g. [datahub.metadata.schema_classes.DatasetProperties]) :return: Optionally, a map of aspect_name to aspect_value as a dictionary if present, aspect_value will be set to None if that aspect was not found. Returns None on HTTP status 404. :raises HttpError: if the HTTP response is not a 200 """ @@ -549,8 +549,8 @@ def get_aspects_for_entity( return result - def get_entity_semityped(self, entity_urn: str) -> AspectBag: - """Get all non-timeseries aspects for an entity (experimental). + def get_entity_semityped(self, entity_urn: str, aspects: Optional[List[str]] = None) -> AspectBag: + """Get (all) non-timeseries aspects for an entity (experimental). This method is called "semityped" because it returns aspects as a dictionary of properly typed objects. While the returned dictionary is constrained using a TypedDict, @@ -560,11 +560,12 @@ def get_entity_semityped(self, entity_urn: str) -> AspectBag: something, even if the entity doesn't actually exist in DataHub. :param entity_urn: The urn of the entity + :param Optional[List[str]] aspects: Optional list of aspect names being requested (e.g. [schemaMetadata, datasetProperties]) :returns: A dictionary of aspect name to aspect value. If an aspect is not found, it will not be present in the dictionary. The entity's key aspect will always be present. """ - response_json = self.get_entity_raw(entity_urn) + response_json = self.get_entity_raw(entity_urn, aspects) # Now, we parse the response into proper aspect objects. result: AspectBag = {}