Skip to content

Commit

Permalink
Mypy warn redundant casts (#4055)
Browse files Browse the repository at this point in the history
  • Loading branch information
zundertj committed Jul 18, 2022
1 parent 25e9cef commit 20134a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion py-polars/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ strict_concatenate = true
# TODO: Uncomment flags below and fix mypy errors
# disallow_any_generics = true
# disallow_untyped_calls = true
# warn_redundant_casts = true
warn_redundant_casts = true
# warn_return_any = true
# no_implicit_reexport = true
# strict_equality = true
Expand Down
9 changes: 2 additions & 7 deletions py-polars/tests/test_df.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
import polars as pl
from polars.testing import assert_frame_equal, assert_series_equal, columns

if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal


def test_version() -> None:
pl.__version__
Expand Down Expand Up @@ -1931,9 +1926,9 @@ def test_shrink_to_fit(in_place: bool) -> None:
df = pl.DataFrame({"foo": [1, 2, 3], "bar": [6, 7, 8], "ham": ["a", "b", "c"]})

if in_place:
assert df.shrink_to_fit(typing.cast(Literal[True], in_place)) is None
assert df.shrink_to_fit(in_place) is None
else:
assert df.shrink_to_fit(typing.cast(Literal[False], in_place)).frame_equal(df)
assert df.shrink_to_fit(in_place).frame_equal(df)


def test_arithmetic() -> None:
Expand Down

0 comments on commit 20134a9

Please sign in to comment.