Skip to content

Commit

Permalink
fix None case
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Dec 26, 2022
1 parent e9fb2e0 commit 5471447
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion py-polars/polars/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,14 @@ def handle_projection_columns(
"'columns' arg should contain a list of all integers or all strings"
" values."
)
if len(set(columns)) != len(columns): # type: ignore[arg-type]
if columns and len(set(columns)) != len(columns):
raise ValueError(
f"'columns' arg should only have unique values. Got '{columns}'."
)
if projection and len(set(projection)) != len(projection):
raise ValueError(
f"'columns' arg should only have unique values. Got '{projection}'."
)
return projection, columns # type: ignore[return-value]


Expand Down

0 comments on commit 5471447

Please sign in to comment.