Move truncate_dataset to experimental#5370
Merged
Merged
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
qgallouedec
approved these changes
Mar 25, 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.
Move
truncate_datasetto experimental.Follow-up to:
This PR moves the
truncate_datasetutility function fromtrl/data_utils.pytotrl/experimental/utils.pyand updates all imports and tests accordingly. This change helps modularize experimental utilities and keeps the codebase organized. The associated tests fortruncate_datasethave also been relocated to the experimental test suite.Changes
Refactoring and Code Organization:
Moved the
truncate_datasetfunction fromtrl/data_utils.pytotrl/experimental/utils.py, including its full implementation and docstring. All references in the codebase now import it from the new location.Removed
truncate_datasetfrom the maintrl/__init__.pyand its imports, as it is now considered an experimental utility.Testing updates:
truncate_datasetfromtests/test_data_utils.pytotests/experimental/test_utils.py, ensuring that all test coverage remains intact in the new experimental context.Dependency and Import Adjustments:
trl/experimental/utils.pyto include necessary dependencies for the new location oftruncate_dataset(such aspyarrow,DatasetType, and_get_dataset_format).Note
Medium Risk
Primarily a refactor, but it changes the public import path by removing
truncate_datasetfrom the top-level/stable API, which can break downstream imports and any code relying on it.Overview
Moves
truncate_datasetout of the stabletrl.data_utilsAPI intotrl.experimental.utils, including relocating its implementation and requiredpyarrow/format-handling imports.Updates internal usage (notably
experimental/gold_trainer.py) and test coverage by migratingtruncate_datasettests fromtests/test_data_utils.pyintotests/experimental/test_utils.py, and removestruncate_datasetfrom the publictrl/__init__.pyexports.Written by Cursor Bugbot for commit 46fd46a. This will update automatically on new commits. Configure here.