Repository navigation
fix: expose inference component fields on ModelBuilder - #6457
gauravkriplani wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🤖 AI code review
This PR exposes resource_requirements and inference_component_name as typed ModelBuilder dataclass fields (both defaulting to None), and removes the now-redundant hasattr guard for resource_requirements in _initialize_jumpstart_config. These attributes were already consumed by build() (e.g. lines 4649-4650, 4711-4713), so declaring them as constructor fields matches the documented CustomOrchestrator API and prevents TypeError. The change is correct and well-scoped: imports (field, Optional, ResourceRequirements) are all present, defaults are safe, and the updated test verifies propagation into the generated inference-component deployable. No issues found.
Reviewed commit eaa31d9. Automated review; verify before acting.
Summary
resource_requirementsandinference_component_nameas typedModelBuilderfieldsCustomOrchestratorinference-component configurations to be passed through the constructorProblem
ModelBuilder.build()consumes these attributes internally, but the dataclass constructor did not declare them. Documented configurations therefore failed withTypeErrorand required users to mutate the builder after construction.Testing
pytest -q sagemaker-serve/tests/unit/test_model_builder_workflows.py— 17 passedCustomOrchestratorconstructor reproductionblack --checkgit diff --checkFixes #6198