Skip to content

numpy 2.0.0 converted some DeprecationWarnings to Errors, breaking some non-sensical test cases in Python #5620

@jmao-denver

Description

@jmao-denver

In Nightly CI

======================================================================
ERROR [0.313s]: test_agg_with_options (test_table.TableTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/project/tests/test_table.py", line 335, in test_agg_with_options
    aggs = [unique(cols=["ua = a", "ub = b"], include_nulls=True, non_unique_sentinel=np.uint32(-1))]
OverflowError: Python integer -1 out of bounds for uint32

In numpy 1.2x

>>> np.uint32(-1)
<stdin>:1: DeprecationWarning: NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays.  The conversion of -1 to uint32 will fail in the future.
For the old behavior, usually:
    np.array(value).astype(dtype)`
will give the desired result (the cast overflows).

in numpy 2.0 (Py 3.9 +)

OverflowError: Python integer -1 out of bounds for uint32

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreCore development taskspython

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions