Skip to content

Comments

BUG: torch: expand_dims axis is keyword or positional argument#375

Merged
ev-br merged 3 commits intodata-apis:mainfrom
ev-br:searchsorted_skip_dask
Feb 24, 2026
Merged

BUG: torch: expand_dims axis is keyword or positional argument#375
ev-br merged 3 commits intodata-apis:mainfrom
ev-br:searchsorted_skip_dask

Conversation

@ev-br
Copy link
Member

@ev-br ev-br commented Jan 8, 2026

Also add several skips to make the CI green:

  • dask searchsorted scalars
  • dask expand_dims tuple axes
  • numpy < 2 isin scalars

Dask does not allow scalars as arguments to searchsorted:

$ ARRAY_API_TESTS_MODULE=array_api_compat.dask.array pytest array_api_tests/test_searching_functions.py::test_searchsorted_with_scalars --max-examples 500

...

    @given(data=st.data())
>   def test_searchsorted_with_scalars(data):
                   ^^^
...

        # call np.searchsorted for each pair of blocks in a and v
>       meta = np.searchsorted(a._meta, v._meta)
                                        ^^^^^^^
E       AttributeError: 'int' object has no attribute '_meta'
E
E       ========== FAILING CODE SNIPPET:
E       xp.searchsorted(dask.array<sort, shape=(1,), dtype=uint8, chunksize=(1,), chunktype=numpy.ndarray>, 0, sorter=None, **kw) with kw = {}
E       ====================

Just add an xfail for now.

cross-ref data-apis/array-api-tests#394

Copilot AI review requested due to automatic review settings January 8, 2026 21:00
@ev-br ev-br marked this pull request as draft January 8, 2026 21:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an xfail entry for the test_searchsorted_with_scalars test in dask, which fails because dask does not support scalar arguments to searchsorted. The test will be skipped until proper support is implemented or the issue is resolved.

  • Adds xfail for test_searchsorted_with_scalars under a new "2025.12 support" section

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ev-br ev-br added this to the 1.14 milestone Jan 8, 2026
@ev-br ev-br marked this pull request as ready for review February 23, 2026 14:58
@ev-br ev-br closed this Feb 24, 2026
@ev-br ev-br reopened this Feb 24, 2026
Dask does not allow scalars as arguments to searchsorted:

$ ARRAY_API_TESTS_MODULE=array_api_compat.dask.array pytest array_api_tests/test_searching_functions.py::test_searchsorted_with_scalars --max-examples 500

...

    @given(data=st.data())
>   def test_searchsorted_with_scalars(data):
                   ^^^
...

        # call np.searchsorted for each pair of blocks in a and v
>       meta = np.searchsorted(a._meta, v._meta)
                                        ^^^^^^^
E       AttributeError: 'int' object has no attribute '_meta'
E
E       ========== FAILING CODE SNIPPET:
E       xp.searchsorted(dask.array<sort, shape=(1,), dtype=uint8, chunksize=(1,), chunktype=numpy.ndarray>, 0, sorter=None, **kw) with kw = {}
E       ====================
@ev-br ev-br force-pushed the searchsorted_skip_dask branch from 4d9e3ac to 3ececee Compare February 24, 2026 11:51
@ev-br ev-br changed the title TST: dask: xfail searchorted_scalars test on dask BUG: torch: expand_dims axis is keyword or positional argument Feb 24, 2026
@ev-br ev-br merged commit b52cb84 into data-apis:main Feb 24, 2026
28 checks passed
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