Skip to content

fix: add input validation for dataset path — show helpful error for missing files (#118)#158

Open
fazalpsinfo-cmyk wants to merge 1 commit into
OpenAgentHQ:mainfrom
fazalpsinfo-cmyk:fix/input-validation-dataset-118
Open

fix: add input validation for dataset path — show helpful error for missing files (#118)#158
fazalpsinfo-cmyk wants to merge 1 commit into
OpenAgentHQ:mainfrom
fazalpsinfo-cmyk:fix/input-validation-dataset-118

Conversation

@fazalpsinfo-cmyk

Copy link
Copy Markdown

Fix: Add input validation for dataset path with helpful error message

When a user specifies a dataset path that doesn't exist, the error message was a generic DatasetNotFoundError. Now it shows:

Dataset file not found at 'data/my-dataset.json'. 
Checked in: /home/user/project/.
Use an absolute path or verify the path exists relative to your current directory.

Changes

  1. openagent_eval/datasets/base.py — Enhanced _validate_path() to include current working directory and usage tip in the error details.
  2. openagent_eval/datasets/factory.py — Added early path validation in _get_loader() for fail-fast behaviour before loader selection.

Fixes #118


Support my work: If this fix helped, consider buying me a coffee at https://buymeacoffee.com/muhamedfazalps

…OpenAgentHQ#118)

_validate_path now raises DatasetNotFoundError with a user-friendly
message showing the missing path, current working directory, and a
tip about using absolute paths. Early validation also added to
_get_loader in factory.py for fail-fast behaviour.

Closes OpenAgentHQ#118
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.

Add input validation for dataset path — show helpful error for missing files

1 participant