It seems that row_offset
parameter inside iter_rows() has already been deprecated as of openpyxl version 2.6.0 last 6th Feb, 2019. I tried looking at the commit history and saw the following changes:
https://bitbucket.org/openpyxl/openpyxl/diff/openpyxl/worksheet/worksheet.py?diff1=e4ec3bde4dcc&diff2=3294de3d5668f462baaa6b0a3c17e3b92b8e5c48&at=default
To fix this, you must no longer use the row_offset
and adjust your min_row
and max_row
accordingly.
e.g.
If you're processing only the 4th row of the worksheet:
# old code
rows = worksheet.iter_rows(row_offset=3, max_row=1)
# new
rows = worksheet.iter_rows(min_row=4, max_row=4)
If you're processing the rows starting from the 2nd row:
# old
rows = worksheet.iter_rows(row_offset=1, max_row=(worksheet.max_row - 1)
# new
rows = worksheet.iter_rows(min_row=2, max_row=worksheet.max_row)
I actually like this change even though it broke my codes. I think using min_row
and max_row
makes the code more readable and intuitive rather than using the row_offset
.