Skip to content

Handle invalid int-field floats without traceback#68

Open
arpitjain099 wants to merge 1 commit into
USDA-ARS-NWRC:masterfrom
arpitjain099:fix/int-field-float-validation-49
Open

Handle invalid int-field floats without traceback#68
arpitjain099 wants to merge 1 commit into
USDA-ARS-NWRC:masterfrom
arpitjain099:fix/int-field-float-validation-49

Conversation

@arpitjain099

@arpitjain099 arpitjain099 commented Jun 17, 2026

Copy link
Copy Markdown

This keeps invalid numeric values from crashing during cast_all_variables. If a cast raises ValueError, we now keep the raw config value so check_config can report a normal validation error instead of throwing a traceback.

Also added a regression test that sets an int field to 0.1 and verifies it is reported as a config error.

Tests run:

  • pytest tests/test_tools.py -q

Fixes #49

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
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.

Config item passed with float with decimal in an integer field errors out

1 participant