File tree Expand file tree Collapse file tree 1 file changed +20
-13
lines changed Expand file tree Collapse file tree 1 file changed +20
-13
lines changed Original file line number Diff line number Diff line change @@ -623,21 +623,28 @@ def list_model_versions(cls, model):
623
623
624
624
"""
625
625
626
- link = cls .get_model_link (model , "modelHistory" )
627
- if link is None :
628
- raise ValueError (
629
- "Cannot find link for version history for model '%s'" % model
630
- )
626
+ if current_session ().version_info () < 4 :
627
+ model = cls .get_model (model )
628
+ if cls .get_model_link (model , "modelVersions" ) is None :
629
+ raise ValueError ("Unable to retrieve versions for model '%s'" % model )
631
630
632
- modelHistory = cls .request_link (
633
- link ,
634
- "modelHistory" ,
635
- headers = {"Accept" : "application/vnd.sas.collection+json" },
636
- )
631
+ return cls .request_link (model , "modelVersions" )
632
+ else :
633
+ link = cls .get_model_link (model , "modelHistory" )
634
+ if link is None :
635
+ raise ValueError (
636
+ "Cannot find link for version history for model '%s'" % model
637
+ )
638
+
639
+ modelHistory = cls .request_link (
640
+ link ,
641
+ "modelHistory" ,
642
+ headers = {"Accept" : "application/vnd.sas.collection+json" },
643
+ )
637
644
638
- if isinstance (modelHistory , RestObj ):
639
- return [modelHistory ]
640
- return modelHistory
645
+ if isinstance (modelHistory , RestObj ):
646
+ return [modelHistory ]
647
+ return modelHistory
641
648
642
649
@classmethod
643
650
def get_model_version (cls , model , version_id ):
You can’t perform that action at this time.
0 commit comments