Skip to content

Commit

Permalink
replace assert with raise
Browse files Browse the repository at this point in the history
  • Loading branch information
raisadz committed Sep 15, 2024
1 parent 60ed72e commit 9840e3c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion narwhals/_arrow/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ def __getitem__(

# PyArrow columns are always strings
col_name = item[1] if isinstance(item[1], str) else self.columns[item[1]]
assert not isinstance(item[0], str) # help mypy # noqa: S101
if isinstance(item[0], str):
msg = "Can not slice with tuple with the first element as a str" # pragma: no cover
raise TypeError(msg) # pragma: no cover
if (isinstance(item[0], slice)) and (item[0] == slice(None)):
return ArrowSeries(
self._native_frame[col_name],
Expand Down

0 comments on commit 9840e3c

Please sign in to comment.