File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -150,8 +150,12 @@ def _to_resource_config(self) -> shapes.ResourceConfig:
150150 compute_config_dict = self .model_dump ()
151151 resource_config_fields = set (shapes .ResourceConfig .__annotations__ .keys ())
152152 filtered_dict = {
153- k : v for k , v in compute_config_dict .items () if k in resource_config_fields
153+ k : v
154+ for k , v in compute_config_dict .items ()
155+ if k in resource_config_fields and v is not None
154156 }
157+ if not filtered_dict :
158+ return None
155159 return shapes .ResourceConfig (** filtered_dict )
156160
157161
@@ -193,10 +197,14 @@ def _model_validator(self) -> "Networking":
193197 def _to_vpc_config (self ) -> shapes .VpcConfig :
194198 """Convert to a sagemaker_core.shapes.VpcConfig object."""
195199 compute_config_dict = self .model_dump ()
196- resource_config_fields = set (shapes .VpcConfig .__annotations__ .keys ())
200+ vpc_config_fields = set (shapes .VpcConfig .__annotations__ .keys ())
197201 filtered_dict = {
198- k : v for k , v in compute_config_dict .items () if k in resource_config_fields
202+ k : v
203+ for k , v in compute_config_dict .items ()
204+ if k in vpc_config_fields and v is not None
199205 }
206+ if not filtered_dict :
207+ return None
200208 return shapes .VpcConfig (** filtered_dict )
201209
202210
You can’t perform that action at this time.
0 commit comments