fix: return created dataset/evaluator from create_version, not bool - #6129
Closed
papriwal wants to merge 2 commits into
Closed
fix: return created dataset/evaluator from create_version, not bool#6129papriwal wants to merge 2 commits into
papriwal wants to merge 2 commits into
Conversation
Callers previously had to call get()/refresh() to retrieve the ARN.
|
Claude finished @papriwal's task in 1m 0s —— View job PR Review: return created dataset/evaluator from
|
|
Claude finished @papriwal's task in 1m 3s —— View job PR Review: return created dataset/evaluator from
|
aviruthen
approved these changes
Jul 30, 2026
jam-jee
approved these changes
Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Return created dataset/evaluator from create_version, not bool
Problem
DataSet.create_versionandEvaluator.create_versionboth discarded the newly created version and returned only a boolean success flag (DataSeteven silently swallowed all exceptions intoFalse). Sincecreate_versioninternally delegates toDataSet.create()/Evaluator.create()— which already return the full new entity — every caller who needed the new version's ARN was forced to make a separateget()orrefresh()call afterward just to retrieve information the method already had in hand.Changes
DataSet.create_versionnow returns the newly createdDataSet(orNoneon failure, matching its existing swallow-and-log pattern).Evaluator.create_versionnow returns the newly createdEvaluator(still raisesRuntimeErroron failure, matching its existing behavior — no change to its error-handling contract).sagemaker_session=self.sagemaker_sessionthrough to the delegatedcreate()call. Previously this was omitted, so callingcreate_versionon an entity created with a non-default session would silently create the new version under a different (default) session instead.logger = logging.getLogger(__name__)todataset.pyandevaluator.py(neither had one) and replaced theprint()calls increate_versionwithlogger.info/logger.error, matching the convention used elsewhere insagemaker.train(e.g.sft_trainer.py,dpo_trainer.py).Testing Done
Updated the existing unit tests in
test_dataset.pyandtest_evaluator.py, and the integration tests intests/integ/ai_registry/test_dataset.pyandtests/integ/ai_registry/test_evaluator.py, to assert against the returned entity object instead of a boolean.