Skip to content

Add parse_array primitive and document CSV array workflows#98

Merged
matthewhorridge merged 3 commits intomainfrom
feat/parse-array-primitive
Feb 18, 2026
Merged

Add parse_array primitive and document CSV array workflows#98
matthewhorridge merged 3 commits intomainfrom
feat/parse-array-primitive

Conversation

@matthewhorridge
Copy link
Contributor

Summary

  • add new parse_array primitive with json (default) and delimiter formats
  • support delimiter parsing with pipe (|) and newline (\n)
  • align parse_array boolean coercion with normalize_boolean behavior
  • wire parse_array into primitive vocabulary/imports and harmonization rule deserialization
  • update demo rules to use parse_array before reduce for week_hours
  • document parse_array and parse_array -> reduce usage in README

Tests

  • venv/bin/pytest -q tests/test_primitives_serialization.py tests/test_rule_serialization.py

Related

- add ParseArray primitive with JSON default and delimiter parsing (pipe/newline)\n- register parse_array in primitive vocabulary/imports and rule deserialization\n- align parse_array boolean coercion with NormalizeBoolean behavior\n- add primitive and rule integration tests\n- update demo primitives_ui rules to parse week_hours before reduce
- add parse_array to primitives reference and examples\n- document parse_array->reduce chain for serialized arrays\n- include delimiter examples for pipe and newline
- update test_cli_missing_behavior to assert SystemExit code 2\n- align test with cli.main contract that uses parser.error for user-facing failures
@matthewhorridge
Copy link
Contributor Author

Addressed failing CI test in .\n\nRoot cause: reports missing-source errors via (), which raises . The test was incorrectly expecting .\n\nFix pushed in commit :\n- now asserts with exit code .\n\nValidation:\n- ....................................................................... [100%]
71 passed in 0.46s -> .

@matthewhorridge
Copy link
Contributor Author

Addressed the failing CI test in tests/test_cli.py.

Root cause:

  • cli.main reports missing-source errors via argparse (parser.error), which raises SystemExit(2).
  • The test was incorrectly expecting ValueError.

Fix pushed in commit ed0dd28:

  • test_cli_missing_behavior now asserts SystemExit with exit code 2.

Validation:

  • venv/bin/pytest -q -> 71 passed.

@matthewhorridge matthewhorridge merged commit 846b826 into main Feb 18, 2026
1 check 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