Fix check_dataset entry point by adding missing main function#471
Merged
JoelNiklaus merged 1 commit intohuggingface:mainfrom Mar 11, 2026
Merged
Conversation
Made-with: Cursor
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.
Problem
The
check_datasetCLI tool fails with anImportErrorwhen invoked:Root cause
The
pyproject.tomlentry point declarescheck_dataset = "datatrove.tools.check_dataset:main", but the module had nomainfunction — the CLI logic lived directly underif __name__ == "__main__":.Solution
Wrap the CLI logic in a
main()function and call it from theif __name__ == "__main__":block, matching the pattern used by all other tools indatatrove/tools/.Testing
merge_stats,launch_pickled_pipeline,failed_logs,inspect_data,jobs_status,track_jobs) already follow this pattern.uv pip install -e .and confirmedcheck_datasetno longer raisesImportError.Made with Cursor
Note
Low Risk
Low risk change that only restructures the
check_datasetCLI entry point to match the declaredpyproject.tomlscript and avoid an ImportError.Overview
Fixes the
check_datasetCLI script entry point by introducing amain()function and invoking it from the__main__guard.This aligns
src/datatrove/tools/check_dataset.pywith thepyproject.tomlconsole script (datatrove.tools.check_dataset:main) socheck_datasetcan be executed without import-time failures.Written by Cursor Bugbot for commit 0f1d83d. Configure here.