Saturday 20 May 2023

Check for backward upgrade versions

I have a dataframe like this:

api_spec_id   info_version
124             2.0.0
124             2.0.0
124             1.0.0
124             1.5.6
124             0.4.5
345             v2alpha1
345             v1alpha1
348             1.0.0-Snapshot
348             1.0.0-Snapshot

I want to compare between theinfo_version and check how many times does the version go backward, like from 2.0.0 to 1.0.0 or from v2 to v1. I am not sure how this will be possible, or if i will have to use the packaging Version class in order to compare.

In my expected output, I would like a count of the number of api_spec_id where such phenomenon is observed. It will be like:

api_spec_id     count
124                2
345                1
348                0

Any suggestions or ideas on how this could be achieved would be really grateful.



from Check for backward upgrade versions

No comments:

Post a Comment