One function
scrape in PydPiper/pylightxl
The author described this change as “fixed a bug preventing worksheets with vertically merged cells from loading properly and added a new test.”. It counts as a record because the check below fails on the code as it stood at db2a266d4 and passes on 52dd15a6a, with nothing else changed between the two runs.
ProjectPydPiper/pylightxl
Fix saved2020-03-14
Sharing licenceMIT · LICENSE
Change size+2 −1
What the code was meant to do, written into the code itself as a docstring
Takes a file-handle of xl/worksheets/sheet#.xml and returns a dict of cell data :param open-filehandle file: xl/worksheets/sheet#.xml file-handle :param dict sharedString: shared string dict lookup table from xl/sharedStrings.xml for string only cell values :return: yields a dict of cell data {cellAddress: cellVal}
The change
| 12 | 12 | ||
| 13 | 13 | sample_size = 10000 | |
| 14 | 14 | ||
| 15 | - | re_cr_tag = re.compile(r'(?<=<c r=)(.+?)(?=</c>)') | |
| 15 | + | re_cr_tag = re.compile(r'(?<=<c r=)(.+?)(?=</c>|/>)') | |
| 16 | 16 | re_cell_val = re.compile(r'(?<=<v>)(.*)(?=</v>)') | |
| 17 | 17 | re_cell_formula = re.compile(r'(?<=<f>)(.*)(?=</f>)') | |
| 18 | 18 | ||
| ⋯ | |||
| 48 | 48 | except IndexError: | |
| 49 | 49 | # current cell doesn't have a value | |
| 50 | 50 | cell_val = '' | |
| 51 | + | is_string = True | |
| 51 | 52 | ||
| 52 | 53 | try: | |
| 53 | 54 | cell_formula = str(re_cell_formula.findall(first_match)[0]) | |
The check that tells the two apart
fail→pass·test/test_readxl.py::test_readxl_integration::test_ws_merged_cells
Check file test/test_readxl.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before itdb2a266d4ca9da1710956f351c9f035434b2d4f6
Broken version dated2020-03-02
Modulepylightxl.readxl
Units changedscrape
Fingerprint2512575dab75751c
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.