class_docstr: An Amazon SageMaker endpoint context, which is part of a SageMaker lineage.
class_docstr_tok: ["An","Amazon","SageMaker","endpoint","context",",","which","is","part","of","a","SageMaker","lineage","."]
docstr: Get the ARN for the pipeline execution associated with this endpoint (if any).
  
  Args:
      direction (LineageQueryDirectionEnum, optional): The query direction.
  
  Returns:
      str: A pipeline execution ARN.
docstr_tok: ["Get","the","ARN","for","the","pipeline","execution","associated","with","this","endpoint","(","if","any",")",".","Args",":","direction","(","LineageQueryDirectionEnum",",","optional",")",":","The","query","direction",".","Returns",":","str",":","A","pipeline","execution","ARN","."]
code: def pipeline_execution_arn(
      self,
      direction: LineageQueryDirectionEnum = LineageQueryDirectionEnum.ASCENDANTS,
  ) -> str:
      """Get the ARN for the pipeline execution associated with this endpoint (if any).
  
      Args:
          direction (LineageQueryDirectionEnum, optional): The query direction.
  
      Returns:
          str: A pipeline execution ARN.
      """
      training_job_arns = self.training_job_arns(direction=direction)
      for training_job_arn in training_job_arns:
          tags = self.sagemaker_session.sagemaker_client.list_tags(
              ResourceArn=training_job_arn
          )["Tags"]
          for tag in tags:
              if tag["Key"] == "sagemaker:pipeline-execution-arn":
                  return tag["Value"]
  
      return None
  
imports: from __future__ import absolute_import
  from datetime import datetime
  from typing import Iterator, Optional, List
  from sagemaker.apiutils import _base_types
  from sagemaker.lineage import _api_types, _utils, association
  from sagemaker.lineage._api_types import ContextSummary
  from sagemaker.lineage.query import LineageQuery, LineageFilter, LineageSourceEnum, LineageEntityEnum, LineageQueryDirectionEnum
  from sagemaker.lineage.artifact import Artifact
  from sagemaker.lineage.action import Action
  from sagemaker.lineage.lineage_trial_component import LineageTrialComponent
  from sagemaker.utils import format_tags
label_desc: Use image node_id 8 for calling the EndpointContext obj's underlying member method code with example usage: obj.pipeline_execution_arn(direction) and returns: None, tag