feat: add CSV validator for price and signals files#17
Merged
ayushkrtiwari merged 3 commits intoOPCODE-Open-Spring-Fest:mainfrom Oct 27, 2025
Merged
Conversation
- Implement CSVValidator class with comprehensive validation - Validate file existence, date format, data types, duplicates - Detect missing values, non-numeric data, invalid dates - Provide structured error messages with sample rows - Add validate_input_csv, validate_price_csv, validate_signals_csv - Include 22 comprehensive test cases with 100% pass rate - Add usage examples and documentation Closes OPCODE-Open-Spring-Fest#11
Contributor
Author
|
hii @ayushkrtiwari pls do check |
There was a problem hiding this comment.
Pull Request Overview
This PR adds a comprehensive CSV validator to the quantitative research framework for validating user-provided price and signals files. The validator checks file existence, date formats, data types, missing values, and duplicate dates, providing structured error messages to help users identify and fix data issues before backtesting.
Key Changes:
- Implemented
CSVValidatorclass with validation methods for file structure, dates, data types, and duplicates - Added three convenience functions:
validate_input_csv,validate_price_csv, andvalidate_signals_csv - Created 22 comprehensive test cases covering all validation scenarios with 100% pass rate
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/quant_research_starter/data/validator.py | Core implementation of validation logic including CSVValidator, ValidationError, and validation functions |
| tests/test_validator.py | Comprehensive test suite covering all validation scenarios including edge cases |
| src/quant_research_starter/data/init.py | Export validator components from the data module |
| examples/csv_validation_example.py | Usage examples demonstrating validation workflows and error handling patterns |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Import Any from typing module - Fix return type annotation in validate_input_csv function - Addresses Copilot AI feedback on type hints
c427d09
into
OPCODE-Open-Spring-Fest:main
8 of 10 checks passed
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.
Closes #11