Skip to content

Pin the int64 dtype of the numpy array literal test case - #696

Merged
evertlammerts merged 1 commit into
duckdb:v2.0-cyanopterafrom
evertlammerts:fix-numpy-array-literal-dtype
Oct 19, 2026
Merged

evertlammerts merged 1 commit into
duckdb:v2.0-cyanopterafrom
evertlammerts:fix-numpy-array-literal-dtype

Conversation

@evertlammerts

Copy link
Copy Markdown
Member

The Wheel: cp311-win_amd64 release job has failed since #686 landed:

test_numpy_array_literals[array3-ARRAY(5L, -3L)-array(5, -3)-element_type3-value3]
AssertionError: assert ArrayType(IntegerType(), True) == ArrayType(LongType(), True)

The cp311 test group pins numpy<2 for tensorflow, and numpy 1.x on Windows uses
int32 as the default integer type (the C long). np.array([5, -3]) is therefore an
int32 array there, and lit types it as ARRAY<INT>, which is what Spark does for an
int32 array as well. The test expected ARRAY<BIGINT>, assuming a 64 bit default.

The case now spells dtype=np.int64, so it checks the int64 mapping on every platform.
The int32 mapping is already covered by the neighbouring np.array([5], dtype=np.int32)
case.

@evertlammerts
evertlammerts added this pull request to the merge queue Oct 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 19, 2026
@evertlammerts
evertlammerts merged commit 0f7f6c1 into duckdb:v2.0-cyanoptera Oct 19, 2026
30 checks passed
evertlammerts added a commit that referenced this pull request Oct 20, 2026
Fixes the cp311 Windows wheel job of the Release workflow, which fails
every run since #700 in
`test_a_dictionary_is_decoded_once_per_large_batch` before any DuckDB
code runs:

    pyarrow.lib.ArrowIndexError: Index -1074 out of bounds

The test builds its dictionary indices as `np.arange(2_000_000) *
1_000_000 // 2_000_000`. On Windows with numpy below 2, `np.arange`
defaults to int32 (the C `long`), so the product overflows and about
half the indices come out negative. The cp311 job is the only Windows
job that installs numpy below 2 (the tensorflow pin), which is why
neither the PR workflow nor the other wheel jobs saw it. An int32
simulation gives the same minimum of -1074.

The arange now carries `dtype=np.int64`. Same class as #696; the other
`np.arange` calls in the tests are small, float, or typed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant