PydPiper / pylightxl

A light weight, zero dependency, minimal functionality excel read/writer python library
https://pylightxl.readthedocs.io
MIT License
300 stars 47 forks source link

Warn and skip invalid defined-name instead of raising #62

Closed yohanboniface closed 2 years ago

yohanboniface commented 2 years ago

An invalid defined name does not seem to me an unexpected error that would stop the processing of the data.

For example, I'm processing a lot of xslx created with R (not by me), that have dummy ranges. For example:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
    <fileVersion appName="xl" lastEdited="5" lowestEdited="5" rupBuild="9303"/>
    <workbookPr/>
    <bookViews>
        <workbookView windowHeight="6105" windowWidth="13125" xWindow="0" yWindow="0"/>
    </bookViews>
    <sheets>
        <sheet name="com2021" r:id="rId1" sheetId="1"/>
    </sheets>
    <definedNames>
        <definedName hidden="1" name="_AMO_UniqueIdentifier">&quot;'f570e99d-b15a-4b20-a455-86810c1c14ea'&quot;</definedName>
    </definedNames>
    <calcPr calcId="0"/>
</workbook>

Here is then a proposal to switch from an Exception to a proper Warning.

Thanks for reviewing :)

PydPiper commented 2 years ago

Hey @yohanboniface thank you so much for contributing this looks solid to me!

yohanboniface commented 2 years ago

Cool, thanks for merging :)

Any new release in the radar ? :)