Skip to content

fix(excel): restore split-by-column fallback - #178

Merged
CoderWanFeng merged 1 commit into
CoderWanFeng:developfrom
lawliet206:fix/split-excel-fallback
Aug 19, 2026
Merged

fix(excel): restore split-by-column fallback#178
CoderWanFeng merged 1 commit into
CoderWanFeng:developfrom
lawliet206:fix/split-excel-fallback

Conversation

@lawliet206

Copy link
Copy Markdown
Contributor

Problem

office.excel.split_excel_by_column() and the matching Excel Skill fail before processing any workbook when used with the currently published poexcel 0.0.22 package:

AttributeError: module 'poexcel' has no attribute 'split_excel_by_column'

The repository already contains a maintained split-by-column implementation under office.lib.excel.SplitExcel, but the public wrapper does not use it.

Root Cause

The wrapper unconditionally calls poexcel.split_excel_by_column. The current poexcel release does not expose that name from its top-level package, so attribute lookup fails before the bundled implementation can run.

Solution

  • Continue using poexcel.split_excel_by_column when a future or alternate poexcel version exposes it.
  • Fall back lazily to the bundled office.lib.excel.SplitExcel.split_excel_by_column implementation when the dependency does not expose the function.
  • Add regression tests for both delegation paths.

Testing

python -m unittest tests.test_code.test_excel_split_wrapper -v
2 tests passed

python -m unittest tests.test_code.test_instruction_url tests.test_code.test_web tests.test_code.test_excel_split_wrapper -v
5 tests passed

python -m compileall -q office tests/test_code/test_excel_split_wrapper.py
passed

Also verified the fallback with poexcel 0.0.22 and a generated .xlsx workbook. It created the split output with the expected Alpha and Beta worksheets, and the input/output files could be renamed afterward (no open file handles remained).

Compatibility

No public API or parameter behavior changes. Environments where poexcel already exports the function keep the existing delegation path; affected environments regain the documented functionality through the bundled implementation.

Related Issue

No dedicated issue. This is a follow-up to the bundled split implementation fixes merged in #161.

@CoderWanFeng
CoderWanFeng merged commit dd6fe56 into CoderWanFeng:develop Aug 19, 2026
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.

2 participants