Skip to content

query_lineage

query_lineage(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    start_arns: Optional[QueryLineageStartArns] = None,
    direction: Optional[Direction] = None,
    include_edges: Optional[Boolean] = None,
    filters: Optional[QueryFilters] = None,
    max_depth: Optional[QueryLineageMaxDepth] = None,
    max_results: Optional[QueryLineageMaxResults] = None,
    next_token: Optional[String8192] = None,
) -> QueryLineageResponse

Use this action to inspect your lineage and discover relationships between entities. For more information, see Querying Lineage Entities in the Amazon SageMaker Developer Guide.

Parameters:

  • start_arns (Optional[QueryLineageStartArns], default: None ) –

    A list of resource Amazon Resource Name (ARN) that represent the starting point for your lineage query.

  • direction (Optional[Direction], default: None ) –

    Associations between lineage entities have a direction. This parameter determines the direction from the StartArn(s) that the query traverses.

  • include_edges (Optional[Boolean], default: None ) –

    Setting this value to True retrieves not only the entities of interest but also the Associations and lineage entities on the path. Set to False to only return lineage entities that match your query.

  • filters (Optional[QueryFilters], default: None ) –

    A set of filtering parameters that allow you to specify which entities should be returned.

    • Properties - Key-value pairs to match on the lineage entities' properties.

    • LineageTypes - A set of lineage entity types to match on. For example: TrialComponent, Artifact, or Context.

    • CreatedBefore - Filter entities created before this date.

    • ModifiedBefore - Filter entities modified before this date.

    • ModifiedAfter - Filter entities modified after this date.

  • max_depth (Optional[QueryLineageMaxDepth], default: None ) –

    The maximum depth in lineage relationships from the StartArns that are traversed. Depth is a measure of the number of Associations from the StartArn entity to the matched results.

  • max_results (Optional[QueryLineageMaxResults], default: None ) –

    Limits the number of vertices in the results. Use the NextToken in a response to to retrieve the next page of results.

  • next_token (Optional[String8192], default: None ) –

    Limits the number of vertices in the request. Use the NextToken in a response to to retrieve the next page of results.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def query_lineage(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    start_arns: Optional[
        "capo_sagemaker.types.query_lineage_start_arns.QueryLineageStartArns"
    ] = None,
    direction: Optional["capo_sagemaker.types.direction.Direction"] = None,
    include_edges: Optional["capo_sagemaker.types.boolean.Boolean"] = None,
    filters: Optional["capo_sagemaker.types.query_filters.QueryFilters"] = None,
    max_depth: Optional[
        "capo_sagemaker.types.query_lineage_max_depth.QueryLineageMaxDepth"
    ] = None,
    max_results: Optional[
        "capo_sagemaker.types.query_lineage_max_results.QueryLineageMaxResults"
    ] = None,
    next_token: Optional["capo_sagemaker.types.string8192.String8192"] = None,
) -> "capo_sagemaker.types.query_lineage_response.QueryLineageResponse":
    """<p>Use this action to inspect your lineage and discover relationships between entities. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/querying-lineage-entities.html"> Querying Lineage Entities</a> in the <i>Amazon SageMaker Developer Guide</i>.</p>

    Args:
        start_arns: <p>A list of resource Amazon Resource Name (ARN) that represent the starting point for your lineage query.</p>
        direction: <p>Associations between lineage entities have a direction. This parameter determines the direction from the StartArn(s) that the query traverses.</p>
        include_edges: <p> Setting this value to <code>True</code> retrieves not only the entities of interest but also the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/lineage-tracking-entities.html">Associations</a> and lineage entities on the path. Set to <code>False</code> to only return lineage entities that match your query.</p>
        filters: <p>A set of filtering parameters that allow you to specify which entities should be returned.</p> <ul> <li> <p>Properties - Key-value pairs to match on the lineage entities' properties.</p> </li> <li> <p>LineageTypes - A set of lineage entity types to match on. For example: <code>TrialComponent</code>, <code>Artifact</code>, or <code>Context</code>.</p> </li> <li> <p>CreatedBefore - Filter entities created before this date.</p> </li> <li> <p>ModifiedBefore - Filter entities modified before this date.</p> </li> <li> <p>ModifiedAfter - Filter entities modified after this date.</p> </li> </ul>
        max_depth: <p>The maximum depth in lineage relationships from the <code>StartArns</code> that are traversed. Depth is a measure of the number of <code>Associations</code> from the <code>StartArn</code> entity to the matched results.</p>
        max_results: <p>Limits the number of vertices in the results. Use the <code>NextToken</code> in a response to to retrieve the next page of results.</p>
        next_token: <p>Limits the number of vertices in the request. Use the <code>NextToken</code> in a response to to retrieve the next page of results.</p>

    Raises:
        capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.query_lineage_request.QueryLineageRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.query_lineage_response.QueryLineageResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.query_lineage

        output, http_response = (
            capo_sagemaker._operations.sage_maker.query_lineage.query_lineage(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("QueryLineage")
    )
    input_: capo_sagemaker.types.query_lineage_request.QueryLineageRequest = {}
    if start_arns is not None:
        input_["start_arns"] = start_arns
    if direction is not None:
        input_["direction"] = direction
    if include_edges is not None:
        input_["include_edges"] = include_edges
    if filters is not None:
        input_["filters"] = filters
    if max_depth is not None:
        input_["max_depth"] = max_depth
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output