You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: make expand_axis_range optional with default false (#47)
## Changes
### Core Logic (src/sharepoint_excel.py)
- Add `expand_axis_range: bool = False` parameter to `parse_to_json` and `_parse_sheet`
- Wrap `_expand_axis_range` call with conditional check
- Add `header_detection` warning metadata when `frozen_rows=0` and `cell_range` is specified
### MCP Tool Layer (src/server.py)
- Add `expand_axis_range: bool = False` parameter to `sharepoint_excel` function
- Update docstring to remove auto-expansion warning from `cell_range` description
- Add `expand_axis_range` parameter documentation
- Update tool description workflow to 3 steps with clear guidance
### Tests (tests/test_server.py)
- Add `expand_axis_range=False` to all `assert_called_once_with` calls
### Tests (tests/test_sharepoint_excel.py)
- Update `test_include_frozen_rows_single_cell` to reflect default behavior (no expansion)
- Update `test_no_duplicate_range_normalization` to pass `expand_axis_range=True`
- Add 4 new tests for `expand_axis_range` parameter:
- `test_expand_axis_range_true_single_column`
- `test_expand_axis_range_false_default`
- `test_expand_axis_range_with_include_frozen_rows`
- `test_expand_axis_range_true_single_cell`
- Add 2 new tests for `header_detection` warning:
- `test_header_detection_warning_frozen_rows_zero_with_cell_range`
- `test_header_detection_not_added_when_frozen_rows_exist`
- Update `test_include_frozen_rows_without_cell_range` to verify no warning
## Motivation
Previously, single column/row ranges were always auto-expanded to include row 1 or column A (introduced in PR #35). However, with `include_frozen_rows` (PR #41), this auto-expansion became redundant for sheets with frozen rows. This change makes expansion optional (default OFF) while keeping it available as a fallback for sheets with `frozen_rows=0`.
## Verification
- All 137 tests pass
- Quality checks (type check, lint, format) pass
- Actual usage confirmed: LLM naturally follows 3-step workflow with clear guidance
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
0 commit comments