using python sdk reading particular version of pipeline

  • 15 March 2023
  • 2 replies

Using python sdk can we read particular version of pipeline like if pipeline has two version then can we read first version.


this line 

gives latest version only can we get previous version also.


Best answer by Bikram 15 March 2023, 14:05

View original

2 replies

Userlevel 4


Another way is to get the latest version of your pipeline like you mentioned in the sample code:



You can now use


This will list all the commits for this pipeline, you will see the commit_id and also the version number for each commit.


So if you want version=1, select the commit_id for that version and use this code to get the reference to the pipeline

pipeline=sch.pipelines.get(commit_id="YOUR COMMIT_ID")


Userlevel 5
Badge +1



Can you please try the below code snippet and check if it helps.


# Get the history of the pipeline

pipeline_history = client.get_pipeline_history('pipeline_name')

# Get the previous version of the pipeline

previous_pipeline = pipeline_history[1]

# Print information about the previous pipeline

print("Previous pipeline version:", previous_pipeline['version'])