Skip to content

Adding validation#2

Merged
mabesa merged 2 commits into
mainfrom
adding_validation
Feb 6, 2026
Merged

Adding validation#2
mabesa merged 2 commits into
mainfrom
adding_validation

Conversation

@mabesa

@mabesa mabesa commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

No description provided.

mabesa and others added 2 commits February 6, 2026 14:34
- Add required DataFrame column checks in all prepare_*_records() methods
- Use Literal type hints for horizon_type, meteo_type, snow_type params
- Add NaN guards before int() casts to prevent crashes on missing data
- Surface server error details (JSON detail field) in SapphireAPIError
- Add 12 error-path tests for missing columns, NaN handling, and error messages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Introduce a dedicated validators module with input validation functions
(URL, integers, enums, response truncation, safe int conversion) and
constant sets for valid API parameters. Harden the base client with
constructor validation, 429 retry support, response text truncation in
exceptions, and a redirect limit. Add enum/skip/limit validation to all
preprocessing and postprocessing read methods. Add pip-audit to CI and
create SECURITY.md disclosure policy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mabesa mabesa merged commit d244ca7 into main Feb 6, 2026
3 checks passed
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.

1 participant