fix(exceptions): rename InvalidDatasetError.format to data_format#191
Merged
Conversation
|
🎉 Congratulations @himanshu231204! Your pull request has been successfully merged into main. 🚀 Thank you for contributing to OpenAgentHQ and helping improve the project. We truly appreciate your contribution and hope to see you back with more amazing PRs! Happy Open Sourcing! ❤️ |
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.
Summary
Resolves #70.
InvalidDatasetErrordeclared a constructor parameter namedformat, which shadows Python's built-informat(). This is a code-quality/footgun issue flagged by linters and confuses readers who expectformatto be the builtin.The parameter (and its
self.formatattribute) is renamed todata_formatacross the exception definition and every call site. Thedetailsdict key remains"format"since it is only a string payload key, not a Python identifier, so there is no shadowing concern and no change to the serialized error output.Changes
openagent_eval/exceptions/dataset.py— renameformatparam/attribute/docstring todata_format.openagent_eval/datasets/factory.py— updatedata_format=config.formatkwarg.openagent_eval/datasets/json_loader.py,jsonl_loader.py,csv_loader.py,hf_loader.py,pdf_loader.py— updatedata_format=kwargs at all raise sites.tests/unit/test_exceptions.py— update theInvalidDatasetErrortest to usedata_format=.Testing
pytest tests/unit/test_exceptions.py— 26 passed.pytest tests/unit/test_datasets— 83 passed. (The 4test_pdf_loaderfailures are pre-existing and environmental:pypdfis not installed in this environment. The error output confirms the new kwarg is passed correctly:InvalidDatasetError: ... (format=pdf, ...).)ruff check openagent_eval/exceptions/dataset.py— all checks passed. Remaining ruff warnings indatasets/are pre-existing and unrelated to this change.Checklist
main(fix/70-...)InvalidDatasetErrorno longer shadows theformatbuilt-in