Skip to content

Conversation

@anth-volk
Copy link
Contributor

@anth-volk anth-volk commented Jan 7, 2026

Summary

Fixes #210

  • Add _find_breakdown_parent() to walk up tree and find breakdown ancestor
  • Add _collect_dimension_values() to collect dimension values along path
  • Add _format_dimension_value() to format values with semantic labels
  • Support breakdown_labels metadata for range() dimensions
  • Remove unused _generate_breakdown_label_simple function

This enables human-readable labels like "SNAP max allotment (Contiguous US, Household size 1)" instead of "(CONTIGUOUS_US, 1)".

Test plan

  • Unit tests for single-level breakdown params
  • Unit tests for single-level scale params (confirm unaffected)
  • Unit tests for nested breakdowns with breakdown_labels
  • Unit tests for mixed nested breakdowns (enum/range combinations)
  • Verified enum lookup takes priority over breakdown_labels

🤖 Generated with Claude Code

anth-volk and others added 3 commits January 9, 2026 22:24
- Add _find_breakdown_parent() to walk up tree and find breakdown ancestor
- Update _generate_breakdown_label() to handle nested breakdowns
- Add _collect_dimension_values() to collect all dimension values along path
- Add _format_dimension_value() to format values with semantic labels
- Support breakdown_labels metadata for range() dimensions
- Add comprehensive tests for nested breakdowns and breakdown_labels

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@anth-volk anth-volk force-pushed the fix/apply-labels-to-nested-breakdowns branch from 78688be to 43c116a Compare January 9, 2026 19:24
anth-volk and others added 2 commits January 9, 2026 22:36
The breakdown metadata can contain lists, so we need to check isinstance(var_name, str)
before calling startswith().

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@anth-volk anth-volk marked this pull request as ready for review January 9, 2026 19:45
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 code to handle new breakdown_labels param metadata option

2 participants