@@ -293,7 +293,8 @@ def get_training_set_from_view(self, training_view: str, features: Union[List[Fe
293293 r = make_request (self ._FS_URL , Endpoints .TRAINING_SET_FROM_VIEW , RequestType .POST , self ._basic_auth , { "view" : training_view },
294294 { "features" : features , "start_time" : start_time , "end_time" : end_time })
295295 sql = r ["sql" ]
296- tvw = r ["training_view" ]
296+ tvw = TrainingView (** r ["training_view" ])
297+ features = [Feature (** f ) for f in r ["features" ]]
297298
298299 # Link this to mlflow for model deployment
299300 if self .mlflow_ctx and not return_sql :
@@ -530,14 +531,16 @@ def get_training_set_from_deployment(self, schema_name: str, table_name: str):
530531 { "schema" : schema_name , "table" : table_name })
531532 metadata = r ["metadata" ]
532533
533- sql = r [" sql" ]
534+ sql = r [' sql' ]
534535 features = metadata ['FEATURES' ].split (',' )
535536 tv_name = metadata ['NAME' ]
536537 start_time = metadata ['TRAINING_SET_START_TS' ]
537538 end_time = metadata ['TRAINING_SET_END_TS' ]
539+ tv = TrainingView (** r ['training_view' ]) if 'training_view' in r else None
540+ features = [Feature (** f ) for f in r ["features" ]]
538541
539542 if self .mlflow_ctx :
540- self .link_training_set_to_mlflow (features , start_time , end_time , tv_name )
543+ self .link_training_set_to_mlflow (features , start_time , end_time , tv )
541544 return self .splice_ctx .df (sql )
542545
543546 def remove_feature (self , name : str ):
@@ -551,6 +554,17 @@ def remove_feature(self, name: str):
551554 """
552555 make_request (self ._FS_URL , Endpoints .FEATURES , RequestType .DELETE , self ._basic_auth , { "name" : name })
553556
557+ def get_deployments (self , schema_name : str = None , table_name : str = None , training_set : str = None ):
558+ """
559+ Returns a list of all (or specified) available deployments
560+ :param schema_name: model schema name
561+ :param table_name: model table name
562+ :param training_set: training set name
563+ :return: List[Deployment] the list of Deployments as dicts
564+ """
565+ return make_request (self ._FS_URL , Endpoints .DEPLOYMENTS , RequestType .GET , self ._basic_auth ,
566+ { 'schema' : schema_name , 'table' : table_name , 'name' : training_set })
567+
554568 def _retrieve_model_data_sets (self , schema_name : str , table_name : str ):
555569 """
556570 Returns the training set dataframe and model table dataframe for a given deployed model.
0 commit comments