Skip to content

Commit 42c73d5

Browse files
rokpaddyroddy
andcommitted
GH-11: [Python] Fix no-matching-overload error (#34)
* Add py.typed file to signify that the library is typed See the relevant PEP https://peps.python.org/pep-0561 * Prepare `pyarrow-stubs` for history merging MINOR: [Python] Prepare `pyarrow-stubs` for history merging Co-authored-by: ZhengYu, Xu <zen-xu@outlook.com> * Add `ty` configuration and suppress error codes * One line per rule * Add licence header from original repo for all `.pyi` files * Revert "Add licence header from original repo for all `.pyi` files" This reverts commit 1631f39. * Prepare for licence merging * Exclude `stubs` from `rat` test * Add Apache licence clause to `py.typed` * Reduce list * Add `ty` as a step in the action * Run in the correct directory * Remove `check` from `pip` * Fix `unresolved-reference` error * Revert "Fix `unresolved-reference` error" This reverts commit 7ee3d2f. * Fix no-matching-overload --------- Co-authored-by: Patrick J. Roddy <patrickjamesroddy@gmail.com>
1 parent 8298c76 commit 42c73d5

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

python/pyarrow/tests/test_array.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,8 @@ def test_arange():
550550
for case in cases:
551551
result = pa.arange(*case)
552552
result.validate(full=True)
553-
assert result.equals(pa.array(list(range(*case)), type=pa.int64()))
553+
554+
assert result.equals(pa.array(list(range(*case)), type=pa.int64())) # type: ignore[no-matching-overload]
554555

555556
# Validate memory_pool keyword argument
556557
result = pa.arange(-1, 101, memory_pool=pa.default_memory_pool())

python/pyarrow/tests/test_compute.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,10 +1737,10 @@ def test_arithmetic_multiply():
17371737
@pytest.mark.parametrize("ty", ["round", "round_to_multiple"])
17381738
def test_round_to_integer(ty):
17391739
if ty == "round":
1740-
round = pc.round
1740+
round_func = pc.round
17411741
RoundOptions = partial(pc.RoundOptions, ndigits=0)
17421742
elif ty == "round_to_multiple":
1743-
round = pc.round_to_multiple
1743+
round_func = pc.round_to_multiple
17441744
RoundOptions = partial(pc.RoundToMultipleOptions, multiple=1)
17451745

17461746
values = [3.2, 3.5, 3.7, 4.5, -3.2, -3.5, -3.7, None]
@@ -1758,7 +1758,7 @@ def test_round_to_integer(ty):
17581758
}
17591759
for round_mode, expected in rmode_and_expected.items():
17601760
options = RoundOptions(round_mode=round_mode)
1761-
result = round(values, options=options)
1761+
result = round_func(values, options=options)
17621762
expected_array = pa.array(expected, type=pa.float64())
17631763
assert expected_array.equals(result)
17641764

0 commit comments

Comments
 (0)