Skip to content

Commit c4b7154

Browse files
committed
fix: correct kwargs for reading csv with narwhals for peptide pool data
1 parent fad65f0 commit c4b7154

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

hdxms_datasets/reader.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,13 @@ def read_hdexaminer_peptide_pool(source: Path | StringIO) -> nw.DataFrame:
125125
header_line = source.readline()
126126

127127
else:
128-
df = nw.read_csv(source.as_posix(), backend=BACKEND, skip_rows=1, has_header=True)
128+
kwargs = {
129+
"polars": {"skip_rows": 1, "has_header": True},
130+
"pandas": {"skiprows": [0]},
131+
}
132+
if BACKEND not in kwargs:
133+
raise ValueError(f"Unsupported backend: {BACKEND}")
134+
df = nw.read_csv(source.as_posix(), backend=BACKEND, **kwargs[BACKEND])
129135
with open(source, "r") as fh:
130136
exposure_line = fh.readline()
131137
header_line = fh.readline()

0 commit comments

Comments
 (0)