1818from ads .feature_store .common .utils .utility import (
1919 get_metastore_id ,
2020 validate_delta_format_parameters ,
21- convert_expectation_suite_to_expectation ,
22- validate_model_ocid_format , search_model_ocids
21+ convert_expectation_suite_to_expectation
2322)
2423from ads .feature_store .dataset_job import DatasetJob , IngestionMode
2524from ads .feature_store .execution_strategy .engine .spark_engine import SparkEngine
@@ -375,7 +374,7 @@ def expectation_details(self) -> "Expectation":
375374 return self .get_spec (self .CONST_EXPECTATION_DETAILS )
376375
377376 def with_expectation_suite (
378- self , expectation_suite : ExpectationSuite , expectation_type : ExpectationType
377+ self , expectation_suite : ExpectationSuite , expectation_type : ExpectationType
379378 ) -> "Dataset" :
380379 """Sets the expectation details for the feature group.
381380
@@ -446,7 +445,7 @@ def statistics_config(self, statistics_config: StatisticsConfig):
446445 self .with_statistics_config (statistics_config )
447446
448447 def with_statistics_config (
449- self , statistics_config : Union [StatisticsConfig , bool ]
448+ self , statistics_config : Union [StatisticsConfig , bool ]
450449 ) -> "Dataset" :
451450 """Sets the statistics details for the dataset.
452451
@@ -482,7 +481,7 @@ def model_details(self) -> "ModelDetails":
482481 def model_details (self , model_details : ModelDetails ):
483482 self .with_model_details (model_details )
484483
485- def with_model_details (self , model_details : ModelDetails , validate : bool = True ) -> "Dataset" :
484+ def with_model_details (self , model_details : ModelDetails ) -> "Dataset" :
486485 """Sets the model details for the dataset.
487486
488487 Parameters
@@ -500,17 +499,6 @@ def with_model_details(self, model_details: ModelDetails,validate: bool = True)
500499 "The argument `model_details` has to be of type `ModelDetails`"
501500 "but is of type: `{}`" .format (type (model_details ))
502501 )
503- #TODO: we could eiher use validate_model_ocid_format if thats enough or search_model_ocids
504- #search_model_ocids should be used after set_auth without url
505- # items = model_details["items"]
506- # for item in items:
507- # if not validate_model_ocid(item):
508- # raise ValueError(
509- # f"the model ocid {item} is not valid"
510- # )
511- if validate :
512- model_ids_list = search_model_ocids (model_details .items )
513- model_details = ModelDetails (model_ids_list )
514502
515503 return self .set_spec (self .CONST_MODEL_DETAILS , model_details .to_dict ())
516504
@@ -532,7 +520,14 @@ def add_models(self, model_details: ModelDetails) -> "Dataset":
532520 for item in items :
533521 model_details .items .append (item )
534522 self .with_model_details (model_details )
535- return self .update ()
523+ self .update ()
524+
525+ self ._update_from_oci_dataset_model (self .oci_dataset )
526+ updated_model_details = self .model_details
527+ if updated_model_details and updated_model_details .items and model_details :
528+ for model_id in model_details .items :
529+ if model_id not in updated_model_details ["items" ]:
530+ logger .warning ("Model Id" + model_id + " doesnt exist or you do not have the permission" )
536531
537532 def remove_models (self , model_details : ModelDetails ) -> "Dataset" :
538533 """remove model details from the dataset, remove from the existing dataset model id list
0 commit comments