Open
Restore default Excel table formatting in file connector#1140
Conversation
Co-authored-by: ebhills <53243273+ebhills@users.noreply.github.com>
Co-authored-by: ebhills <53243273+ebhills@users.noreply.github.com>
Co-authored-by: ebhills <53243273+ebhills@users.noreply.github.com>
Co-authored-by: ebhills <53243273+ebhills@users.noreply.github.com>
Co-authored-by: ebhills <53243273+ebhills@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Re-implement default table formatting for file connector
Restore default Excel table formatting in file connector
Aug 22, 2026
ebhills
approved these changes
Aug 24, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Restores default Excel table styling while retaining the advanced formatting path.
Changes:
- Adds default XlsxWriter table formatting and top alignment.
- Handles duplicate, nullable, indexed, and MultiIndex headers.
- Expands Excel connector regression tests.
Recommended disposition: Request changes
Next steps
- PR assignee: Fix the three Excel compatibility and round-trip regressions, add focused tests, then re-request review.
- Reviewer: Verify fixes, resolve threads, and submit a fresh approval.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
wrangles/connectors/file.py |
Routes Excel exports through default or advanced formatting. |
wrangles/connectors/_formatting.py |
Implements default table styling and header handling. |
tests/connectors/test_file.py |
Adds Excel formatting and compatibility tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+247
to
+248
| if kwargs.get('index', False): | ||
| df = df.reset_index() |
Comment on lines
+1156
to
+1157
| from openpyxl.utils.escape import unescape | ||
| assert unescape(result['col'][0]) == 'a\tb\nc\rd' |
| # Default to not including index if user hasn't explicitly requested it | ||
| if 'index' not in kwargs.keys(): kwargs['index'] = False | ||
| sheet_name = kwargs.pop('sheet_name', 'Sheet1') | ||
| df = _remove_illegal_characters(df) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issue
What changes
Excel files written without explicit formatting no longer received the file connector’s default table styling.
Table Style Medium9and top alignment using XlsxWriter.This now produces a formatted Excel table without requiring a
formattingblock.How it was verified
Compatibility and risk
constant_memory=Truenow raisesValueErrorbecause it is incompatible with pandas column writes and Excel tables.Ready-for-review checklist
mainand has no merge conflictsSee the pull request workflow.