fix(excel): report missing frictionless[excel] instead of invalid excel file - #1802
Open
Sanjays2402 wants to merge 1 commit into
Open
fix(excel): report missing frictionless[excel] instead of invalid excel file#1802Sanjays2402 wants to merge 1 commit into
Sanjays2402 wants to merge 1 commit into
Conversation
…el file The xlsx parser resolved platform.openpyxl inside the try/except that wraps load_workbook. When the excel extra is not installed, the FrictionlessException raised by the @Extras decorator was caught there and replaced with a misleading 'invalid excel file' format error, so users had no indication that a dependency was missing. The attribute is now resolved before the try block, so the install hint propagates unchanged while genuine parsing failures still map to a format error. Adds a regression test that forces the import to fail via sys.modules so it exercises the missing-dependency path even in a fully installed environment.
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.
The xlsx parser resolved
platform.openpyxlinside thetry/exceptaroundload_workbook, so whenfrictionless[excel]is not installed the@extrasinstall hint was swallowed and re-raised asinvalid excel file "table.xlsx". Resolving the attribute before thetryblock lets the hint propagate while genuine parse failures still map to a format error.The regression test forces the import to fail via
sys.modules, so it exercises the missing-dependency path even in CI where openpyxl is installed; it fails on the unpatched parser with theinvalid excel filenote and passes with the fix.This change was prepared with AI assistance; the regression test was run locally and fails without the fix.