mrocklin: @crusaderky do you think that this is ready to merge?  
crusaderky: @mrocklin yes, I was just waiting for CI to give green light 
diff --git a/dask/array/chunk.py b/dask/array/chunk.py
index 498edfdf7..a36a4de7f 100644
--- a/dask/array/chunk.py
+++ b/dask/array/chunk.py
@@ -9,6 +9,7 @@ import numpy as np
 from . import numpy_compat as npcompat
 
 from ..compatibility import getargspec
+from ..core import flatten
 from ..utils import ignoring
 
 try:
@@ -233,6 +234,7 @@ def argtopk(a_plus_idx, k, axis, keepdims):
     axis = axis[0]
 
     if isinstance(a_plus_idx, list):
+        a_plus_idx = list(flatten(a_plus_idx))
         a = np.concatenate([ai for ai, _ in a_plus_idx], axis)
         idx = np.concatenate([broadcast_to(idxi, ai.shape)
                               for ai, idxi in a_plus_idx], axis)

Regression in 0.18.2: argtopk(split_every=2) broken
```
import dask.array as da 
a = da.from_array([[1, 4, 2, 5, 3], 
                   [7, 1, 8, 0, 2]], chunks=1) 
a.argtopk(-3, split_every=2).compute()


AttributeError: 'tuple' object has no attribute 'shape'
```

I'm still in the middle of investigating how it happened and, most importantly, why the regression tests didn't spot it.
diff --git a/dask/array/tests/test_reductions.py b/dask/array/tests/test_reductions.py
index c0e642847..83db8b57b 100644
--- a/dask/array/tests/test_reductions.py
+++ b/dask/array/tests/test_reductions.py
@@ -460,7 +460,26 @@ def test_topk_argtopk1(npfunc, daskfunc, split_every):
         daskfunc(b, -k, axis=3, split_every=split_every)
 
 
-def test_topk_argtopk2():
+@pytest.mark.parametrize('npfunc,daskfunc', [
+    (np.sort, da.topk),
+    (np.argsort, da.argtopk),
+])
+@pytest.mark.parametrize('split_every', [None, 2, 3, 4])
+@pytest.mark.parametrize('chunksize', [1, 2, 3, 4, 5, 10])
+def test_topk_argtopk2(npfunc, daskfunc, split_every, chunksize):
+    """Fine test use cases when k is larger than chunk size"""
+    a = da.random.random((10, ), chunks=chunksize)
+    k = 5
+
+    # top 5 elements, sorted descending
+    assert_eq(npfunc(a)[-k:][::-1],
+              daskfunc(a, k, split_every=split_every))
+    # bottom 5 elements, sorted ascending
+    assert_eq(npfunc(a)[:k],
+              daskfunc(a, -k, split_every=split_every))
+
+
+def test_topk_argtopk3():
     a = da.random.random((10, 20, 30), chunks=(4, 8, 8))
 
     # Support for deprecated API for topk
@@ -468,5 +487,7 @@ def test_topk_argtopk2():
         assert_eq(da.topk(a, 5), da.topk(5, a))
 
     # As Array methods
-    assert_eq(a.topk(5, axis=1, split_every=2), da.topk(a, 5, axis=1, split_every=2))
-    assert_eq(a.argtopk(5, axis=1, split_every=2), da.argtopk(a, 5, axis=1, split_every=2))
+    assert_eq(a.topk(5, axis=1, split_every=2),
+              da.topk(a, 5, axis=1, split_every=2))
+    assert_eq(a.argtopk(5, axis=1, split_every=2),
+              da.argtopk(a, 5, axis=1, split_every=2))

pip install -e .[complete]
parse_log_pytest
pytest
pytest pytest-xdist
3.6
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work
certifi==2021.5.30
click==8.0.4
cloudpickle==2.2.1
-e git+https://github.com/dask/dask.git@3dddd1148d1050ea7eca16a9c6dd2bc187adb02a#egg=dask
distributed==1.28.1
execnet==1.9.0
HeapDict==1.0.1
importlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
locket==1.0.0
more-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work
msgpack==1.0.5
numpy==1.19.5
packaging @ file:///tmp/build/80754af9/packaging_1637314298585/work
pandas==1.1.5
partd==1.2.0
pluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work
psutil==7.0.0
py @ file:///opt/conda/conda-bld/py_1644396412707/work
pyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work
pytest==6.2.4
pytest-xdist==3.0.2
python-dateutil==2.9.0.post0
pytz==2025.2
PyYAML==6.0.1
six==1.17.0
sortedcontainers==2.4.0
tblib==1.7.0
toml @ file:///tmp/build/80754af9/toml_1616166611790/work
toolz==0.12.0
tornado==6.1
typing_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work
zict==2.1.0
zipp @ file:///tmp/build/80754af9/zipp_1633618647012/work

name: dask
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=21.4.0=pyhd3eb1b0_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - importlib-metadata=4.8.1=py36h06a4308_0
  - importlib_metadata=4.8.1=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - more-itertools=8.12.0=pyhd3eb1b0_0
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=21.3=pyhd3eb1b0_0
  - pip=21.2.2=py36h06a4308_0
  - pluggy=0.13.1=py36h06a4308_0
  - py=1.11.0=pyhd3eb1b0_0
  - pyparsing=3.0.4=pyhd3eb1b0_0
  - pytest=6.2.4=py36h06a4308_2
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - toml=0.10.2=pyhd3eb1b0_0
  - typing_extensions=4.1.1=pyh06a4308_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.6.0=pyhd3eb1b0_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - click==8.0.4
      - cloudpickle==2.2.1
      - distributed==1.28.1
      - execnet==1.9.0
      - heapdict==1.0.1
      - locket==1.0.0
      - msgpack==1.0.5
      - numpy==1.19.5
      - pandas==1.1.5
      - partd==1.2.0
      - psutil==7.0.0
      - pytest-xdist==3.0.2
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - pyyaml==6.0.1
      - six==1.17.0
      - sortedcontainers==2.4.0
      - tblib==1.7.0
      - toolz==0.12.0
      - tornado==6.1
      - zict==2.1.0
prefix: /opt/conda/envs/dask

dask/array/tests/test_reductions.py::test_topk_argtopk2[1-None-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[1-2-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[1-3-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[1-4-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[2-2-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[2-3-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[3-2-argsort-argtopk]
dask/array/tests/test_reductions.py::test_nan_object[nansum] dask/array/tests/test_reductions.py::test_nan_object[sum] dask/array/tests/test_reductions.py::test_nan_object[nanmin] dask/array/tests/test_reductions.py::test_nan_object[min] dask/array/tests/test_reductions.py::test_nan_object[nanmax] dask/array/tests/test_reductions.py::test_nan_object[max]
dask/array/tests/test_reductions.py::test_reductions_1D[f4] dask/array/tests/test_reductions.py::test_reductions_1D[i4] dask/array/tests/test_reductions.py::test_reduction_errors dask/array/tests/test_reductions.py::test_arg_reductions[argmin-argmin] dask/array/tests/test_reductions.py::test_arg_reductions[argmax-argmax] dask/array/tests/test_reductions.py::test_arg_reductions[_nanargmin-nanargmin] dask/array/tests/test_reductions.py::test_arg_reductions[_nanargmax-nanargmax] dask/array/tests/test_reductions.py::test_nanarg_reductions[_nanargmin-nanargmin] dask/array/tests/test_reductions.py::test_nanarg_reductions[_nanargmax-nanargmax] dask/array/tests/test_reductions.py::test_reductions_2D_nans dask/array/tests/test_reductions.py::test_moment dask/array/tests/test_reductions.py::test_reductions_with_negative_axes dask/array/tests/test_reductions.py::test_nan dask/array/tests/test_reductions.py::test_0d_array dask/array/tests/test_reductions.py::test_reduction_on_scalar dask/array/tests/test_reductions.py::test_reductions_with_empty_array dask/array/tests/test_reductions.py::test_tree_reduce_depth dask/array/tests/test_reductions.py::test_tree_reduce_set_options dask/array/tests/test_reductions.py::test_reduction_names dask/array/tests/test_reductions.py::test_array_reduction_out[sum] dask/array/tests/test_reductions.py::test_array_reduction_out[argmax] dask/array/tests/test_reductions.py::test_array_cumreduction_axis[None-cumsum] dask/array/tests/test_reductions.py::test_array_cumreduction_axis[None-cumprod] dask/array/tests/test_reductions.py::test_array_cumreduction_axis[0-cumsum] dask/array/tests/test_reductions.py::test_array_cumreduction_axis[0-cumprod] dask/array/tests/test_reductions.py::test_array_cumreduction_axis[1-cumsum] dask/array/tests/test_reductions.py::test_array_cumreduction_axis[1-cumprod] dask/array/tests/test_reductions.py::test_array_cumreduction_axis[-1-cumsum] dask/array/tests/test_reductions.py::test_array_cumreduction_axis[-1-cumprod] dask/array/tests/test_reductions.py::test_array_cumreduction_out[cumsum] dask/array/tests/test_reductions.py::test_array_cumreduction_out[cumprod] dask/array/tests/test_reductions.py::test_topk_argtopk1[None-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk1[None-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk1[2-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk1[2-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk1[4-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk1[4-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk1[8-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk1[8-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[1-None-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[1-2-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[1-3-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[1-4-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[2-None-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[2-None-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[2-2-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[2-3-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[2-4-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[2-4-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[3-None-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[3-None-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[3-2-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[3-3-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[3-3-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[3-4-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[3-4-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[4-None-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[4-None-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[4-2-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[4-2-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[4-3-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[4-3-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[4-4-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[4-4-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[5-None-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[5-None-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[5-2-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[5-2-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[5-3-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[5-3-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[5-4-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[5-4-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[10-None-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[10-None-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[10-2-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[10-2-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[10-3-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[10-3-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk2[10-4-sort-topk] dask/array/tests/test_reductions.py::test_topk_argtopk2[10-4-argsort-argtopk] dask/array/tests/test_reductions.py::test_topk_argtopk3
dask/array/chunk.py
dask/array/chunk.py