Simplify skiprows. We're currently not doing any input validation.

It might make sense to add, but then at the top level function.
This commit is contained in:
ljnsn 2022-11-16 00:12:38 +01:00
parent e88ac035a2
commit 5df67a728a
1 changed files with 3 additions and 8 deletions

View File

@ -5,16 +5,11 @@ import pandas as pd
from .utils import sanitize_df
def parse_data(backend, rows, headers=True, columns=None, skiprows=None):
def parse_data(backend, rows, headers=True, columns=None, skiprows=0):
df_dict = OrderedDict()
col_index = {}
if skiprows is not None:
if isinstance(skiprows, int):
for _ in range(skiprows):
next(rows)
else:
message = f"'skiprows' must be int. {type(skiprows)} was given."
raise ValueError(message)
for i, row in enumerate(rows):
# row is a list of cells
if headers and i == 0 and not columns: