Commit 63d24a6
committed
refactor: Move seek logic into _open_and_parse_file_with_openpyxl
Address reviewer feedback from @darynaishchenko (Comment 2555661755):
- Move fp.seek(0) try/except block into _open_and_parse_file_with_openpyxl
- Add info-level logging for seek failures instead of silent pass
- Remove duplicate seek logic from open_and_parse_file orchestration method
- Add hasattr check to avoid AttributeError on non-file-like objects
- Simplify orchestration method to focus purely on flow control
This centralizes fallback-specific concerns within the openpyxl path and
makes the behavior easier to test and reason about.
All local checks pass:
- Unit tests pass (4 passed, 1 skipped)
- MyPy type checking passes
- Ruff format and lint pass
Co-Authored-By: unknown <>1 parent d2f691a commit 63d24a6
1 file changed
+10
-7
lines changedLines changed: 10 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
236 | 246 | | |
237 | 247 | | |
238 | 248 | | |
| |||
263 | 273 | | |
264 | 274 | | |
265 | 275 | | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | 276 | | |
0 commit comments