Skip to content

Commit

Permalink
fix mypy errors
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
  • Loading branch information
anmyachev committed Jan 23, 2024
1 parent 3db306f commit 0a4ad77
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion tests/dataframe/any_all_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_reductions(
df = bool_dataframe_1(library)
ns = df.__dataframe_namespace__()
result = getattr(df, reduction)()
compare_dataframe_with_reference(result, expected_data, dtype=ns.Bool)
compare_dataframe_with_reference(result, expected_data, dtype=ns.Bool) # type: ignore[arg-type]


def test_any(library: str) -> None:
Expand Down
4 changes: 2 additions & 2 deletions tests/dataframe/comparisons_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_comparisons_with_scalar(
other = 2
result = getattr(df, comparison)(other)
expected_ns_dtype = getattr(ns, expected_dtype)
compare_dataframe_with_reference(result, expected_data, dtype=expected_ns_dtype)
compare_dataframe_with_reference(result, expected_data, dtype=expected_ns_dtype) # type: ignore[arg-type]


@pytest.mark.parametrize(
Expand All @@ -55,4 +55,4 @@ def test_rcomparisons_with_scalar(
ns = df.__dataframe_namespace__()
other = 2
result = getattr(df, comparison)(other)
compare_dataframe_with_reference(result, expected_data, dtype=ns.Int64)
compare_dataframe_with_reference(result, expected_data, dtype=ns.Int64) # type: ignore[arg-type]
4 changes: 2 additions & 2 deletions tests/dataframe/fill_nan_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ def test_fill_nan_with_null(library: str) -> None:
result = n_nans.col("a").persist().get_value(0).scalar
if library == "pandas-numpy":
# null is nan for pandas-numpy
assert result == 1 # type: ignore[index]
assert result == 1
else:
assert result == 0 # type: ignore[index]
assert result == 0
6 changes: 3 additions & 3 deletions tests/dataframe/join_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_join_left(library: str) -> None:
"b": ns.Int64,
"c": ns.Int64 if library in ["pandas-nullable", "polars-lazy"] else ns.Float64,
}
compare_dataframe_with_reference(result, expected, dtype=expected_dtype)
compare_dataframe_with_reference(result, expected, dtype=expected_dtype) # type: ignore[arg-type]


def test_join_overlapping_names(library: str) -> None:
Expand Down Expand Up @@ -60,7 +60,7 @@ def test_join_outer(library: str) -> None: # pragma: no cover
"b": ns.Int64 if library in ["pandas-nullable", "polars-lazy"] else ns.Float64,
"c": ns.Int64 if library in ["pandas-nullable", "polars-lazy"] else ns.Float64,
}
compare_dataframe_with_reference(result, expected, dtype=expected_dtype)
compare_dataframe_with_reference(result, expected, dtype=expected_dtype) # type: ignore[arg-type]


def test_join_two_keys(library: str) -> None:
Expand All @@ -74,7 +74,7 @@ def test_join_two_keys(library: str) -> None:
"b": ns.Int64,
"c": ns.Int64 if library in ["pandas-nullable", "polars-lazy"] else ns.Float64,
}
compare_dataframe_with_reference(result, expected, dtype=expected_dtype)
compare_dataframe_with_reference(result, expected, dtype=expected_dtype) # type: ignore[arg-type]


def test_join_invalid(library: str) -> None:
Expand Down
4 changes: 2 additions & 2 deletions tests/groupby/aggregate_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_aggregate(library: str) -> None:
}
if library == "polars-lazy":
result = result.cast({"b_count": ns.Int64()})
compare_dataframe_with_reference(result, expected, dtype=expected_dtype)
compare_dataframe_with_reference(result, expected, dtype=expected_dtype) # type: ignore[arg-type]


def test_aggregate_only_size(library: str) -> None:
Expand Down Expand Up @@ -108,4 +108,4 @@ def test_aggregate_no_size(library: str) -> None:
"b_std": ns.Float64,
"b_var": ns.Float64,
}
compare_dataframe_with_reference(result, expected, dtype=expected_dtype)
compare_dataframe_with_reference(result, expected, dtype=expected_dtype) # type: ignore[arg-type]
2 changes: 1 addition & 1 deletion tests/groupby/groupby_any_all_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_groupby_boolean(
result = result.cast({"key": ns.Int64()})
expected = {"key": [1, 2], "b": expected_b, "c": expected_c}
expected_dtype = {"key": ns.Int64, "b": ns.Bool, "c": ns.Bool}
compare_dataframe_with_reference(result, expected, dtype=expected_dtype)
compare_dataframe_with_reference(result, expected, dtype=expected_dtype) # type: ignore[arg-type]


def test_group_by_invalid_any_all(library: str) -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/groupby/numeric_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ def test_group_by_numeric(
): # pragma: no cover
# upstream bug
result = result.cast({"key": ns.Int64()})
compare_dataframe_with_reference(result, expected, dtype=expected_ns_dtype)
compare_dataframe_with_reference(result, expected, dtype=expected_ns_dtype) # type: ignore[arg-type]
2 changes: 1 addition & 1 deletion tests/integration/persistedness_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def test_cross_df_propagation(library: str) -> None:
"b": ns.Int64,
"c": ns.Int64 if library in ["pandas-nullable", "polars-lazy"] else ns.Float64,
}
compare_dataframe_with_reference(result, expected, dtype=expected_dtype)
compare_dataframe_with_reference(result, expected, dtype=expected_dtype) # type: ignore[arg-type]


def test_multiple_propagations(library: str) -> None:
Expand Down

0 comments on commit 0a4ad77

Please sign in to comment.