feat(envs): add concatenate-safe dataset creation and concatenation utility #333
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.
Description
This PR fixes the dataset concatenation issue in the verifiers library where multiple datasets created from
env.make_datasethad different columns with different pyarrow types, preventing concatenation of multiple datasets.solves #321
The fix implements proper schema standardization in the
make_datasetmethod and enhances theconcatenate_datasetsstatic method to handle type incompatibilities intelligently. This allows users to run multiple evaluation results against different eval environments and push them as a single dataset instance with splits for each benchmark.Key improvements:
make_datasetmethod to ensure consistent schemas with standard columnsconcatenate_datasetsmethod with intelligent type inference and standardizationconcatenate_safeparameter (default: True) to ensure compatibility by defaultType of Change
Testing
uv run pytestChecklist
Additional Notes
This fix addresses the issue mentioned in the original problem where prime-rl had to implement a custom
make_datasetfunction to handle concatenation of datasets from different environments. The solution has been properly upstreamed to the verifiers library with comprehensive testing and real-world validation.The fix ensures that datasets from different environments can now be properly concatenated regardless of their original schema differences, with proper type handling and split identification.