Skip to content

Comments

Fix uncacheable dataset.map calls #940

Open
rotemtzaban wants to merge 1 commit intoPrimeIntellect-ai:mainfrom
rotemtzaban:main
Open

Fix uncacheable dataset.map calls #940
rotemtzaban wants to merge 1 commit intoPrimeIntellect-ai:mainfrom
rotemtzaban:main

Conversation

@rotemtzaban
Copy link

@rotemtzaban rotemtzaban commented Feb 19, 2026

Description

Datasets loaded via Environment weren't using the huggingface cache, because the caching hash is consistent on locally defined functions.

Made the utility functions into module level functions

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Test improvement

Testing

  • All existing tests pass when running uv run pytest locally.
  • New tests have been added to cover the changes

Checklist

  • My code follows the style guidelines of this project as outlined in AGENTS.md
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Additional Notes


Note

Low Risk
Small, localized changes to dataset preprocessing; main risk is subtle differences in example_id generation or prompt message structure affecting downstream consumers.

Overview
Fixes HuggingFace Dataset.map caching in Environment dataset formatting by moving prompt-building helpers into module-level functions (stable hashing) and reusing them when creating/prepending system prompts.

Updates _ensure_example_id to use dataset.map(..., with_indices=True, **map_kwargs) (instead of add_column) and threads map_kwargs through the dataset formatting pipeline so caller-provided map settings are consistently applied.

Written by Cursor Bugbot for commit 1679cdf. This will update automatically on new commits. Configure here.

@CLAassistant
Copy link

CLAassistant commented Feb 19, 2026

CLA assistant check
All committers have signed the CLA.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants