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.

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

1212
1313 sample_size = 10000
1414
15- re_cr_tag = re.compile(r'(?<=<c r=)(.+?)(?=</c>)')
15+ re_cr_tag = re.compile(r'(?<=<c r=)(.+?)(?=</c>|/>)')
1616 re_cell_val = re.compile(r'(?<=<v>)(.*)(?=</v>)')
1717 re_cell_formula = re.compile(r'(?<=<f>)(.*)(?=</f>)')
1818
4848 except IndexError:
4949 # current cell doesn't have a value
5050 cell_val = ''
51+ is_string = True
5152
5253 try:
5354 cell_formula = str(re_cell_formula.findall(first_match)[0])

The check that tells the two apart

failpass·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.