Skip to content

Commit

Permalink
fix: minor correctness / off-by-one error in excel data processing
Browse files Browse the repository at this point in the history
- The right number of empty rows would be removed afterwards anyway, but
  for someone reading the code later it'd be better if that number was
  as stated.
  • Loading branch information
lindsay-stevens committed May 5, 2023
1 parent 7550ff4 commit 7015ba7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyxform/xls2json_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def get_excel_column_headers(first_row: Iterator[Optional[str]]) -> List[Optiona
# Preserve column order (will filter later)
column_header_list.append(None)
# After a run of empty cols, assume we've reached the end of the data.
if max_adjacent_empty_columns < adjacent_empty_cols:
if max_adjacent_empty_columns == adjacent_empty_cols:
break
adjacent_empty_cols += 1
else:
Expand Down Expand Up @@ -99,7 +99,7 @@ def get_excel_rows(

if 0 == len(row_dict):
# After a run of empty rows, assume we've reached the end of the data.
if max_adjacent_empty_rows < adjacent_empty_rows:
if max_adjacent_empty_rows == adjacent_empty_rows:
break
adjacent_empty_rows += 1
else:
Expand Down

0 comments on commit 7015ba7

Please sign in to comment.