Skip to content

feat: DataFrame API for custom obs and var#2328

Draft
ilan-gold wants to merge 12 commits intomainfrom
ig/dataframe_api
Draft

feat: DataFrame API for custom obs and var#2328
ilan-gold wants to merge 12 commits intomainfrom
ig/dataframe_api

Conversation

@ilan-gold
Copy link
Copy Markdown
Contributor

@ilan-gold ilan-gold commented Feb 4, 2026

cc @srivarra @Intron7

possible TODOs:

  • concat and merge API (or disallow and keep pandas/xarray special-cased, would require equal implementation as well)
  • adopt __dataframe__ protocol in a meaningful way ideally for writing, but potentially as a solution to the above to cases (i.e., drop into pandas and leave the data there): https://data-apis.org/dataframe-protocol/latest/
  • device-specific handling/indexing (see feat: support array-api #2071 ) for handling cuDF or GPU-based polars
  • Remove _gen_dataframe special casing
  • Determine if we need a to_numpy method

This PR is somewhat self-testing because I will have in theory removed all references to both pandas.Dataframe and XDataset/Dataset2D everywhere except concatenation internally.

One downside of this approach is that it puts us somewhat on the hook for pandas.DataFrame API but the flipside is that if we choose to switch to another library, we could do that relatively cleanly now/more easily

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 4, 2026

❌ 26 Tests Failed:

Tests completed Failed Passed Skipped
5950 26 5924 1093
View the top 3 failed test(s) by shortest run time
tests.lazy.test_write::test_write_error[obs-csvs]
Stack Traces | 0.021s run time
tmp_path = PosixPath('.../pytest-0/popen-gw1/test_write_error_obs_csvs_0')
fmt = 'csvs', key = 'obs'

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mfmt#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [#x1B[33m"#x1B[39;49;00m#x1B[33mzarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mh5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcsvs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    #x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mkey#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [#x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvar#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mobsm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvarm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_write_error#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        tmp_path: Path,#x1B[90m#x1B[39;49;00m
        fmt: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mzarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mh5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcsvs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        key: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvar#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mobsm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvarm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        path = tmp_path / #x1B[33m"#x1B[39;49;00m#x1B[33madata.h5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        X = np.random.random((#x1B[94m4#x1B[39;49;00m, #x1B[94m4#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
        adata = AnnData(X=X)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m key.endswith(#x1B[33m"#x1B[39;49;00m#x1B[33mm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
            elem = {#x1B[33m"#x1B[39;49;00m#x1B[33mdf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[96mgetattr#x1B[39;49;00m(adata, key[:-#x1B[94m1#x1B[39;49;00m])}#x1B[90m#x1B[39;49;00m
            #x1B[96msetattr#x1B[39;49;00m(adata, key, elem)#x1B[90m#x1B[39;49;00m
        adata.write_h5ad(path)#x1B[90m#x1B[39;49;00m
>       adata_lazy = read_lazy(path)#x1B[90m#x1B[39;49;00m
                     ^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/lazy/test_write.py#x1B[0m:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[.../anndata/_core/xarray.py#x1B[0m:37: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*args, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../experimental/backed/_io.py#x1B[0m:163: in read_lazy
    #x1B[0madata: AnnData = read_dispatched(f, callback=callback)#x1B[90m#x1B[39;49;00m
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/experimental/_dispatch_io.py#x1B[0m:39: in read_dispatched
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m reader.read_elem(elem)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_io/utils.py#x1B[0m:234: in func_wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*args, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../_io/specs/registry.py#x1B[0m:284: in read_elem
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.callback(read_func, elem.name, elem, iospec=iospec)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../experimental/backed/_io.py#x1B[0m:135: in callback
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m AnnData(**{k: read_dispatched(v, callback) #x1B[94mfor#x1B[39;49;00m k, v #x1B[95min#x1B[39;49;00m iter_object})#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:256: in __init__
    #x1B[0m#x1B[96mself#x1B[39;49;00m._init_as_actual(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:451: in _init_as_actual
    #x1B[0m#x1B[96mself#x1B[39;49;00m._obs = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:96: in _gen_dataframe_df
    #x1B[0manno.columns = pandas_as_str(anno.columns)#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/xarray.py#x1B[0m:288: in columns
    #x1B[0mwarn(#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

msg = 'Renaming or reordering columns on `Dataset2D` has no effect because the underlying data structure has no apparent ordering on its keys'
category = <class 'UserWarning'>, source = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mwarn#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        msg: #x1B[96mstr#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        category: #x1B[96mtype#x1B[39;49;00m[#x1B[96mWarning#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        source: Any = #x1B[94mNone#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        *,#x1B[90m#x1B[39;49;00m
        skip_file_prefixes: #x1B[96mtuple#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, ...] = (),#x1B[90m#x1B[39;49;00m
        more_file_prefixes: #x1B[96mtuple#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, ...] = (),#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m skip_file_prefixes:#x1B[90m#x1B[39;49;00m
            skip_file_prefixes = (*_FILE_PREFIXES, *more_file_prefixes)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m more_file_prefixes:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33m"#x1B[39;49;00m#x1B[33mCannot specify both `skip_file_prefixes` and `more_file_prefixes`#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(msg)#x1B[90m#x1B[39;49;00m
>       warnings.warn(msg, category, source=source, skip_file_prefixes=skip_file_prefixes)  #x1B[90m# noqa: TID251#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       UserWarning: Renaming or reordering columns on `Dataset2D` has no effect because the underlying data structure has no apparent ordering on its keys#x1B[0m
#x1B[1m#x1B[31mE       Error raised while reading key '' of <class 'h5py._hl.files.File'> from /#x1B[0m

#x1B[1m#x1B[31msrc/anndata/_warnings.py#x1B[0m:65: UserWarning
tests.lazy.test_write::test_write_error[var-h5ad]
Stack Traces | 0.022s run time
tmp_path = PosixPath('.../pytest-0/popen-gw1/test_write_error_var_h5ad_0')
fmt = 'h5ad', key = 'var'

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mfmt#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [#x1B[33m"#x1B[39;49;00m#x1B[33mzarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mh5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcsvs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    #x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mkey#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [#x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvar#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mobsm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvarm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_write_error#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        tmp_path: Path,#x1B[90m#x1B[39;49;00m
        fmt: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mzarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mh5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcsvs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        key: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvar#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mobsm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvarm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        path = tmp_path / #x1B[33m"#x1B[39;49;00m#x1B[33madata.h5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        X = np.random.random((#x1B[94m4#x1B[39;49;00m, #x1B[94m4#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
        adata = AnnData(X=X)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m key.endswith(#x1B[33m"#x1B[39;49;00m#x1B[33mm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
            elem = {#x1B[33m"#x1B[39;49;00m#x1B[33mdf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[96mgetattr#x1B[39;49;00m(adata, key[:-#x1B[94m1#x1B[39;49;00m])}#x1B[90m#x1B[39;49;00m
            #x1B[96msetattr#x1B[39;49;00m(adata, key, elem)#x1B[90m#x1B[39;49;00m
        adata.write_h5ad(path)#x1B[90m#x1B[39;49;00m
>       adata_lazy = read_lazy(path)#x1B[90m#x1B[39;49;00m
                     ^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/lazy/test_write.py#x1B[0m:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[.../anndata/_core/xarray.py#x1B[0m:37: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*args, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../experimental/backed/_io.py#x1B[0m:163: in read_lazy
    #x1B[0madata: AnnData = read_dispatched(f, callback=callback)#x1B[90m#x1B[39;49;00m
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/experimental/_dispatch_io.py#x1B[0m:39: in read_dispatched
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m reader.read_elem(elem)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_io/utils.py#x1B[0m:234: in func_wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*args, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../_io/specs/registry.py#x1B[0m:284: in read_elem
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.callback(read_func, elem.name, elem, iospec=iospec)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../experimental/backed/_io.py#x1B[0m:135: in callback
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m AnnData(**{k: read_dispatched(v, callback) #x1B[94mfor#x1B[39;49;00m k, v #x1B[95min#x1B[39;49;00m iter_object})#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:256: in __init__
    #x1B[0m#x1B[96mself#x1B[39;49;00m._init_as_actual(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:451: in _init_as_actual
    #x1B[0m#x1B[96mself#x1B[39;49;00m._obs = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:96: in _gen_dataframe_df
    #x1B[0manno.columns = pandas_as_str(anno.columns)#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/xarray.py#x1B[0m:288: in columns
    #x1B[0mwarn(#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

msg = 'Renaming or reordering columns on `Dataset2D` has no effect because the underlying data structure has no apparent ordering on its keys'
category = <class 'UserWarning'>, source = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mwarn#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        msg: #x1B[96mstr#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        category: #x1B[96mtype#x1B[39;49;00m[#x1B[96mWarning#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        source: Any = #x1B[94mNone#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        *,#x1B[90m#x1B[39;49;00m
        skip_file_prefixes: #x1B[96mtuple#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, ...] = (),#x1B[90m#x1B[39;49;00m
        more_file_prefixes: #x1B[96mtuple#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, ...] = (),#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m skip_file_prefixes:#x1B[90m#x1B[39;49;00m
            skip_file_prefixes = (*_FILE_PREFIXES, *more_file_prefixes)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m more_file_prefixes:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33m"#x1B[39;49;00m#x1B[33mCannot specify both `skip_file_prefixes` and `more_file_prefixes`#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(msg)#x1B[90m#x1B[39;49;00m
>       warnings.warn(msg, category, source=source, skip_file_prefixes=skip_file_prefixes)  #x1B[90m# noqa: TID251#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       UserWarning: Renaming or reordering columns on `Dataset2D` has no effect because the underlying data structure has no apparent ordering on its keys#x1B[0m
#x1B[1m#x1B[31mE       Error raised while reading key '' of <class 'h5py._hl.files.File'> from /#x1B[0m

#x1B[1m#x1B[31msrc/anndata/_warnings.py#x1B[0m:65: UserWarning
tests.lazy.test_write::test_write_error[obs-h5ad]
Stack Traces | 0.025s run time
tmp_path = PosixPath('.../pytest-0/popen-gw1/test_write_error_obs_h5ad_0')
fmt = 'h5ad', key = 'obs'

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mfmt#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [#x1B[33m"#x1B[39;49;00m#x1B[33mzarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mh5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcsvs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    #x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mkey#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [#x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvar#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mobsm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvarm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_write_error#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        tmp_path: Path,#x1B[90m#x1B[39;49;00m
        fmt: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mzarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mh5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcsvs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        key: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvar#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mobsm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvarm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        path = tmp_path / #x1B[33m"#x1B[39;49;00m#x1B[33madata.h5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        X = np.random.random((#x1B[94m4#x1B[39;49;00m, #x1B[94m4#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
        adata = AnnData(X=X)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m key.endswith(#x1B[33m"#x1B[39;49;00m#x1B[33mm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
            elem = {#x1B[33m"#x1B[39;49;00m#x1B[33mdf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[96mgetattr#x1B[39;49;00m(adata, key[:-#x1B[94m1#x1B[39;49;00m])}#x1B[90m#x1B[39;49;00m
            #x1B[96msetattr#x1B[39;49;00m(adata, key, elem)#x1B[90m#x1B[39;49;00m
        adata.write_h5ad(path)#x1B[90m#x1B[39;49;00m
>       adata_lazy = read_lazy(path)#x1B[90m#x1B[39;49;00m
                     ^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/lazy/test_write.py#x1B[0m:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[.../anndata/_core/xarray.py#x1B[0m:37: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*args, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../experimental/backed/_io.py#x1B[0m:163: in read_lazy
    #x1B[0madata: AnnData = read_dispatched(f, callback=callback)#x1B[90m#x1B[39;49;00m
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/experimental/_dispatch_io.py#x1B[0m:39: in read_dispatched
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m reader.read_elem(elem)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_io/utils.py#x1B[0m:234: in func_wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*args, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../_io/specs/registry.py#x1B[0m:284: in read_elem
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.callback(read_func, elem.name, elem, iospec=iospec)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../experimental/backed/_io.py#x1B[0m:135: in callback
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m AnnData(**{k: read_dispatched(v, callback) #x1B[94mfor#x1B[39;49;00m k, v #x1B[95min#x1B[39;49;00m iter_object})#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:256: in __init__
    #x1B[0m#x1B[96mself#x1B[39;49;00m._init_as_actual(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:451: in _init_as_actual
    #x1B[0m#x1B[96mself#x1B[39;49;00m._obs = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:96: in _gen_dataframe_df
    #x1B[0manno.columns = pandas_as_str(anno.columns)#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/xarray.py#x1B[0m:288: in columns
    #x1B[0mwarn(#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

msg = 'Renaming or reordering columns on `Dataset2D` has no effect because the underlying data structure has no apparent ordering on its keys'
category = <class 'UserWarning'>, source = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mwarn#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        msg: #x1B[96mstr#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        category: #x1B[96mtype#x1B[39;49;00m[#x1B[96mWarning#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        source: Any = #x1B[94mNone#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        *,#x1B[90m#x1B[39;49;00m
        skip_file_prefixes: #x1B[96mtuple#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, ...] = (),#x1B[90m#x1B[39;49;00m
        more_file_prefixes: #x1B[96mtuple#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, ...] = (),#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m skip_file_prefixes:#x1B[90m#x1B[39;49;00m
            skip_file_prefixes = (*_FILE_PREFIXES, *more_file_prefixes)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m more_file_prefixes:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33m"#x1B[39;49;00m#x1B[33mCannot specify both `skip_file_prefixes` and `more_file_prefixes`#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(msg)#x1B[90m#x1B[39;49;00m
>       warnings.warn(msg, category, source=source, skip_file_prefixes=skip_file_prefixes)  #x1B[90m# noqa: TID251#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       UserWarning: Renaming or reordering columns on `Dataset2D` has no effect because the underlying data structure has no apparent ordering on its keys#x1B[0m
#x1B[1m#x1B[31mE       Error raised while reading key '' of <class 'h5py._hl.files.File'> from /#x1B[0m

#x1B[1m#x1B[31msrc/anndata/_warnings.py#x1B[0m:65: UserWarning
tests.lazy.test_write::test_write_error[var-csvs]
Stack Traces | 0.025s run time
tmp_path = PosixPath('.../pytest-0/popen-gw1/test_write_error_var_csvs_0')
fmt = 'csvs', key = 'var'

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mfmt#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [#x1B[33m"#x1B[39;49;00m#x1B[33mzarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mh5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcsvs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    #x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mkey#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [#x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvar#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mobsm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvarm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_write_error#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        tmp_path: Path,#x1B[90m#x1B[39;49;00m
        fmt: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mzarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mh5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcsvs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        key: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvar#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mobsm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvarm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        path = tmp_path / #x1B[33m"#x1B[39;49;00m#x1B[33madata.h5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        X = np.random.random((#x1B[94m4#x1B[39;49;00m, #x1B[94m4#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
        adata = AnnData(X=X)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m key.endswith(#x1B[33m"#x1B[39;49;00m#x1B[33mm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
            elem = {#x1B[33m"#x1B[39;49;00m#x1B[33mdf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[96mgetattr#x1B[39;49;00m(adata, key[:-#x1B[94m1#x1B[39;49;00m])}#x1B[90m#x1B[39;49;00m
            #x1B[96msetattr#x1B[39;49;00m(adata, key, elem)#x1B[90m#x1B[39;49;00m
        adata.write_h5ad(path)#x1B[90m#x1B[39;49;00m
>       adata_lazy = read_lazy(path)#x1B[90m#x1B[39;49;00m
                     ^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/lazy/test_write.py#x1B[0m:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[.../anndata/_core/xarray.py#x1B[0m:37: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*args, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../experimental/backed/_io.py#x1B[0m:163: in read_lazy
    #x1B[0madata: AnnData = read_dispatched(f, callback=callback)#x1B[90m#x1B[39;49;00m
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/experimental/_dispatch_io.py#x1B[0m:39: in read_dispatched
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m reader.read_elem(elem)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_io/utils.py#x1B[0m:234: in func_wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*args, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../_io/specs/registry.py#x1B[0m:284: in read_elem
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.callback(read_func, elem.name, elem, iospec=iospec)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../experimental/backed/_io.py#x1B[0m:135: in callback
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m AnnData(**{k: read_dispatched(v, callback) #x1B[94mfor#x1B[39;49;00m k, v #x1B[95min#x1B[39;49;00m iter_object})#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:256: in __init__
    #x1B[0m#x1B[96mself#x1B[39;49;00m._init_as_actual(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:451: in _init_as_actual
    #x1B[0m#x1B[96mself#x1B[39;49;00m._obs = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:96: in _gen_dataframe_df
    #x1B[0manno.columns = pandas_as_str(anno.columns)#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/xarray.py#x1B[0m:288: in columns
    #x1B[0mwarn(#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

msg = 'Renaming or reordering columns on `Dataset2D` has no effect because the underlying data structure has no apparent ordering on its keys'
category = <class 'UserWarning'>, source = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mwarn#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        msg: #x1B[96mstr#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        category: #x1B[96mtype#x1B[39;49;00m[#x1B[96mWarning#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        source: Any = #x1B[94mNone#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        *,#x1B[90m#x1B[39;49;00m
        skip_file_prefixes: #x1B[96mtuple#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, ...] = (),#x1B[90m#x1B[39;49;00m
        more_file_prefixes: #x1B[96mtuple#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, ...] = (),#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m skip_file_prefixes:#x1B[90m#x1B[39;49;00m
            skip_file_prefixes = (*_FILE_PREFIXES, *more_file_prefixes)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m more_file_prefixes:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33m"#x1B[39;49;00m#x1B[33mCannot specify both `skip_file_prefixes` and `more_file_prefixes`#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(msg)#x1B[90m#x1B[39;49;00m
>       warnings.warn(msg, category, source=source, skip_file_prefixes=skip_file_prefixes)  #x1B[90m# noqa: TID251#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       UserWarning: Renaming or reordering columns on `Dataset2D` has no effect because the underlying data structure has no apparent ordering on its keys#x1B[0m
#x1B[1m#x1B[31mE       Error raised while reading key '' of <class 'h5py._hl.files.File'> from /#x1B[0m

#x1B[1m#x1B[31msrc/anndata/_warnings.py#x1B[0m:65: UserWarning
tests.lazy.test_write::test_write_error[obsm-csvs]
Stack Traces | 0.03s run time
tmp_path = PosixPath('.../pytest-0/popen-gw1/test_write_error_obsm_csvs_0')
fmt = 'csvs', key = 'obsm'

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mfmt#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [#x1B[33m"#x1B[39;49;00m#x1B[33mzarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mh5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcsvs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    #x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mkey#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [#x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvar#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mobsm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvarm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_write_error#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        tmp_path: Path,#x1B[90m#x1B[39;49;00m
        fmt: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mzarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mh5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcsvs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        key: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvar#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mobsm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvarm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        path = tmp_path / #x1B[33m"#x1B[39;49;00m#x1B[33madata.h5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        X = np.random.random((#x1B[94m4#x1B[39;49;00m, #x1B[94m4#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
        adata = AnnData(X=X)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m key.endswith(#x1B[33m"#x1B[39;49;00m#x1B[33mm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
            elem = {#x1B[33m"#x1B[39;49;00m#x1B[33mdf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[96mgetattr#x1B[39;49;00m(adata, key[:-#x1B[94m1#x1B[39;49;00m])}#x1B[90m#x1B[39;49;00m
            #x1B[96msetattr#x1B[39;49;00m(adata, key, elem)#x1B[90m#x1B[39;49;00m
        adata.write_h5ad(path)#x1B[90m#x1B[39;49;00m
>       adata_lazy = read_lazy(path)#x1B[90m#x1B[39;49;00m
                     ^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/lazy/test_write.py#x1B[0m:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[.../anndata/_core/xarray.py#x1B[0m:37: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*args, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../experimental/backed/_io.py#x1B[0m:163: in read_lazy
    #x1B[0madata: AnnData = read_dispatched(f, callback=callback)#x1B[90m#x1B[39;49;00m
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/experimental/_dispatch_io.py#x1B[0m:39: in read_dispatched
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m reader.read_elem(elem)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_io/utils.py#x1B[0m:234: in func_wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*args, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../_io/specs/registry.py#x1B[0m:284: in read_elem
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.callback(read_func, elem.name, elem, iospec=iospec)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../experimental/backed/_io.py#x1B[0m:135: in callback
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m AnnData(**{k: read_dispatched(v, callback) #x1B[94mfor#x1B[39;49;00m k, v #x1B[95min#x1B[39;49;00m iter_object})#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:256: in __init__
    #x1B[0m#x1B[96mself#x1B[39;49;00m._init_as_actual(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:451: in _init_as_actual
    #x1B[0m#x1B[96mself#x1B[39;49;00m._obs = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:96: in _gen_dataframe_df
    #x1B[0manno.columns = pandas_as_str(anno.columns)#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/xarray.py#x1B[0m:288: in columns
    #x1B[0mwarn(#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

msg = 'Renaming or reordering columns on `Dataset2D` has no effect because the underlying data structure has no apparent ordering on its keys'
category = <class 'UserWarning'>, source = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mwarn#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        msg: #x1B[96mstr#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        category: #x1B[96mtype#x1B[39;49;00m[#x1B[96mWarning#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        source: Any = #x1B[94mNone#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        *,#x1B[90m#x1B[39;49;00m
        skip_file_prefixes: #x1B[96mtuple#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, ...] = (),#x1B[90m#x1B[39;49;00m
        more_file_prefixes: #x1B[96mtuple#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, ...] = (),#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m skip_file_prefixes:#x1B[90m#x1B[39;49;00m
            skip_file_prefixes = (*_FILE_PREFIXES, *more_file_prefixes)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m more_file_prefixes:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33m"#x1B[39;49;00m#x1B[33mCannot specify both `skip_file_prefixes` and `more_file_prefixes`#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(msg)#x1B[90m#x1B[39;49;00m
>       warnings.warn(msg, category, source=source, skip_file_prefixes=skip_file_prefixes)  #x1B[90m# noqa: TID251#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       UserWarning: Renaming or reordering columns on `Dataset2D` has no effect because the underlying data structure has no apparent ordering on its keys#x1B[0m
#x1B[1m#x1B[31mE       Error raised while reading key '' of <class 'h5py._hl.files.File'> from /#x1B[0m

#x1B[1m#x1B[31msrc/anndata/_warnings.py#x1B[0m:65: UserWarning
tests.lazy.test_write::test_write_error[varm-h5ad]
Stack Traces | 0.03s run time
tmp_path = PosixPath('.../pytest-0/popen-gw1/test_write_error_varm_h5ad_0')
fmt = 'h5ad', key = 'varm'

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mfmt#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [#x1B[33m"#x1B[39;49;00m#x1B[33mzarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mh5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcsvs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    #x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mkey#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [#x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvar#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mobsm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvarm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_write_error#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        tmp_path: Path,#x1B[90m#x1B[39;49;00m
        fmt: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mzarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mh5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcsvs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        key: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvar#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mobsm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvarm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        path = tmp_path / #x1B[33m"#x1B[39;49;00m#x1B[33madata.h5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        X = np.random.random((#x1B[94m4#x1B[39;49;00m, #x1B[94m4#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
        adata = AnnData(X=X)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m key.endswith(#x1B[33m"#x1B[39;49;00m#x1B[33mm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
            elem = {#x1B[33m"#x1B[39;49;00m#x1B[33mdf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[96mgetattr#x1B[39;49;00m(adata, key[:-#x1B[94m1#x1B[39;49;00m])}#x1B[90m#x1B[39;49;00m
            #x1B[96msetattr#x1B[39;49;00m(adata, key, elem)#x1B[90m#x1B[39;49;00m
        adata.write_h5ad(path)#x1B[90m#x1B[39;49;00m
>       adata_lazy = read_lazy(path)#x1B[90m#x1B[39;49;00m
                     ^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/lazy/test_write.py#x1B[0m:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[.../anndata/_core/xarray.py#x1B[0m:37: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*args, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../experimental/backed/_io.py#x1B[0m:163: in read_lazy
    #x1B[0madata: AnnData = read_dispatched(f, callback=callback)#x1B[90m#x1B[39;49;00m
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/experimental/_dispatch_io.py#x1B[0m:39: in read_dispatched
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m reader.read_elem(elem)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_io/utils.py#x1B[0m:234: in func_wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*args, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../_io/specs/registry.py#x1B[0m:284: in read_elem
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.callback(read_func, elem.name, elem, iospec=iospec)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../experimental/backed/_io.py#x1B[0m:135: in callback
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m AnnData(**{k: read_dispatched(v, callback) #x1B[94mfor#x1B[39;49;00m k, v #x1B[95min#x1B[39;49;00m iter_object})#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:256: in __init__
    #x1B[0m#x1B[96mself#x1B[39;49;00m._init_as_actual(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:451: in _init_as_actual
    #x1B[0m#x1B[96mself#x1B[39;49;00m._obs = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:96: in _gen_dataframe_df
    #x1B[0manno.columns = pandas_as_str(anno.columns)#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/xarray.py#x1B[0m:288: in columns
    #x1B[0mwarn(#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

msg = 'Renaming or reordering columns on `Dataset2D` has no effect because the underlying data structure has no apparent ordering on its keys'
category = <class 'UserWarning'>, source = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mwarn#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        msg: #x1B[96mstr#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        category: #x1B[96mtype#x1B[39;49;00m[#x1B[96mWarning#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        source: Any = #x1B[94mNone#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        *,#x1B[90m#x1B[39;49;00m
        skip_file_prefixes: #x1B[96mtuple#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, ...] = (),#x1B[90m#x1B[39;49;00m
        more_file_prefixes: #x1B[96mtuple#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, ...] = (),#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m skip_file_prefixes:#x1B[90m#x1B[39;49;00m
            skip_file_prefixes = (*_FILE_PREFIXES, *more_file_prefixes)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m more_file_prefixes:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33m"#x1B[39;49;00m#x1B[33mCannot specify both `skip_file_prefixes` and `more_file_prefixes`#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(msg)#x1B[90m#x1B[39;49;00m
>       warnings.warn(msg, category, source=source, skip_file_prefixes=skip_file_prefixes)  #x1B[90m# noqa: TID251#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       UserWarning: Renaming or reordering columns on `Dataset2D` has no effect because the underlying data structure has no apparent ordering on its keys#x1B[0m
#x1B[1m#x1B[31mE       Error raised while reading key '' of <class 'h5py._hl.files.File'> from /#x1B[0m

#x1B[1m#x1B[31msrc/anndata/_warnings.py#x1B[0m:65: UserWarning
tests.lazy.test_write::test_write_error[obsm-h5ad]
Stack Traces | 0.032s run time
tmp_path = PosixPath('.../pytest-0/popen-gw1/test_write_error_obsm_h5ad_0')
fmt = 'h5ad', key = 'obsm'

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mfmt#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [#x1B[33m"#x1B[39;49;00m#x1B[33mzarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mh5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcsvs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    #x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mkey#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [#x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvar#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mobsm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvarm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_write_error#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        tmp_path: Path,#x1B[90m#x1B[39;49;00m
        fmt: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mzarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mh5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcsvs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        key: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvar#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mobsm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvarm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        path = tmp_path / #x1B[33m"#x1B[39;49;00m#x1B[33madata.h5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        X = np.random.random((#x1B[94m4#x1B[39;49;00m, #x1B[94m4#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
        adata = AnnData(X=X)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m key.endswith(#x1B[33m"#x1B[39;49;00m#x1B[33mm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
            elem = {#x1B[33m"#x1B[39;49;00m#x1B[33mdf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[96mgetattr#x1B[39;49;00m(adata, key[:-#x1B[94m1#x1B[39;49;00m])}#x1B[90m#x1B[39;49;00m
            #x1B[96msetattr#x1B[39;49;00m(adata, key, elem)#x1B[90m#x1B[39;49;00m
        adata.write_h5ad(path)#x1B[90m#x1B[39;49;00m
>       adata_lazy = read_lazy(path)#x1B[90m#x1B[39;49;00m
                     ^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/lazy/test_write.py#x1B[0m:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[.../anndata/_core/xarray.py#x1B[0m:37: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*args, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../experimental/backed/_io.py#x1B[0m:163: in read_lazy
    #x1B[0madata: AnnData = read_dispatched(f, callback=callback)#x1B[90m#x1B[39;49;00m
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/experimental/_dispatch_io.py#x1B[0m:39: in read_dispatched
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m reader.read_elem(elem)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_io/utils.py#x1B[0m:234: in func_wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*args, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../_io/specs/registry.py#x1B[0m:284: in read_elem
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.callback(read_func, elem.name, elem, iospec=iospec)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../experimental/backed/_io.py#x1B[0m:135: in callback
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m AnnData(**{k: read_dispatched(v, callback) #x1B[94mfor#x1B[39;49;00m k, v #x1B[95min#x1B[39;49;00m iter_object})#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:256: in __init__
    #x1B[0m#x1B[96mself#x1B[39;49;00m._init_as_actual(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:451: in _init_as_actual
    #x1B[0m#x1B[96mself#x1B[39;49;00m._obs = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:96: in _gen_dataframe_df
    #x1B[0manno.columns = pandas_as_str(anno.columns)#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/xarray.py#x1B[0m:288: in columns
    #x1B[0mwarn(#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

msg = 'Renaming or reordering columns on `Dataset2D` has no effect because the underlying data structure has no apparent ordering on its keys'
category = <class 'UserWarning'>, source = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mwarn#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        msg: #x1B[96mstr#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        category: #x1B[96mtype#x1B[39;49;00m[#x1B[96mWarning#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        source: Any = #x1B[94mNone#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        *,#x1B[90m#x1B[39;49;00m
        skip_file_prefixes: #x1B[96mtuple#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, ...] = (),#x1B[90m#x1B[39;49;00m
        more_file_prefixes: #x1B[96mtuple#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, ...] = (),#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m skip_file_prefixes:#x1B[90m#x1B[39;49;00m
            skip_file_prefixes = (*_FILE_PREFIXES, *more_file_prefixes)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m more_file_prefixes:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33m"#x1B[39;49;00m#x1B[33mCannot specify both `skip_file_prefixes` and `more_file_prefixes`#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(msg)#x1B[90m#x1B[39;49;00m
>       warnings.warn(msg, category, source=source, skip_file_prefixes=skip_file_prefixes)  #x1B[90m# noqa: TID251#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       UserWarning: Renaming or reordering columns on `Dataset2D` has no effect because the underlying data structure has no apparent ordering on its keys#x1B[0m
#x1B[1m#x1B[31mE       Error raised while reading key '' of <class 'h5py._hl.files.File'> from /#x1B[0m

#x1B[1m#x1B[31msrc/anndata/_warnings.py#x1B[0m:65: UserWarning
tests.lazy.test_read::test_nullable_string_index_decoding
Stack Traces | 0.033s run time
tmp_path = PosixPath('.../pytest-0/popen-gw0/test_nullable_string_index_dec0')

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_nullable_string_index_decoding#x1B[39;49;00m(tmp_path: Path):#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Test that nullable string indices are properly decoded from bytes.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    HDF5 stores strings as bytes. When reading nullable-string-array indices,#x1B[39;49;00m
    #x1B[33m    they should be decoded to proper strings, not converted using str() which#x1B[39;49;00m
    #x1B[33m    would produce "b'...'" representations.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Regression test for https://github..../anndata/issues/2271#x1B[39;49;00m
    #x1B[33m    """#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        expected_obs = [#x1B[33m"#x1B[39;49;00m#x1B[33mcell_A#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcell_B#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcell_C#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcell_D#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcell_E#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        expected_var = [#x1B[33m"#x1B[39;49;00m#x1B[33mgene_X#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mgene_Y#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mgene_Z#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        adata = AnnData(#x1B[90m#x1B[39;49;00m
            np.zeros((#x1B[96mlen#x1B[39;49;00m(expected_obs), #x1B[96mlen#x1B[39;49;00m(expected_var))),#x1B[90m#x1B[39;49;00m
            obs=#x1B[96mdict#x1B[39;49;00m(obs_names=expected_obs),#x1B[90m#x1B[39;49;00m
            var=#x1B[96mdict#x1B[39;49;00m(var_names=expected_var),#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        path = tmp_path / #x1B[33m"#x1B[39;49;00m#x1B[33mtest.h5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        adata.write_h5ad(path)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       lazy = read_lazy(path)#x1B[90m#x1B[39;49;00m
               ^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/lazy/test_read.py#x1B[0m:270: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[.../anndata/_core/xarray.py#x1B[0m:37: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*args, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../experimental/backed/_io.py#x1B[0m:163: in read_lazy
    #x1B[0madata: AnnData = read_dispatched(f, callback=callback)#x1B[90m#x1B[39;49;00m
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/experimental/_dispatch_io.py#x1B[0m:39: in read_dispatched
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m reader.read_elem(elem)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_io/utils.py#x1B[0m:234: in func_wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*args, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../_io/specs/registry.py#x1B[0m:284: in read_elem
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.callback(read_func, elem.name, elem, iospec=iospec)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../experimental/backed/_io.py#x1B[0m:135: in callback
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m AnnData(**{k: read_dispatched(v, callback) #x1B[94mfor#x1B[39;49;00m k, v #x1B[95min#x1B[39;49;00m iter_object})#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:256: in __init__
    #x1B[0m#x1B[96mself#x1B[39;49;00m._init_as_actual(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:451: in _init_as_actual
    #x1B[0m#x1B[96mself#x1B[39;49;00m._obs = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:96: in _gen_dataframe_df
    #x1B[0manno.columns = pandas_as_str(anno.columns)#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/xarray.py#x1B[0m:288: in columns
    #x1B[0mwarn(#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

msg = 'Renaming or reordering columns on `Dataset2D` has no effect because the underlying data structure has no apparent ordering on its keys'
category = <class 'UserWarning'>, source = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mwarn#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        msg: #x1B[96mstr#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        category: #x1B[96mtype#x1B[39;49;00m[#x1B[96mWarning#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        source: Any = #x1B[94mNone#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        *,#x1B[90m#x1B[39;49;00m
        skip_file_prefixes: #x1B[96mtuple#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, ...] = (),#x1B[90m#x1B[39;49;00m
        more_file_prefixes: #x1B[96mtuple#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, ...] = (),#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m skip_file_prefixes:#x1B[90m#x1B[39;49;00m
            skip_file_prefixes = (*_FILE_PREFIXES, *more_file_prefixes)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m more_file_prefixes:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33m"#x1B[39;49;00m#x1B[33mCannot specify both `skip_file_prefixes` and `more_file_prefixes`#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(msg)#x1B[90m#x1B[39;49;00m
>       warnings.warn(msg, category, source=source, skip_file_prefixes=skip_file_prefixes)  #x1B[90m# noqa: TID251#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       UserWarning: Renaming or reordering columns on `Dataset2D` has no effect because the underlying data structure has no apparent ordering on its keys#x1B[0m
#x1B[1m#x1B[31mE       Error raised while reading key '' of <class 'h5py._hl.files.File'> from /#x1B[0m

#x1B[1m#x1B[31msrc/anndata/_warnings.py#x1B[0m:65: UserWarning
tests.lazy.test_write::test_write_error[varm-csvs]
Stack Traces | 0.033s run time
tmp_path = PosixPath('.../pytest-0/popen-gw1/test_write_error_varm_csvs_0')
fmt = 'csvs', key = 'varm'

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mfmt#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [#x1B[33m"#x1B[39;49;00m#x1B[33mzarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mh5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcsvs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    #x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mkey#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [#x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvar#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mobsm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvarm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_write_error#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        tmp_path: Path,#x1B[90m#x1B[39;49;00m
        fmt: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mzarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mh5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcsvs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        key: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvar#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mobsm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvarm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        path = tmp_path / #x1B[33m"#x1B[39;49;00m#x1B[33madata.h5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        X = np.random.random((#x1B[94m4#x1B[39;49;00m, #x1B[94m4#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
        adata = AnnData(X=X)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m key.endswith(#x1B[33m"#x1B[39;49;00m#x1B[33mm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
            elem = {#x1B[33m"#x1B[39;49;00m#x1B[33mdf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[96mgetattr#x1B[39;49;00m(adata, key[:-#x1B[94m1#x1B[39;49;00m])}#x1B[90m#x1B[39;49;00m
            #x1B[96msetattr#x1B[39;49;00m(adata, key, elem)#x1B[90m#x1B[39;49;00m
        adata.write_h5ad(path)#x1B[90m#x1B[39;49;00m
>       adata_lazy = read_lazy(path)#x1B[90m#x1B[39;49;00m
                     ^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/lazy/test_write.py#x1B[0m:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[.../anndata/_core/xarray.py#x1B[0m:37: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*args, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../experimental/backed/_io.py#x1B[0m:163: in read_lazy
    #x1B[0madata: AnnData = read_dispatched(f, callback=callback)#x1B[90m#x1B[39;49;00m
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/experimental/_dispatch_io.py#x1B[0m:39: in read_dispatched
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m reader.read_elem(elem)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_io/utils.py#x1B[0m:234: in func_wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*args, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../_io/specs/registry.py#x1B[0m:284: in read_elem
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.callback(read_func, elem.name, elem, iospec=iospec)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../experimental/backed/_io.py#x1B[0m:135: in callback
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m AnnData(**{k: read_dispatched(v, callback) #x1B[94mfor#x1B[39;49;00m k, v #x1B[95min#x1B[39;49;00m iter_object})#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:256: in __init__
    #x1B[0m#x1B[96mself#x1B[39;49;00m._init_as_actual(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:451: in _init_as_actual
    #x1B[0m#x1B[96mself#x1B[39;49;00m._obs = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:96: in _gen_dataframe_df
    #x1B[0manno.columns = pandas_as_str(anno.columns)#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/xarray.py#x1B[0m:288: in columns
    #x1B[0mwarn(#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

msg = 'Renaming or reordering columns on `Dataset2D` has no effect because the underlying data structure has no apparent ordering on its keys'
category = <class 'UserWarning'>, source = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mwarn#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        msg: #x1B[96mstr#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        category: #x1B[96mtype#x1B[39;49;00m[#x1B[96mWarning#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        source: Any = #x1B[94mNone#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        *,#x1B[90m#x1B[39;49;00m
        skip_file_prefixes: #x1B[96mtuple#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, ...] = (),#x1B[90m#x1B[39;49;00m
        more_file_prefixes: #x1B[96mtuple#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, ...] = (),#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m skip_file_prefixes:#x1B[90m#x1B[39;49;00m
            skip_file_prefixes = (*_FILE_PREFIXES, *more_file_prefixes)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m more_file_prefixes:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33m"#x1B[39;49;00m#x1B[33mCannot specify both `skip_file_prefixes` and `more_file_prefixes`#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(msg)#x1B[90m#x1B[39;49;00m
>       warnings.warn(msg, category, source=source, skip_file_prefixes=skip_file_prefixes)  #x1B[90m# noqa: TID251#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       UserWarning: Renaming or reordering columns on `Dataset2D` has no effect because the underlying data structure has no apparent ordering on its keys#x1B[0m
#x1B[1m#x1B[31mE       Error raised while reading key '' of <class 'h5py._hl.files.File'> from /#x1B[0m

#x1B[1m#x1B[31msrc/anndata/_warnings.py#x1B[0m:65: UserWarning
tests.test_concatenate::test_concatenate_roundtrip[inner-np_array-xarray-concat-in-memory-concatenate]
Stack Traces | 0.184s run time
join_type = 'inner', array_type = <function asarray at 0x7f6ed42f7480>
concat_func = <function <lambda> at 0x7f6e843e64b0>, backwards_compat = True
use_xdataset = True, force_lazy = False

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mconcat_func#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mbackwards_compat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            pytest.param(partial(concat, merge=#x1B[33m"#x1B[39;49;00m#x1B[33munique#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), #x1B[94mFalse#x1B[39;49;00m, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                #x1B[94mlambda#x1B[39;49;00m x, **kwargs: x[#x1B[94m0#x1B[39;49;00m].concatenate(x[#x1B[94m1#x1B[39;49;00m:], **kwargs),#x1B[90m#x1B[39;49;00m
                #x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                marks=mark_legacy_concatenate,#x1B[90m#x1B[39;49;00m
                #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcatenate#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_concatenate_roundtrip#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        join_type,#x1B[90m#x1B[39;49;00m
        array_type,#x1B[90m#x1B[39;49;00m
        concat_func,#x1B[90m#x1B[39;49;00m
        backwards_compat,#x1B[90m#x1B[39;49;00m
        use_xdataset,#x1B[90m#x1B[39;49;00m
        force_lazy,#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m force_lazy:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33munsupported#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        adata = gen_adata(#x1B[90m#x1B[39;49;00m
            (#x1B[94m100#x1B[39;49;00m, #x1B[94m10#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            X_type=array_type,#x1B[90m#x1B[39;49;00m
            obs_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            var_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            **GEN_ADATA_DASK_ARGS,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        remaining = adata.obs_names#x1B[90m#x1B[39;49;00m
        subsets = []#x1B[90m#x1B[39;49;00m
        #x1B[94mwhile#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(remaining) > #x1B[94m0#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            n = #x1B[96mmin#x1B[39;49;00m(#x1B[96mlen#x1B[39;49;00m(remaining), np.random.choice(#x1B[94m50#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
            subset_idx = np.random.choice(remaining, n, replace=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            subsets.append(adata[subset_idx])#x1B[90m#x1B[39;49;00m
            remaining = remaining.difference(subset_idx)#x1B[90m#x1B[39;49;00m
        result = concat_func(subsets, join=join_type, uns_merge=#x1B[33m"#x1B[39;49;00m#x1B[33msame#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, index_unique=#x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m use_xdataset:#x1B[90m#x1B[39;49;00m
            #x1B[94mimport#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxarray#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mas#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxr#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            result.var = Dataset2D(#x1B[90m#x1B[39;49;00m
                xr.Dataset.from_dataframe(result.var)#x1B[90m#x1B[39;49;00m
            )  #x1B[90m# backwards compat always returns a dataframe#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Correcting for known differences#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       orig, result = fix_known_differences(#x1B[90m#x1B[39;49;00m
            adata, result, backwards_compat=backwards_compat#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:277: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:176: in fix_known_differences
    #x1B[0mresult.obs = result.obs.ds.drop_vars([#x1B[33m"#x1B[39;49;00m#x1B[33mbatch#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:845: in obs
    #x1B[0m#x1B[96mself#x1B[39;49;00m._set_dim_df(value, #x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:776: in _set_dim_df
    #x1B[0mvalue = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:59: in _gen_dataframe_mapping
    #x1B[0mdf = pd.DataFrame(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../pandas/core/frame.py#x1B[0m:827: in __init__
    #x1B[0mdata = np.asarray(data)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <xarray.Dataset> Size: 4kB
Dimensions:         (concat_index: 100)
Coordinates:
  * concat_index    (concat_index) obj...t32 500B <NA> <NA> 23 -17 ... 22 <NA> -40
    nullable-uint8  (concat_index) UInt8 200B <NA> 213 <NA> ... 185 <NA> <NA>
dtype = None, copy = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__array__#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, dtype=#x1B[94mNone#x1B[39;49;00m, copy=#x1B[94mNone#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mcannot directly convert an xarray.Dataset into a #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mnumpy array. Instead, create an xarray.DataArray #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mfirst, either with indexing on the Dataset or by #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33minvoking the `to_dataarray()` method.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       TypeError: cannot directly convert an xarray.Dataset into a numpy array. Instead, create an xarray.DataArray first, either with indexing on the Dataset or by invoking the `to_dataarray()` method.#x1B[0m

#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../xarray/core/dataset.py#x1B[0m:1299: TypeError
tests.test_concatenate::test_concatenate_roundtrip[outer-sparse_dask_matrix-xarray-concat-in-memory-concatenate]
Stack Traces | 0.186s run time
join_type = 'outer'
array_type = functools.partial(<function _as_sparse_dask at 0x7f6ec8756980>, typ=<class 'scipy.sparse._csr.csr_matrix'>)
concat_func = <function <lambda> at 0x7f6e843e64b0>, backwards_compat = True
use_xdataset = True, force_lazy = False

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mconcat_func#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mbackwards_compat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            pytest.param(partial(concat, merge=#x1B[33m"#x1B[39;49;00m#x1B[33munique#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), #x1B[94mFalse#x1B[39;49;00m, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                #x1B[94mlambda#x1B[39;49;00m x, **kwargs: x[#x1B[94m0#x1B[39;49;00m].concatenate(x[#x1B[94m1#x1B[39;49;00m:], **kwargs),#x1B[90m#x1B[39;49;00m
                #x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                marks=mark_legacy_concatenate,#x1B[90m#x1B[39;49;00m
                #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcatenate#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_concatenate_roundtrip#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        join_type,#x1B[90m#x1B[39;49;00m
        array_type,#x1B[90m#x1B[39;49;00m
        concat_func,#x1B[90m#x1B[39;49;00m
        backwards_compat,#x1B[90m#x1B[39;49;00m
        use_xdataset,#x1B[90m#x1B[39;49;00m
        force_lazy,#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m force_lazy:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33munsupported#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        adata = gen_adata(#x1B[90m#x1B[39;49;00m
            (#x1B[94m100#x1B[39;49;00m, #x1B[94m10#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            X_type=array_type,#x1B[90m#x1B[39;49;00m
            obs_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            var_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            **GEN_ADATA_DASK_ARGS,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        remaining = adata.obs_names#x1B[90m#x1B[39;49;00m
        subsets = []#x1B[90m#x1B[39;49;00m
        #x1B[94mwhile#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(remaining) > #x1B[94m0#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            n = #x1B[96mmin#x1B[39;49;00m(#x1B[96mlen#x1B[39;49;00m(remaining), np.random.choice(#x1B[94m50#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
            subset_idx = np.random.choice(remaining, n, replace=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            subsets.append(adata[subset_idx])#x1B[90m#x1B[39;49;00m
            remaining = remaining.difference(subset_idx)#x1B[90m#x1B[39;49;00m
        result = concat_func(subsets, join=join_type, uns_merge=#x1B[33m"#x1B[39;49;00m#x1B[33msame#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, index_unique=#x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m use_xdataset:#x1B[90m#x1B[39;49;00m
            #x1B[94mimport#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxarray#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mas#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxr#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            result.var = Dataset2D(#x1B[90m#x1B[39;49;00m
                xr.Dataset.from_dataframe(result.var)#x1B[90m#x1B[39;49;00m
            )  #x1B[90m# backwards compat always returns a dataframe#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Correcting for known differences#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       orig, result = fix_known_differences(#x1B[90m#x1B[39;49;00m
            adata, result, backwards_compat=backwards_compat#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:277: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:176: in fix_known_differences
    #x1B[0mresult.obs = result.obs.ds.drop_vars([#x1B[33m"#x1B[39;49;00m#x1B[33mbatch#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:845: in obs
    #x1B[0m#x1B[96mself#x1B[39;49;00m._set_dim_df(value, #x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:776: in _set_dim_df
    #x1B[0mvalue = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:59: in _gen_dataframe_mapping
    #x1B[0mdf = pd.DataFrame(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../pandas/core/frame.py#x1B[0m:827: in __init__
    #x1B[0mdata = np.asarray(data)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <xarray.Dataset> Size: 4kB
Dimensions:         (concat_index: 100)
Coordinates:
  * concat_index    (concat_index) obj...t32 500B <NA> <NA> 23 -17 ... 22 <NA> -40
    nullable-uint8  (concat_index) UInt8 200B <NA> 213 <NA> ... 185 <NA> <NA>
dtype = None, copy = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__array__#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, dtype=#x1B[94mNone#x1B[39;49;00m, copy=#x1B[94mNone#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mcannot directly convert an xarray.Dataset into a #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mnumpy array. Instead, create an xarray.DataArray #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mfirst, either with indexing on the Dataset or by #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33minvoking the `to_dataarray()` method.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       TypeError: cannot directly convert an xarray.Dataset into a numpy array. Instead, create an xarray.DataArray first, either with indexing on the Dataset or by invoking the `to_dataarray()` method.#x1B[0m

#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../xarray/core/dataset.py#x1B[0m:1299: TypeError
tests.test_concatenate::test_concatenate_roundtrip[inner-scipy_csc_matrix-xarray-concat-in-memory-concatenate]
Stack Traces | 0.19s run time
join_type = 'inner', array_type = <class 'scipy.sparse._csc.csc_matrix'>
concat_func = <function <lambda> at 0x7f6e843e64b0>, backwards_compat = True
use_xdataset = True, force_lazy = False

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mconcat_func#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mbackwards_compat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            pytest.param(partial(concat, merge=#x1B[33m"#x1B[39;49;00m#x1B[33munique#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), #x1B[94mFalse#x1B[39;49;00m, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                #x1B[94mlambda#x1B[39;49;00m x, **kwargs: x[#x1B[94m0#x1B[39;49;00m].concatenate(x[#x1B[94m1#x1B[39;49;00m:], **kwargs),#x1B[90m#x1B[39;49;00m
                #x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                marks=mark_legacy_concatenate,#x1B[90m#x1B[39;49;00m
                #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcatenate#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_concatenate_roundtrip#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        join_type,#x1B[90m#x1B[39;49;00m
        array_type,#x1B[90m#x1B[39;49;00m
        concat_func,#x1B[90m#x1B[39;49;00m
        backwards_compat,#x1B[90m#x1B[39;49;00m
        use_xdataset,#x1B[90m#x1B[39;49;00m
        force_lazy,#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m force_lazy:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33munsupported#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        adata = gen_adata(#x1B[90m#x1B[39;49;00m
            (#x1B[94m100#x1B[39;49;00m, #x1B[94m10#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            X_type=array_type,#x1B[90m#x1B[39;49;00m
            obs_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            var_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            **GEN_ADATA_DASK_ARGS,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        remaining = adata.obs_names#x1B[90m#x1B[39;49;00m
        subsets = []#x1B[90m#x1B[39;49;00m
        #x1B[94mwhile#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(remaining) > #x1B[94m0#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            n = #x1B[96mmin#x1B[39;49;00m(#x1B[96mlen#x1B[39;49;00m(remaining), np.random.choice(#x1B[94m50#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
            subset_idx = np.random.choice(remaining, n, replace=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            subsets.append(adata[subset_idx])#x1B[90m#x1B[39;49;00m
            remaining = remaining.difference(subset_idx)#x1B[90m#x1B[39;49;00m
        result = concat_func(subsets, join=join_type, uns_merge=#x1B[33m"#x1B[39;49;00m#x1B[33msame#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, index_unique=#x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m use_xdataset:#x1B[90m#x1B[39;49;00m
            #x1B[94mimport#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxarray#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mas#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxr#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            result.var = Dataset2D(#x1B[90m#x1B[39;49;00m
                xr.Dataset.from_dataframe(result.var)#x1B[90m#x1B[39;49;00m
            )  #x1B[90m# backwards compat always returns a dataframe#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Correcting for known differences#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       orig, result = fix_known_differences(#x1B[90m#x1B[39;49;00m
            adata, result, backwards_compat=backwards_compat#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:277: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:176: in fix_known_differences
    #x1B[0mresult.obs = result.obs.ds.drop_vars([#x1B[33m"#x1B[39;49;00m#x1B[33mbatch#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:845: in obs
    #x1B[0m#x1B[96mself#x1B[39;49;00m._set_dim_df(value, #x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:776: in _set_dim_df
    #x1B[0mvalue = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:59: in _gen_dataframe_mapping
    #x1B[0mdf = pd.DataFrame(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../pandas/core/frame.py#x1B[0m:827: in __init__
    #x1B[0mdata = np.asarray(data)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <xarray.Dataset> Size: 4kB
Dimensions:         (concat_index: 100)
Coordinates:
  * concat_index    (concat_index) obj...t32 500B <NA> <NA> 23 -17 ... 22 <NA> -40
    nullable-uint8  (concat_index) UInt8 200B <NA> 213 <NA> ... 185 <NA> <NA>
dtype = None, copy = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__array__#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, dtype=#x1B[94mNone#x1B[39;49;00m, copy=#x1B[94mNone#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mcannot directly convert an xarray.Dataset into a #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mnumpy array. Instead, create an xarray.DataArray #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mfirst, either with indexing on the Dataset or by #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33minvoking the `to_dataarray()` method.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       TypeError: cannot directly convert an xarray.Dataset into a numpy array. Instead, create an xarray.DataArray first, either with indexing on the Dataset or by invoking the `to_dataarray()` method.#x1B[0m

#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../xarray/core/dataset.py#x1B[0m:1299: TypeError
tests.test_concatenate::test_concatenate_roundtrip[outer-scipy_csc_array-xarray-concat-in-memory-concatenate]
Stack Traces | 0.191s run time
join_type = 'outer', array_type = <class 'scipy.sparse._csc.csc_array'>
concat_func = <function <lambda> at 0x7f7f846bc1a0>, backwards_compat = True
use_xdataset = True, force_lazy = False

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mconcat_func#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mbackwards_compat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            pytest.param(partial(concat, merge=#x1B[33m"#x1B[39;49;00m#x1B[33munique#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), #x1B[94mFalse#x1B[39;49;00m, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                #x1B[94mlambda#x1B[39;49;00m x, **kwargs: x[#x1B[94m0#x1B[39;49;00m].concatenate(x[#x1B[94m1#x1B[39;49;00m:], **kwargs),#x1B[90m#x1B[39;49;00m
                #x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                marks=mark_legacy_concatenate,#x1B[90m#x1B[39;49;00m
                #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcatenate#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_concatenate_roundtrip#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        join_type,#x1B[90m#x1B[39;49;00m
        array_type,#x1B[90m#x1B[39;49;00m
        concat_func,#x1B[90m#x1B[39;49;00m
        backwards_compat,#x1B[90m#x1B[39;49;00m
        use_xdataset,#x1B[90m#x1B[39;49;00m
        force_lazy,#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m force_lazy:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33munsupported#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        adata = gen_adata(#x1B[90m#x1B[39;49;00m
            (#x1B[94m100#x1B[39;49;00m, #x1B[94m10#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            X_type=array_type,#x1B[90m#x1B[39;49;00m
            obs_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            var_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            **GEN_ADATA_DASK_ARGS,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        remaining = adata.obs_names#x1B[90m#x1B[39;49;00m
        subsets = []#x1B[90m#x1B[39;49;00m
        #x1B[94mwhile#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(remaining) > #x1B[94m0#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            n = #x1B[96mmin#x1B[39;49;00m(#x1B[96mlen#x1B[39;49;00m(remaining), np.random.choice(#x1B[94m50#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
            subset_idx = np.random.choice(remaining, n, replace=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            subsets.append(adata[subset_idx])#x1B[90m#x1B[39;49;00m
            remaining = remaining.difference(subset_idx)#x1B[90m#x1B[39;49;00m
        result = concat_func(subsets, join=join_type, uns_merge=#x1B[33m"#x1B[39;49;00m#x1B[33msame#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, index_unique=#x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m use_xdataset:#x1B[90m#x1B[39;49;00m
            #x1B[94mimport#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxarray#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mas#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxr#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            result.var = Dataset2D(#x1B[90m#x1B[39;49;00m
                xr.Dataset.from_dataframe(result.var)#x1B[90m#x1B[39;49;00m
            )  #x1B[90m# backwards compat always returns a dataframe#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Correcting for known differences#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       orig, result = fix_known_differences(#x1B[90m#x1B[39;49;00m
            adata, result, backwards_compat=backwards_compat#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:277: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:176: in fix_known_differences
    #x1B[0mresult.obs = result.obs.ds.drop_vars([#x1B[33m"#x1B[39;49;00m#x1B[33mbatch#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:845: in obs
    #x1B[0m#x1B[96mself#x1B[39;49;00m._set_dim_df(value, #x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:776: in _set_dim_df
    #x1B[0mvalue = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:59: in _gen_dataframe_mapping
    #x1B[0mdf = pd.DataFrame(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../pandas/core/frame.py#x1B[0m:827: in __init__
    #x1B[0mdata = np.asarray(data)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <xarray.Dataset> Size: 4kB
Dimensions:         (concat_index: 100)
Coordinates:
  * concat_index    (concat_index) obj...t32 500B <NA> <NA> 23 -17 ... 22 <NA> -40
    nullable-uint8  (concat_index) UInt8 200B <NA> 213 <NA> ... 185 <NA> <NA>
dtype = None, copy = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__array__#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, dtype=#x1B[94mNone#x1B[39;49;00m, copy=#x1B[94mNone#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mcannot directly convert an xarray.Dataset into a #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mnumpy array. Instead, create an xarray.DataArray #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mfirst, either with indexing on the Dataset or by #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33minvoking the `to_dataarray()` method.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       TypeError: cannot directly convert an xarray.Dataset into a numpy array. Instead, create an xarray.DataArray first, either with indexing on the Dataset or by invoking the `to_dataarray()` method.#x1B[0m

#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../xarray/core/dataset.py#x1B[0m:1299: TypeError
tests.test_concatenate::test_concatenate_roundtrip[inner-scipy_csr_matrix-xarray-concat-in-memory-concatenate]
Stack Traces | 0.194s run time
join_type = 'inner', array_type = <class 'scipy.sparse._csr.csr_matrix'>
concat_func = <function <lambda> at 0x7f6e843e64b0>, backwards_compat = True
use_xdataset = True, force_lazy = False

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mconcat_func#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mbackwards_compat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            pytest.param(partial(concat, merge=#x1B[33m"#x1B[39;49;00m#x1B[33munique#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), #x1B[94mFalse#x1B[39;49;00m, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                #x1B[94mlambda#x1B[39;49;00m x, **kwargs: x[#x1B[94m0#x1B[39;49;00m].concatenate(x[#x1B[94m1#x1B[39;49;00m:], **kwargs),#x1B[90m#x1B[39;49;00m
                #x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                marks=mark_legacy_concatenate,#x1B[90m#x1B[39;49;00m
                #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcatenate#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_concatenate_roundtrip#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        join_type,#x1B[90m#x1B[39;49;00m
        array_type,#x1B[90m#x1B[39;49;00m
        concat_func,#x1B[90m#x1B[39;49;00m
        backwards_compat,#x1B[90m#x1B[39;49;00m
        use_xdataset,#x1B[90m#x1B[39;49;00m
        force_lazy,#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m force_lazy:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33munsupported#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        adata = gen_adata(#x1B[90m#x1B[39;49;00m
            (#x1B[94m100#x1B[39;49;00m, #x1B[94m10#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            X_type=array_type,#x1B[90m#x1B[39;49;00m
            obs_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            var_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            **GEN_ADATA_DASK_ARGS,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        remaining = adata.obs_names#x1B[90m#x1B[39;49;00m
        subsets = []#x1B[90m#x1B[39;49;00m
        #x1B[94mwhile#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(remaining) > #x1B[94m0#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            n = #x1B[96mmin#x1B[39;49;00m(#x1B[96mlen#x1B[39;49;00m(remaining), np.random.choice(#x1B[94m50#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
            subset_idx = np.random.choice(remaining, n, replace=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            subsets.append(adata[subset_idx])#x1B[90m#x1B[39;49;00m
            remaining = remaining.difference(subset_idx)#x1B[90m#x1B[39;49;00m
        result = concat_func(subsets, join=join_type, uns_merge=#x1B[33m"#x1B[39;49;00m#x1B[33msame#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, index_unique=#x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m use_xdataset:#x1B[90m#x1B[39;49;00m
            #x1B[94mimport#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxarray#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mas#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxr#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            result.var = Dataset2D(#x1B[90m#x1B[39;49;00m
                xr.Dataset.from_dataframe(result.var)#x1B[90m#x1B[39;49;00m
            )  #x1B[90m# backwards compat always returns a dataframe#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Correcting for known differences#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       orig, result = fix_known_differences(#x1B[90m#x1B[39;49;00m
            adata, result, backwards_compat=backwards_compat#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:277: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:176: in fix_known_differences
    #x1B[0mresult.obs = result.obs.ds.drop_vars([#x1B[33m"#x1B[39;49;00m#x1B[33mbatch#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:845: in obs
    #x1B[0m#x1B[96mself#x1B[39;49;00m._set_dim_df(value, #x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:776: in _set_dim_df
    #x1B[0mvalue = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:59: in _gen_dataframe_mapping
    #x1B[0mdf = pd.DataFrame(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../pandas/core/frame.py#x1B[0m:827: in __init__
    #x1B[0mdata = np.asarray(data)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <xarray.Dataset> Size: 4kB
Dimensions:         (concat_index: 100)
Coordinates:
  * concat_index    (concat_index) obj...t32 500B <NA> <NA> 23 -17 ... 22 <NA> -40
    nullable-uint8  (concat_index) UInt8 200B <NA> 213 <NA> ... 185 <NA> <NA>
dtype = None, copy = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__array__#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, dtype=#x1B[94mNone#x1B[39;49;00m, copy=#x1B[94mNone#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mcannot directly convert an xarray.Dataset into a #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mnumpy array. Instead, create an xarray.DataArray #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mfirst, either with indexing on the Dataset or by #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33minvoking the `to_dataarray()` method.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       TypeError: cannot directly convert an xarray.Dataset into a numpy array. Instead, create an xarray.DataArray first, either with indexing on the Dataset or by invoking the `to_dataarray()` method.#x1B[0m

#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../xarray/core/dataset.py#x1B[0m:1299: TypeError
tests.test_concatenate::test_concatenate_roundtrip[outer-scipy_csr_array-xarray-concat-in-memory-concatenate]
Stack Traces | 0.197s run time
join_type = 'outer', array_type = <class 'scipy.sparse._csr.csr_array'>
concat_func = <function <lambda> at 0x7f7f846bc1a0>, backwards_compat = True
use_xdataset = True, force_lazy = False

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mconcat_func#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mbackwards_compat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            pytest.param(partial(concat, merge=#x1B[33m"#x1B[39;49;00m#x1B[33munique#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), #x1B[94mFalse#x1B[39;49;00m, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                #x1B[94mlambda#x1B[39;49;00m x, **kwargs: x[#x1B[94m0#x1B[39;49;00m].concatenate(x[#x1B[94m1#x1B[39;49;00m:], **kwargs),#x1B[90m#x1B[39;49;00m
                #x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                marks=mark_legacy_concatenate,#x1B[90m#x1B[39;49;00m
                #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcatenate#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_concatenate_roundtrip#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        join_type,#x1B[90m#x1B[39;49;00m
        array_type,#x1B[90m#x1B[39;49;00m
        concat_func,#x1B[90m#x1B[39;49;00m
        backwards_compat,#x1B[90m#x1B[39;49;00m
        use_xdataset,#x1B[90m#x1B[39;49;00m
        force_lazy,#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m force_lazy:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33munsupported#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        adata = gen_adata(#x1B[90m#x1B[39;49;00m
            (#x1B[94m100#x1B[39;49;00m, #x1B[94m10#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            X_type=array_type,#x1B[90m#x1B[39;49;00m
            obs_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            var_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            **GEN_ADATA_DASK_ARGS,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        remaining = adata.obs_names#x1B[90m#x1B[39;49;00m
        subsets = []#x1B[90m#x1B[39;49;00m
        #x1B[94mwhile#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(remaining) > #x1B[94m0#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            n = #x1B[96mmin#x1B[39;49;00m(#x1B[96mlen#x1B[39;49;00m(remaining), np.random.choice(#x1B[94m50#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
            subset_idx = np.random.choice(remaining, n, replace=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            subsets.append(adata[subset_idx])#x1B[90m#x1B[39;49;00m
            remaining = remaining.difference(subset_idx)#x1B[90m#x1B[39;49;00m
        result = concat_func(subsets, join=join_type, uns_merge=#x1B[33m"#x1B[39;49;00m#x1B[33msame#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, index_unique=#x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m use_xdataset:#x1B[90m#x1B[39;49;00m
            #x1B[94mimport#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxarray#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mas#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxr#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            result.var = Dataset2D(#x1B[90m#x1B[39;49;00m
                xr.Dataset.from_dataframe(result.var)#x1B[90m#x1B[39;49;00m
            )  #x1B[90m# backwards compat always returns a dataframe#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Correcting for known differences#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       orig, result = fix_known_differences(#x1B[90m#x1B[39;49;00m
            adata, result, backwards_compat=backwards_compat#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:277: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:176: in fix_known_differences
    #x1B[0mresult.obs = result.obs.ds.drop_vars([#x1B[33m"#x1B[39;49;00m#x1B[33mbatch#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:845: in obs
    #x1B[0m#x1B[96mself#x1B[39;49;00m._set_dim_df(value, #x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:776: in _set_dim_df
    #x1B[0mvalue = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:59: in _gen_dataframe_mapping
    #x1B[0mdf = pd.DataFrame(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../pandas/core/frame.py#x1B[0m:827: in __init__
    #x1B[0mdata = np.asarray(data)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <xarray.Dataset> Size: 4kB
Dimensions:         (concat_index: 100)
Coordinates:
  * concat_index    (concat_index) obj...t32 500B <NA> <NA> 23 -17 ... 22 <NA> -40
    nullable-uint8  (concat_index) UInt8 200B <NA> 213 <NA> ... 185 <NA> <NA>
dtype = None, copy = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__array__#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, dtype=#x1B[94mNone#x1B[39;49;00m, copy=#x1B[94mNone#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mcannot directly convert an xarray.Dataset into a #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mnumpy array. Instead, create an xarray.DataArray #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mfirst, either with indexing on the Dataset or by #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33minvoking the `to_dataarray()` method.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       TypeError: cannot directly convert an xarray.Dataset into a numpy array. Instead, create an xarray.DataArray first, either with indexing on the Dataset or by invoking the `to_dataarray()` method.#x1B[0m

#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../xarray/core/dataset.py#x1B[0m:1299: TypeError
tests.test_concatenate::test_concatenate_roundtrip[inner-sparse_dask_matrix-xarray-concat-in-memory-concatenate]
Stack Traces | 0.2s run time
join_type = 'inner'
array_type = functools.partial(<function _as_sparse_dask at 0x7f6ec8756980>, typ=<class 'scipy.sparse._csr.csr_matrix'>)
concat_func = <function <lambda> at 0x7f6e843e64b0>, backwards_compat = True
use_xdataset = True, force_lazy = False

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mconcat_func#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mbackwards_compat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            pytest.param(partial(concat, merge=#x1B[33m"#x1B[39;49;00m#x1B[33munique#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), #x1B[94mFalse#x1B[39;49;00m, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                #x1B[94mlambda#x1B[39;49;00m x, **kwargs: x[#x1B[94m0#x1B[39;49;00m].concatenate(x[#x1B[94m1#x1B[39;49;00m:], **kwargs),#x1B[90m#x1B[39;49;00m
                #x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                marks=mark_legacy_concatenate,#x1B[90m#x1B[39;49;00m
                #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcatenate#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_concatenate_roundtrip#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        join_type,#x1B[90m#x1B[39;49;00m
        array_type,#x1B[90m#x1B[39;49;00m
        concat_func,#x1B[90m#x1B[39;49;00m
        backwards_compat,#x1B[90m#x1B[39;49;00m
        use_xdataset,#x1B[90m#x1B[39;49;00m
        force_lazy,#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m force_lazy:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33munsupported#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        adata = gen_adata(#x1B[90m#x1B[39;49;00m
            (#x1B[94m100#x1B[39;49;00m, #x1B[94m10#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            X_type=array_type,#x1B[90m#x1B[39;49;00m
            obs_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            var_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            **GEN_ADATA_DASK_ARGS,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        remaining = adata.obs_names#x1B[90m#x1B[39;49;00m
        subsets = []#x1B[90m#x1B[39;49;00m
        #x1B[94mwhile#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(remaining) > #x1B[94m0#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            n = #x1B[96mmin#x1B[39;49;00m(#x1B[96mlen#x1B[39;49;00m(remaining), np.random.choice(#x1B[94m50#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
            subset_idx = np.random.choice(remaining, n, replace=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            subsets.append(adata[subset_idx])#x1B[90m#x1B[39;49;00m
            remaining = remaining.difference(subset_idx)#x1B[90m#x1B[39;49;00m
        result = concat_func(subsets, join=join_type, uns_merge=#x1B[33m"#x1B[39;49;00m#x1B[33msame#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, index_unique=#x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m use_xdataset:#x1B[90m#x1B[39;49;00m
            #x1B[94mimport#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxarray#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mas#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxr#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            result.var = Dataset2D(#x1B[90m#x1B[39;49;00m
                xr.Dataset.from_dataframe(result.var)#x1B[90m#x1B[39;49;00m
            )  #x1B[90m# backwards compat always returns a dataframe#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Correcting for known differences#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       orig, result = fix_known_differences(#x1B[90m#x1B[39;49;00m
            adata, result, backwards_compat=backwards_compat#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:277: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:176: in fix_known_differences
    #x1B[0mresult.obs = result.obs.ds.drop_vars([#x1B[33m"#x1B[39;49;00m#x1B[33mbatch#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:845: in obs
    #x1B[0m#x1B[96mself#x1B[39;49;00m._set_dim_df(value, #x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:776: in _set_dim_df
    #x1B[0mvalue = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:59: in _gen_dataframe_mapping
    #x1B[0mdf = pd.DataFrame(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../pandas/core/frame.py#x1B[0m:827: in __init__
    #x1B[0mdata = np.asarray(data)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <xarray.Dataset> Size: 4kB
Dimensions:         (concat_index: 100)
Coordinates:
  * concat_index    (concat_index) obj...t32 500B <NA> <NA> 23 -17 ... 22 <NA> -40
    nullable-uint8  (concat_index) UInt8 200B <NA> 213 <NA> ... 185 <NA> <NA>
dtype = None, copy = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__array__#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, dtype=#x1B[94mNone#x1B[39;49;00m, copy=#x1B[94mNone#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mcannot directly convert an xarray.Dataset into a #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mnumpy array. Instead, create an xarray.DataArray #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mfirst, either with indexing on the Dataset or by #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33minvoking the `to_dataarray()` method.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       TypeError: cannot directly convert an xarray.Dataset into a numpy array. Instead, create an xarray.DataArray first, either with indexing on the Dataset or by invoking the `to_dataarray()` method.#x1B[0m

#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../xarray/core/dataset.py#x1B[0m:1299: TypeError
tests.test_concatenate::test_concatenate_roundtrip[inner-sparse_dask_array-xarray-concat-in-memory-concatenate]
Stack Traces | 0.201s run time
join_type = 'inner'
array_type = functools.partial(<function _as_sparse_dask at 0x7f6ec8756980>, typ=<class 'scipy.sparse._csr.csr_array'>)
concat_func = <function <lambda> at 0x7f6e843e64b0>, backwards_compat = True
use_xdataset = True, force_lazy = False

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mconcat_func#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mbackwards_compat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            pytest.param(partial(concat, merge=#x1B[33m"#x1B[39;49;00m#x1B[33munique#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), #x1B[94mFalse#x1B[39;49;00m, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                #x1B[94mlambda#x1B[39;49;00m x, **kwargs: x[#x1B[94m0#x1B[39;49;00m].concatenate(x[#x1B[94m1#x1B[39;49;00m:], **kwargs),#x1B[90m#x1B[39;49;00m
                #x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                marks=mark_legacy_concatenate,#x1B[90m#x1B[39;49;00m
                #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcatenate#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_concatenate_roundtrip#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        join_type,#x1B[90m#x1B[39;49;00m
        array_type,#x1B[90m#x1B[39;49;00m
        concat_func,#x1B[90m#x1B[39;49;00m
        backwards_compat,#x1B[90m#x1B[39;49;00m
        use_xdataset,#x1B[90m#x1B[39;49;00m
        force_lazy,#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m force_lazy:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33munsupported#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        adata = gen_adata(#x1B[90m#x1B[39;49;00m
            (#x1B[94m100#x1B[39;49;00m, #x1B[94m10#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            X_type=array_type,#x1B[90m#x1B[39;49;00m
            obs_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            var_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            **GEN_ADATA_DASK_ARGS,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        remaining = adata.obs_names#x1B[90m#x1B[39;49;00m
        subsets = []#x1B[90m#x1B[39;49;00m
        #x1B[94mwhile#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(remaining) > #x1B[94m0#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            n = #x1B[96mmin#x1B[39;49;00m(#x1B[96mlen#x1B[39;49;00m(remaining), np.random.choice(#x1B[94m50#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
            subset_idx = np.random.choice(remaining, n, replace=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            subsets.append(adata[subset_idx])#x1B[90m#x1B[39;49;00m
            remaining = remaining.difference(subset_idx)#x1B[90m#x1B[39;49;00m
        result = concat_func(subsets, join=join_type, uns_merge=#x1B[33m"#x1B[39;49;00m#x1B[33msame#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, index_unique=#x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m use_xdataset:#x1B[90m#x1B[39;49;00m
            #x1B[94mimport#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxarray#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mas#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxr#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            result.var = Dataset2D(#x1B[90m#x1B[39;49;00m
                xr.Dataset.from_dataframe(result.var)#x1B[90m#x1B[39;49;00m
            )  #x1B[90m# backwards compat always returns a dataframe#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Correcting for known differences#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       orig, result = fix_known_differences(#x1B[90m#x1B[39;49;00m
            adata, result, backwards_compat=backwards_compat#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:277: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:176: in fix_known_differences
    #x1B[0mresult.obs = result.obs.ds.drop_vars([#x1B[33m"#x1B[39;49;00m#x1B[33mbatch#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:845: in obs
    #x1B[0m#x1B[96mself#x1B[39;49;00m._set_dim_df(value, #x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:776: in _set_dim_df
    #x1B[0mvalue = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:59: in _gen_dataframe_mapping
    #x1B[0mdf = pd.DataFrame(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../pandas/core/frame.py#x1B[0m:827: in __init__
    #x1B[0mdata = np.asarray(data)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <xarray.Dataset> Size: 4kB
Dimensions:         (concat_index: 100)
Coordinates:
  * concat_index    (concat_index) obj...t32 500B <NA> <NA> 23 -17 ... 22 <NA> -40
    nullable-uint8  (concat_index) UInt8 200B <NA> 213 <NA> ... 185 <NA> <NA>
dtype = None, copy = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__array__#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, dtype=#x1B[94mNone#x1B[39;49;00m, copy=#x1B[94mNone#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mcannot directly convert an xarray.Dataset into a #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mnumpy array. Instead, create an xarray.DataArray #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mfirst, either with indexing on the Dataset or by #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33minvoking the `to_dataarray()` method.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       TypeError: cannot directly convert an xarray.Dataset into a numpy array. Instead, create an xarray.DataArray first, either with indexing on the Dataset or by invoking the `to_dataarray()` method.#x1B[0m

#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../xarray/core/dataset.py#x1B[0m:1299: TypeError
tests.test_concatenate::test_concatenate_roundtrip[outer-np_array-xarray-concat-in-memory-concatenate]
Stack Traces | 0.201s run time
join_type = 'outer', array_type = <function asarray at 0x7f7fd4ddf480>
concat_func = <function <lambda> at 0x7f7f846bc1a0>, backwards_compat = True
use_xdataset = True, force_lazy = False

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mconcat_func#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mbackwards_compat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            pytest.param(partial(concat, merge=#x1B[33m"#x1B[39;49;00m#x1B[33munique#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), #x1B[94mFalse#x1B[39;49;00m, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                #x1B[94mlambda#x1B[39;49;00m x, **kwargs: x[#x1B[94m0#x1B[39;49;00m].concatenate(x[#x1B[94m1#x1B[39;49;00m:], **kwargs),#x1B[90m#x1B[39;49;00m
                #x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                marks=mark_legacy_concatenate,#x1B[90m#x1B[39;49;00m
                #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcatenate#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_concatenate_roundtrip#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        join_type,#x1B[90m#x1B[39;49;00m
        array_type,#x1B[90m#x1B[39;49;00m
        concat_func,#x1B[90m#x1B[39;49;00m
        backwards_compat,#x1B[90m#x1B[39;49;00m
        use_xdataset,#x1B[90m#x1B[39;49;00m
        force_lazy,#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m force_lazy:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33munsupported#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        adata = gen_adata(#x1B[90m#x1B[39;49;00m
            (#x1B[94m100#x1B[39;49;00m, #x1B[94m10#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            X_type=array_type,#x1B[90m#x1B[39;49;00m
            obs_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            var_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            **GEN_ADATA_DASK_ARGS,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        remaining = adata.obs_names#x1B[90m#x1B[39;49;00m
        subsets = []#x1B[90m#x1B[39;49;00m
        #x1B[94mwhile#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(remaining) > #x1B[94m0#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            n = #x1B[96mmin#x1B[39;49;00m(#x1B[96mlen#x1B[39;49;00m(remaining), np.random.choice(#x1B[94m50#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
            subset_idx = np.random.choice(remaining, n, replace=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            subsets.append(adata[subset_idx])#x1B[90m#x1B[39;49;00m
            remaining = remaining.difference(subset_idx)#x1B[90m#x1B[39;49;00m
        result = concat_func(subsets, join=join_type, uns_merge=#x1B[33m"#x1B[39;49;00m#x1B[33msame#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, index_unique=#x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m use_xdataset:#x1B[90m#x1B[39;49;00m
            #x1B[94mimport#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxarray#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mas#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxr#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            result.var = Dataset2D(#x1B[90m#x1B[39;49;00m
                xr.Dataset.from_dataframe(result.var)#x1B[90m#x1B[39;49;00m
            )  #x1B[90m# backwards compat always returns a dataframe#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Correcting for known differences#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       orig, result = fix_known_differences(#x1B[90m#x1B[39;49;00m
            adata, result, backwards_compat=backwards_compat#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:277: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:176: in fix_known_differences
    #x1B[0mresult.obs = result.obs.ds.drop_vars([#x1B[33m"#x1B[39;49;00m#x1B[33mbatch#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:845: in obs
    #x1B[0m#x1B[96mself#x1B[39;49;00m._set_dim_df(value, #x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:776: in _set_dim_df
    #x1B[0mvalue = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:59: in _gen_dataframe_mapping
    #x1B[0mdf = pd.DataFrame(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../pandas/core/frame.py#x1B[0m:827: in __init__
    #x1B[0mdata = np.asarray(data)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <xarray.Dataset> Size: 4kB
Dimensions:         (concat_index: 100)
Coordinates:
  * concat_index    (concat_index) obj...t32 500B <NA> <NA> 23 -17 ... 22 <NA> -40
    nullable-uint8  (concat_index) UInt8 200B <NA> 213 <NA> ... 185 <NA> <NA>
dtype = None, copy = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__array__#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, dtype=#x1B[94mNone#x1B[39;49;00m, copy=#x1B[94mNone#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mcannot directly convert an xarray.Dataset into a #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mnumpy array. Instead, create an xarray.DataArray #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mfirst, either with indexing on the Dataset or by #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33minvoking the `to_dataarray()` method.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       TypeError: cannot directly convert an xarray.Dataset into a numpy array. Instead, create an xarray.DataArray first, either with indexing on the Dataset or by invoking the `to_dataarray()` method.#x1B[0m

#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../xarray/core/dataset.py#x1B[0m:1299: TypeError
tests.test_concatenate::test_concatenate_roundtrip[outer-scipy_csr_matrix-xarray-concat-in-memory-concatenate]
Stack Traces | 0.201s run time
join_type = 'outer', array_type = <class 'scipy.sparse._csr.csr_matrix'>
concat_func = <function <lambda> at 0x7f7f846bc1a0>, backwards_compat = True
use_xdataset = True, force_lazy = False

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mconcat_func#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mbackwards_compat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            pytest.param(partial(concat, merge=#x1B[33m"#x1B[39;49;00m#x1B[33munique#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), #x1B[94mFalse#x1B[39;49;00m, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                #x1B[94mlambda#x1B[39;49;00m x, **kwargs: x[#x1B[94m0#x1B[39;49;00m].concatenate(x[#x1B[94m1#x1B[39;49;00m:], **kwargs),#x1B[90m#x1B[39;49;00m
                #x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                marks=mark_legacy_concatenate,#x1B[90m#x1B[39;49;00m
                #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcatenate#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_concatenate_roundtrip#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        join_type,#x1B[90m#x1B[39;49;00m
        array_type,#x1B[90m#x1B[39;49;00m
        concat_func,#x1B[90m#x1B[39;49;00m
        backwards_compat,#x1B[90m#x1B[39;49;00m
        use_xdataset,#x1B[90m#x1B[39;49;00m
        force_lazy,#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m force_lazy:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33munsupported#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        adata = gen_adata(#x1B[90m#x1B[39;49;00m
            (#x1B[94m100#x1B[39;49;00m, #x1B[94m10#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            X_type=array_type,#x1B[90m#x1B[39;49;00m
            obs_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            var_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            **GEN_ADATA_DASK_ARGS,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        remaining = adata.obs_names#x1B[90m#x1B[39;49;00m
        subsets = []#x1B[90m#x1B[39;49;00m
        #x1B[94mwhile#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(remaining) > #x1B[94m0#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            n = #x1B[96mmin#x1B[39;49;00m(#x1B[96mlen#x1B[39;49;00m(remaining), np.random.choice(#x1B[94m50#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
            subset_idx = np.random.choice(remaining, n, replace=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            subsets.append(adata[subset_idx])#x1B[90m#x1B[39;49;00m
            remaining = remaining.difference(subset_idx)#x1B[90m#x1B[39;49;00m
        result = concat_func(subsets, join=join_type, uns_merge=#x1B[33m"#x1B[39;49;00m#x1B[33msame#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, index_unique=#x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m use_xdataset:#x1B[90m#x1B[39;49;00m
            #x1B[94mimport#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxarray#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mas#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxr#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            result.var = Dataset2D(#x1B[90m#x1B[39;49;00m
                xr.Dataset.from_dataframe(result.var)#x1B[90m#x1B[39;49;00m
            )  #x1B[90m# backwards compat always returns a dataframe#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Correcting for known differences#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       orig, result = fix_known_differences(#x1B[90m#x1B[39;49;00m
            adata, result, backwards_compat=backwards_compat#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:277: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:176: in fix_known_differences
    #x1B[0mresult.obs = result.obs.ds.drop_vars([#x1B[33m"#x1B[39;49;00m#x1B[33mbatch#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:845: in obs
    #x1B[0m#x1B[96mself#x1B[39;49;00m._set_dim_df(value, #x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:776: in _set_dim_df
    #x1B[0mvalue = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:59: in _gen_dataframe_mapping
    #x1B[0mdf = pd.DataFrame(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../pandas/core/frame.py#x1B[0m:827: in __init__
    #x1B[0mdata = np.asarray(data)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <xarray.Dataset> Size: 4kB
Dimensions:         (concat_index: 100)
Coordinates:
  * concat_index    (concat_index) obj...t32 500B <NA> <NA> 23 -17 ... 22 <NA> -40
    nullable-uint8  (concat_index) UInt8 200B <NA> 213 <NA> ... 185 <NA> <NA>
dtype = None, copy = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__array__#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, dtype=#x1B[94mNone#x1B[39;49;00m, copy=#x1B[94mNone#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mcannot directly convert an xarray.Dataset into a #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mnumpy array. Instead, create an xarray.DataArray #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mfirst, either with indexing on the Dataset or by #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33minvoking the `to_dataarray()` method.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       TypeError: cannot directly convert an xarray.Dataset into a numpy array. Instead, create an xarray.DataArray first, either with indexing on the Dataset or by invoking the `to_dataarray()` method.#x1B[0m

#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../xarray/core/dataset.py#x1B[0m:1299: TypeError
tests.test_concatenate::test_concatenate_roundtrip[outer-sparse_dask_array-xarray-concat-in-memory-concatenate]
Stack Traces | 0.203s run time
join_type = 'outer'
array_type = functools.partial(<function _as_sparse_dask at 0x7f7fc8f56980>, typ=<class 'scipy.sparse._csr.csr_array'>)
concat_func = <function <lambda> at 0x7f7f846bc1a0>, backwards_compat = True
use_xdataset = True, force_lazy = False

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mconcat_func#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mbackwards_compat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            pytest.param(partial(concat, merge=#x1B[33m"#x1B[39;49;00m#x1B[33munique#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), #x1B[94mFalse#x1B[39;49;00m, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                #x1B[94mlambda#x1B[39;49;00m x, **kwargs: x[#x1B[94m0#x1B[39;49;00m].concatenate(x[#x1B[94m1#x1B[39;49;00m:], **kwargs),#x1B[90m#x1B[39;49;00m
                #x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                marks=mark_legacy_concatenate,#x1B[90m#x1B[39;49;00m
                #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcatenate#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_concatenate_roundtrip#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        join_type,#x1B[90m#x1B[39;49;00m
        array_type,#x1B[90m#x1B[39;49;00m
        concat_func,#x1B[90m#x1B[39;49;00m
        backwards_compat,#x1B[90m#x1B[39;49;00m
        use_xdataset,#x1B[90m#x1B[39;49;00m
        force_lazy,#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m force_lazy:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33munsupported#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        adata = gen_adata(#x1B[90m#x1B[39;49;00m
            (#x1B[94m100#x1B[39;49;00m, #x1B[94m10#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            X_type=array_type,#x1B[90m#x1B[39;49;00m
            obs_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            var_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            **GEN_ADATA_DASK_ARGS,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        remaining = adata.obs_names#x1B[90m#x1B[39;49;00m
        subsets = []#x1B[90m#x1B[39;49;00m
        #x1B[94mwhile#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(remaining) > #x1B[94m0#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            n = #x1B[96mmin#x1B[39;49;00m(#x1B[96mlen#x1B[39;49;00m(remaining), np.random.choice(#x1B[94m50#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
            subset_idx = np.random.choice(remaining, n, replace=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            subsets.append(adata[subset_idx])#x1B[90m#x1B[39;49;00m
            remaining = remaining.difference(subset_idx)#x1B[90m#x1B[39;49;00m
        result = concat_func(subsets, join=join_type, uns_merge=#x1B[33m"#x1B[39;49;00m#x1B[33msame#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, index_unique=#x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m use_xdataset:#x1B[90m#x1B[39;49;00m
            #x1B[94mimport#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxarray#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mas#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxr#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            result.var = Dataset2D(#x1B[90m#x1B[39;49;00m
                xr.Dataset.from_dataframe(result.var)#x1B[90m#x1B[39;49;00m
            )  #x1B[90m# backwards compat always returns a dataframe#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Correcting for known differences#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       orig, result = fix_known_differences(#x1B[90m#x1B[39;49;00m
            adata, result, backwards_compat=backwards_compat#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:277: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:176: in fix_known_differences
    #x1B[0mresult.obs = result.obs.ds.drop_vars([#x1B[33m"#x1B[39;49;00m#x1B[33mbatch#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:845: in obs
    #x1B[0m#x1B[96mself#x1B[39;49;00m._set_dim_df(value, #x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:776: in _set_dim_df
    #x1B[0mvalue = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:59: in _gen_dataframe_mapping
    #x1B[0mdf = pd.DataFrame(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../pandas/core/frame.py#x1B[0m:827: in __init__
    #x1B[0mdata = np.asarray(data)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <xarray.Dataset> Size: 4kB
Dimensions:         (concat_index: 100)
Coordinates:
  * concat_index    (concat_index) obj...t32 500B <NA> <NA> 23 -17 ... 22 <NA> -40
    nullable-uint8  (concat_index) UInt8 200B <NA> 213 <NA> ... 185 <NA> <NA>
dtype = None, copy = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__array__#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, dtype=#x1B[94mNone#x1B[39;49;00m, copy=#x1B[94mNone#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mcannot directly convert an xarray.Dataset into a #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mnumpy array. Instead, create an xarray.DataArray #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mfirst, either with indexing on the Dataset or by #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33minvoking the `to_dataarray()` method.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       TypeError: cannot directly convert an xarray.Dataset into a numpy array. Instead, create an xarray.DataArray first, either with indexing on the Dataset or by invoking the `to_dataarray()` method.#x1B[0m

#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../xarray/core/dataset.py#x1B[0m:1299: TypeError
tests.test_concatenate::test_concatenate_roundtrip[inner-dense_dask_array-xarray-concat-in-memory-concatenate]
Stack Traces | 0.204s run time
join_type = 'inner'
array_type = <function as_dense_dask_array at 0x7f7fc8f56350>
concat_func = <function <lambda> at 0x7f7f846bc1a0>, backwards_compat = True
use_xdataset = True, force_lazy = False

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mconcat_func#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mbackwards_compat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            pytest.param(partial(concat, merge=#x1B[33m"#x1B[39;49;00m#x1B[33munique#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), #x1B[94mFalse#x1B[39;49;00m, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                #x1B[94mlambda#x1B[39;49;00m x, **kwargs: x[#x1B[94m0#x1B[39;49;00m].concatenate(x[#x1B[94m1#x1B[39;49;00m:], **kwargs),#x1B[90m#x1B[39;49;00m
                #x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                marks=mark_legacy_concatenate,#x1B[90m#x1B[39;49;00m
                #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcatenate#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_concatenate_roundtrip#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        join_type,#x1B[90m#x1B[39;49;00m
        array_type,#x1B[90m#x1B[39;49;00m
        concat_func,#x1B[90m#x1B[39;49;00m
        backwards_compat,#x1B[90m#x1B[39;49;00m
        use_xdataset,#x1B[90m#x1B[39;49;00m
        force_lazy,#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m force_lazy:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33munsupported#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        adata = gen_adata(#x1B[90m#x1B[39;49;00m
            (#x1B[94m100#x1B[39;49;00m, #x1B[94m10#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            X_type=array_type,#x1B[90m#x1B[39;49;00m
            obs_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            var_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            **GEN_ADATA_DASK_ARGS,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        remaining = adata.obs_names#x1B[90m#x1B[39;49;00m
        subsets = []#x1B[90m#x1B[39;49;00m
        #x1B[94mwhile#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(remaining) > #x1B[94m0#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            n = #x1B[96mmin#x1B[39;49;00m(#x1B[96mlen#x1B[39;49;00m(remaining), np.random.choice(#x1B[94m50#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
            subset_idx = np.random.choice(remaining, n, replace=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            subsets.append(adata[subset_idx])#x1B[90m#x1B[39;49;00m
            remaining = remaining.difference(subset_idx)#x1B[90m#x1B[39;49;00m
        result = concat_func(subsets, join=join_type, uns_merge=#x1B[33m"#x1B[39;49;00m#x1B[33msame#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, index_unique=#x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m use_xdataset:#x1B[90m#x1B[39;49;00m
            #x1B[94mimport#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxarray#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mas#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxr#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            result.var = Dataset2D(#x1B[90m#x1B[39;49;00m
                xr.Dataset.from_dataframe(result.var)#x1B[90m#x1B[39;49;00m
            )  #x1B[90m# backwards compat always returns a dataframe#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Correcting for known differences#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       orig, result = fix_known_differences(#x1B[90m#x1B[39;49;00m
            adata, result, backwards_compat=backwards_compat#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:277: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:176: in fix_known_differences
    #x1B[0mresult.obs = result.obs.ds.drop_vars([#x1B[33m"#x1B[39;49;00m#x1B[33mbatch#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:845: in obs
    #x1B[0m#x1B[96mself#x1B[39;49;00m._set_dim_df(value, #x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:776: in _set_dim_df
    #x1B[0mvalue = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:59: in _gen_dataframe_mapping
    #x1B[0mdf = pd.DataFrame(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../pandas/core/frame.py#x1B[0m:827: in __init__
    #x1B[0mdata = np.asarray(data)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <xarray.Dataset> Size: 4kB
Dimensions:         (concat_index: 100)
Coordinates:
  * concat_index    (concat_index) obj...t32 500B <NA> <NA> 23 -17 ... 22 <NA> -40
    nullable-uint8  (concat_index) UInt8 200B <NA> 213 <NA> ... 185 <NA> <NA>
dtype = None, copy = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__array__#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, dtype=#x1B[94mNone#x1B[39;49;00m, copy=#x1B[94mNone#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mcannot directly convert an xarray.Dataset into a #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mnumpy array. Instead, create an xarray.DataArray #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mfirst, either with indexing on the Dataset or by #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33minvoking the `to_dataarray()` method.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       TypeError: cannot directly convert an xarray.Dataset into a numpy array. Instead, create an xarray.DataArray first, either with indexing on the Dataset or by invoking the `to_dataarray()` method.#x1B[0m

#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../xarray/core/dataset.py#x1B[0m:1299: TypeError
tests.test_concatenate::test_concatenate_roundtrip[inner-scipy_csr_array-xarray-concat-in-memory-concatenate]
Stack Traces | 0.209s run time
join_type = 'inner', array_type = <class 'scipy.sparse._csr.csr_array'>
concat_func = <function <lambda> at 0x7f7f846bc1a0>, backwards_compat = True
use_xdataset = True, force_lazy = False

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mconcat_func#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mbackwards_compat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            pytest.param(partial(concat, merge=#x1B[33m"#x1B[39;49;00m#x1B[33munique#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), #x1B[94mFalse#x1B[39;49;00m, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                #x1B[94mlambda#x1B[39;49;00m x, **kwargs: x[#x1B[94m0#x1B[39;49;00m].concatenate(x[#x1B[94m1#x1B[39;49;00m:], **kwargs),#x1B[90m#x1B[39;49;00m
                #x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                marks=mark_legacy_concatenate,#x1B[90m#x1B[39;49;00m
                #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcatenate#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_concatenate_roundtrip#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        join_type,#x1B[90m#x1B[39;49;00m
        array_type,#x1B[90m#x1B[39;49;00m
        concat_func,#x1B[90m#x1B[39;49;00m
        backwards_compat,#x1B[90m#x1B[39;49;00m
        use_xdataset,#x1B[90m#x1B[39;49;00m
        force_lazy,#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m force_lazy:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33munsupported#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        adata = gen_adata(#x1B[90m#x1B[39;49;00m
            (#x1B[94m100#x1B[39;49;00m, #x1B[94m10#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            X_type=array_type,#x1B[90m#x1B[39;49;00m
            obs_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            var_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            **GEN_ADATA_DASK_ARGS,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        remaining = adata.obs_names#x1B[90m#x1B[39;49;00m
        subsets = []#x1B[90m#x1B[39;49;00m
        #x1B[94mwhile#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(remaining) > #x1B[94m0#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            n = #x1B[96mmin#x1B[39;49;00m(#x1B[96mlen#x1B[39;49;00m(remaining), np.random.choice(#x1B[94m50#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
            subset_idx = np.random.choice(remaining, n, replace=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            subsets.append(adata[subset_idx])#x1B[90m#x1B[39;49;00m
            remaining = remaining.difference(subset_idx)#x1B[90m#x1B[39;49;00m
        result = concat_func(subsets, join=join_type, uns_merge=#x1B[33m"#x1B[39;49;00m#x1B[33msame#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, index_unique=#x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m use_xdataset:#x1B[90m#x1B[39;49;00m
            #x1B[94mimport#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxarray#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mas#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxr#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            result.var = Dataset2D(#x1B[90m#x1B[39;49;00m
                xr.Dataset.from_dataframe(result.var)#x1B[90m#x1B[39;49;00m
            )  #x1B[90m# backwards compat always returns a dataframe#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Correcting for known differences#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       orig, result = fix_known_differences(#x1B[90m#x1B[39;49;00m
            adata, result, backwards_compat=backwards_compat#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:277: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:176: in fix_known_differences
    #x1B[0mresult.obs = result.obs.ds.drop_vars([#x1B[33m"#x1B[39;49;00m#x1B[33mbatch#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:845: in obs
    #x1B[0m#x1B[96mself#x1B[39;49;00m._set_dim_df(value, #x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:776: in _set_dim_df
    #x1B[0mvalue = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:59: in _gen_dataframe_mapping
    #x1B[0mdf = pd.DataFrame(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../pandas/core/frame.py#x1B[0m:827: in __init__
    #x1B[0mdata = np.asarray(data)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <xarray.Dataset> Size: 4kB
Dimensions:         (concat_index: 100)
Coordinates:
  * concat_index    (concat_index) obj...t32 500B <NA> <NA> 23 -17 ... 22 <NA> -40
    nullable-uint8  (concat_index) UInt8 200B <NA> 213 <NA> ... 185 <NA> <NA>
dtype = None, copy = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__array__#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, dtype=#x1B[94mNone#x1B[39;49;00m, copy=#x1B[94mNone#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mcannot directly convert an xarray.Dataset into a #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mnumpy array. Instead, create an xarray.DataArray #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mfirst, either with indexing on the Dataset or by #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33minvoking the `to_dataarray()` method.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       TypeError: cannot directly convert an xarray.Dataset into a numpy array. Instead, create an xarray.DataArray first, either with indexing on the Dataset or by invoking the `to_dataarray()` method.#x1B[0m

#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../xarray/core/dataset.py#x1B[0m:1299: TypeError
tests.test_concatenate::test_concatenate_roundtrip[outer-dense_dask_array-xarray-concat-in-memory-concatenate]
Stack Traces | 0.223s run time
join_type = 'outer'
array_type = <function as_dense_dask_array at 0x7f7fc8f56350>
concat_func = <function <lambda> at 0x7f7f846bc1a0>, backwards_compat = True
use_xdataset = True, force_lazy = False

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mconcat_func#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mbackwards_compat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            pytest.param(partial(concat, merge=#x1B[33m"#x1B[39;49;00m#x1B[33munique#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), #x1B[94mFalse#x1B[39;49;00m, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                #x1B[94mlambda#x1B[39;49;00m x, **kwargs: x[#x1B[94m0#x1B[39;49;00m].concatenate(x[#x1B[94m1#x1B[39;49;00m:], **kwargs),#x1B[90m#x1B[39;49;00m
                #x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                marks=mark_legacy_concatenate,#x1B[90m#x1B[39;49;00m
                #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcatenate#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_concatenate_roundtrip#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        join_type,#x1B[90m#x1B[39;49;00m
        array_type,#x1B[90m#x1B[39;49;00m
        concat_func,#x1B[90m#x1B[39;49;00m
        backwards_compat,#x1B[90m#x1B[39;49;00m
        use_xdataset,#x1B[90m#x1B[39;49;00m
        force_lazy,#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m force_lazy:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33munsupported#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        adata = gen_adata(#x1B[90m#x1B[39;49;00m
            (#x1B[94m100#x1B[39;49;00m, #x1B[94m10#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            X_type=array_type,#x1B[90m#x1B[39;49;00m
            obs_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            var_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            **GEN_ADATA_DASK_ARGS,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        remaining = adata.obs_names#x1B[90m#x1B[39;49;00m
        subsets = []#x1B[90m#x1B[39;49;00m
        #x1B[94mwhile#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(remaining) > #x1B[94m0#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            n = #x1B[96mmin#x1B[39;49;00m(#x1B[96mlen#x1B[39;49;00m(remaining), np.random.choice(#x1B[94m50#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
            subset_idx = np.random.choice(remaining, n, replace=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            subsets.append(adata[subset_idx])#x1B[90m#x1B[39;49;00m
            remaining = remaining.difference(subset_idx)#x1B[90m#x1B[39;49;00m
        result = concat_func(subsets, join=join_type, uns_merge=#x1B[33m"#x1B[39;49;00m#x1B[33msame#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, index_unique=#x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m use_xdataset:#x1B[90m#x1B[39;49;00m
            #x1B[94mimport#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxarray#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mas#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxr#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            result.var = Dataset2D(#x1B[90m#x1B[39;49;00m
                xr.Dataset.from_dataframe(result.var)#x1B[90m#x1B[39;49;00m
            )  #x1B[90m# backwards compat always returns a dataframe#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Correcting for known differences#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       orig, result = fix_known_differences(#x1B[90m#x1B[39;49;00m
            adata, result, backwards_compat=backwards_compat#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:277: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:176: in fix_known_differences
    #x1B[0mresult.obs = result.obs.ds.drop_vars([#x1B[33m"#x1B[39;49;00m#x1B[33mbatch#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:845: in obs
    #x1B[0m#x1B[96mself#x1B[39;49;00m._set_dim_df(value, #x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:776: in _set_dim_df
    #x1B[0mvalue = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:59: in _gen_dataframe_mapping
    #x1B[0mdf = pd.DataFrame(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../pandas/core/frame.py#x1B[0m:827: in __init__
    #x1B[0mdata = np.asarray(data)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <xarray.Dataset> Size: 4kB
Dimensions:         (concat_index: 100)
Coordinates:
  * concat_index    (concat_index) obj...t32 500B <NA> <NA> 23 -17 ... 22 <NA> -40
    nullable-uint8  (concat_index) UInt8 200B <NA> 213 <NA> ... 185 <NA> <NA>
dtype = None, copy = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__array__#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, dtype=#x1B[94mNone#x1B[39;49;00m, copy=#x1B[94mNone#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mcannot directly convert an xarray.Dataset into a #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mnumpy array. Instead, create an xarray.DataArray #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mfirst, either with indexing on the Dataset or by #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33minvoking the `to_dataarray()` method.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       TypeError: cannot directly convert an xarray.Dataset into a numpy array. Instead, create an xarray.DataArray first, either with indexing on the Dataset or by invoking the `to_dataarray()` method.#x1B[0m

#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../xarray/core/dataset.py#x1B[0m:1299: TypeError
tests.test_concatenate::test_concatenate_roundtrip[outer-scipy_csc_matrix-xarray-concat-in-memory-concatenate]
Stack Traces | 0.224s run time
join_type = 'outer', array_type = <class 'scipy.sparse._csc.csc_matrix'>
concat_func = <function <lambda> at 0x7f7f846bc1a0>, backwards_compat = True
use_xdataset = True, force_lazy = False

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mconcat_func#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mbackwards_compat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            pytest.param(partial(concat, merge=#x1B[33m"#x1B[39;49;00m#x1B[33munique#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), #x1B[94mFalse#x1B[39;49;00m, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                #x1B[94mlambda#x1B[39;49;00m x, **kwargs: x[#x1B[94m0#x1B[39;49;00m].concatenate(x[#x1B[94m1#x1B[39;49;00m:], **kwargs),#x1B[90m#x1B[39;49;00m
                #x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                marks=mark_legacy_concatenate,#x1B[90m#x1B[39;49;00m
                #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcatenate#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_concatenate_roundtrip#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        join_type,#x1B[90m#x1B[39;49;00m
        array_type,#x1B[90m#x1B[39;49;00m
        concat_func,#x1B[90m#x1B[39;49;00m
        backwards_compat,#x1B[90m#x1B[39;49;00m
        use_xdataset,#x1B[90m#x1B[39;49;00m
        force_lazy,#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m force_lazy:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33munsupported#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        adata = gen_adata(#x1B[90m#x1B[39;49;00m
            (#x1B[94m100#x1B[39;49;00m, #x1B[94m10#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            X_type=array_type,#x1B[90m#x1B[39;49;00m
            obs_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            var_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            **GEN_ADATA_DASK_ARGS,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        remaining = adata.obs_names#x1B[90m#x1B[39;49;00m
        subsets = []#x1B[90m#x1B[39;49;00m
        #x1B[94mwhile#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(remaining) > #x1B[94m0#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            n = #x1B[96mmin#x1B[39;49;00m(#x1B[96mlen#x1B[39;49;00m(remaining), np.random.choice(#x1B[94m50#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
            subset_idx = np.random.choice(remaining, n, replace=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            subsets.append(adata[subset_idx])#x1B[90m#x1B[39;49;00m
            remaining = remaining.difference(subset_idx)#x1B[90m#x1B[39;49;00m
        result = concat_func(subsets, join=join_type, uns_merge=#x1B[33m"#x1B[39;49;00m#x1B[33msame#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, index_unique=#x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m use_xdataset:#x1B[90m#x1B[39;49;00m
            #x1B[94mimport#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxarray#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mas#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxr#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            result.var = Dataset2D(#x1B[90m#x1B[39;49;00m
                xr.Dataset.from_dataframe(result.var)#x1B[90m#x1B[39;49;00m
            )  #x1B[90m# backwards compat always returns a dataframe#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Correcting for known differences#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       orig, result = fix_known_differences(#x1B[90m#x1B[39;49;00m
            adata, result, backwards_compat=backwards_compat#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:277: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:176: in fix_known_differences
    #x1B[0mresult.obs = result.obs.ds.drop_vars([#x1B[33m"#x1B[39;49;00m#x1B[33mbatch#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:845: in obs
    #x1B[0m#x1B[96mself#x1B[39;49;00m._set_dim_df(value, #x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:776: in _set_dim_df
    #x1B[0mvalue = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:59: in _gen_dataframe_mapping
    #x1B[0mdf = pd.DataFrame(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../pandas/core/frame.py#x1B[0m:827: in __init__
    #x1B[0mdata = np.asarray(data)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <xarray.Dataset> Size: 4kB
Dimensions:         (concat_index: 100)
Coordinates:
  * concat_index    (concat_index) obj...t32 500B <NA> <NA> 23 -17 ... 22 <NA> -40
    nullable-uint8  (concat_index) UInt8 200B <NA> 213 <NA> ... 185 <NA> <NA>
dtype = None, copy = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__array__#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, dtype=#x1B[94mNone#x1B[39;49;00m, copy=#x1B[94mNone#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mcannot directly convert an xarray.Dataset into a #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mnumpy array. Instead, create an xarray.DataArray #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mfirst, either with indexing on the Dataset or by #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33minvoking the `to_dataarray()` method.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       TypeError: cannot directly convert an xarray.Dataset into a numpy array. Instead, create an xarray.DataArray first, either with indexing on the Dataset or by invoking the `to_dataarray()` method.#x1B[0m

#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../xarray/core/dataset.py#x1B[0m:1299: TypeError
tests.lazy.test_read::test_access_counts_obsm_df
Stack Traces | 0.23s run time
tmp_path = PosixPath('.../pytest-0/popen-gw0/test_access_counts_obsm_df0')

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_access_counts_obsm_df#x1B[39;49;00m(tmp_path: Path):#x1B[90m#x1B[39;49;00m
        adata = AnnData(#x1B[90m#x1B[39;49;00m
            X=np.array(np.random.rand(#x1B[94m100#x1B[39;49;00m, #x1B[94m20#x1B[39;49;00m)),#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
        adata.obsm[#x1B[33m"#x1B[39;49;00m#x1B[33mdf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = pd.DataFrame(#x1B[90m#x1B[39;49;00m
            {#x1B[33m"#x1B[39;49;00m#x1B[33mcol1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: np.random.rand(#x1B[94m100#x1B[39;49;00m), #x1B[33m"#x1B[39;49;00m#x1B[33mcol2#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: np.random.rand(#x1B[94m100#x1B[39;49;00m)},#x1B[90m#x1B[39;49;00m
            index=adata.obs_names,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
        adata.write_zarr(tmp_path)#x1B[90m#x1B[39;49;00m
        store = AccessTrackingStore(tmp_path, read_only=#x1B[94mTrue#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        store.initialize_key_trackers([#x1B[33m"#x1B[39;49;00m#x1B[33mobsm/df#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
>       read_lazy(store, load_annotation_index=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/lazy/test_read.py#x1B[0m:146: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[.../anndata/_core/xarray.py#x1B[0m:37: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*args, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../experimental/backed/_io.py#x1B[0m:163: in read_lazy
    #x1B[0madata: AnnData = read_dispatched(f, callback=callback)#x1B[90m#x1B[39;49;00m
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/experimental/_dispatch_io.py#x1B[0m:39: in read_dispatched
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m reader.read_elem(elem)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_io/utils.py#x1B[0m:234: in func_wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m func(*args, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../_io/specs/registry.py#x1B[0m:284: in read_elem
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.callback(read_func, elem.name, elem, iospec=iospec)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../experimental/backed/_io.py#x1B[0m:135: in callback
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m AnnData(**{k: read_dispatched(v, callback) #x1B[94mfor#x1B[39;49;00m k, v #x1B[95min#x1B[39;49;00m iter_object})#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:256: in __init__
    #x1B[0m#x1B[96mself#x1B[39;49;00m._init_as_actual(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:451: in _init_as_actual
    #x1B[0m#x1B[96mself#x1B[39;49;00m._obs = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:96: in _gen_dataframe_df
    #x1B[0manno.columns = pandas_as_str(anno.columns)#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/xarray.py#x1B[0m:288: in columns
    #x1B[0mwarn(#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

msg = 'Renaming or reordering columns on `Dataset2D` has no effect because the underlying data structure has no apparent ordering on its keys'
category = <class 'UserWarning'>, source = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mwarn#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        msg: #x1B[96mstr#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        category: #x1B[96mtype#x1B[39;49;00m[#x1B[96mWarning#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        source: Any = #x1B[94mNone#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        *,#x1B[90m#x1B[39;49;00m
        skip_file_prefixes: #x1B[96mtuple#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, ...] = (),#x1B[90m#x1B[39;49;00m
        more_file_prefixes: #x1B[96mtuple#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, ...] = (),#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m skip_file_prefixes:#x1B[90m#x1B[39;49;00m
            skip_file_prefixes = (*_FILE_PREFIXES, *more_file_prefixes)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m more_file_prefixes:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33m"#x1B[39;49;00m#x1B[33mCannot specify both `skip_file_prefixes` and `more_file_prefixes`#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(msg)#x1B[90m#x1B[39;49;00m
>       warnings.warn(msg, category, source=source, skip_file_prefixes=skip_file_prefixes)  #x1B[90m# noqa: TID251#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       UserWarning: Renaming or reordering columns on `Dataset2D` has no effect because the underlying data structure has no apparent ordering on its keys#x1B[0m
#x1B[1m#x1B[31mE       Error raised while reading key '' of <class 'zarr.core.group.Group'> from /#x1B[0m

#x1B[1m#x1B[31msrc/anndata/_warnings.py#x1B[0m:65: UserWarning
tests.test_concatenate::test_concatenate_roundtrip[inner-scipy_csc_array-xarray-concat-in-memory-concatenate]
Stack Traces | 0.299s run time
join_type = 'inner', array_type = <class 'scipy.sparse._csc.csc_array'>
concat_func = <function <lambda> at 0x7f7f846bc1a0>, backwards_compat = True
use_xdataset = True, force_lazy = False

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mconcat_func#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mbackwards_compat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            pytest.param(partial(concat, merge=#x1B[33m"#x1B[39;49;00m#x1B[33munique#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), #x1B[94mFalse#x1B[39;49;00m, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcat#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                #x1B[94mlambda#x1B[39;49;00m x, **kwargs: x[#x1B[94m0#x1B[39;49;00m].concatenate(x[#x1B[94m1#x1B[39;49;00m:], **kwargs),#x1B[90m#x1B[39;49;00m
                #x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                marks=mark_legacy_concatenate,#x1B[90m#x1B[39;49;00m
                #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mconcatenate#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_concatenate_roundtrip#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        join_type,#x1B[90m#x1B[39;49;00m
        array_type,#x1B[90m#x1B[39;49;00m
        concat_func,#x1B[90m#x1B[39;49;00m
        backwards_compat,#x1B[90m#x1B[39;49;00m
        use_xdataset,#x1B[90m#x1B[39;49;00m
        force_lazy,#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m force_lazy:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33munsupported#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        adata = gen_adata(#x1B[90m#x1B[39;49;00m
            (#x1B[94m100#x1B[39;49;00m, #x1B[94m10#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            X_type=array_type,#x1B[90m#x1B[39;49;00m
            obs_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            var_xdataset=use_xdataset,#x1B[90m#x1B[39;49;00m
            **GEN_ADATA_DASK_ARGS,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        remaining = adata.obs_names#x1B[90m#x1B[39;49;00m
        subsets = []#x1B[90m#x1B[39;49;00m
        #x1B[94mwhile#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(remaining) > #x1B[94m0#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            n = #x1B[96mmin#x1B[39;49;00m(#x1B[96mlen#x1B[39;49;00m(remaining), np.random.choice(#x1B[94m50#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
            subset_idx = np.random.choice(remaining, n, replace=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            subsets.append(adata[subset_idx])#x1B[90m#x1B[39;49;00m
            remaining = remaining.difference(subset_idx)#x1B[90m#x1B[39;49;00m
        result = concat_func(subsets, join=join_type, uns_merge=#x1B[33m"#x1B[39;49;00m#x1B[33msame#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, index_unique=#x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m backwards_compat #x1B[95mand#x1B[39;49;00m use_xdataset:#x1B[90m#x1B[39;49;00m
            #x1B[94mimport#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxarray#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mas#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mxr#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            result.var = Dataset2D(#x1B[90m#x1B[39;49;00m
                xr.Dataset.from_dataframe(result.var)#x1B[90m#x1B[39;49;00m
            )  #x1B[90m# backwards compat always returns a dataframe#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Correcting for known differences#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       orig, result = fix_known_differences(#x1B[90m#x1B[39;49;00m
            adata, result, backwards_compat=backwards_compat#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:277: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31mtests/test_concatenate.py#x1B[0m:176: in fix_known_differences
    #x1B[0mresult.obs = result.obs.ds.drop_vars([#x1B[33m"#x1B[39;49;00m#x1B[33mbatch#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    ^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:845: in obs
    #x1B[0m#x1B[96mself#x1B[39;49;00m._set_dim_df(value, #x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:776: in _set_dim_df
    #x1B[0mvalue = _gen_dataframe(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.14.2-linux-x86_64-gnu/lib/python3.14/functools.py#x1B[0m:982: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dispatch(args[#x1B[94m0#x1B[39;49;00m].#x1B[91m__class__#x1B[39;49;00m)(*args, **kw)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/aligned_df.py#x1B[0m:59: in _gen_dataframe_mapping
    #x1B[0mdf = pd.DataFrame(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../pandas/core/frame.py#x1B[0m:827: in __init__
    #x1B[0mdata = np.asarray(data)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <xarray.Dataset> Size: 4kB
Dimensions:         (concat_index: 100)
Coordinates:
  * concat_index    (concat_index) obj...t32 500B <NA> <NA> 23 -17 ... 22 <NA> -40
    nullable-uint8  (concat_index) UInt8 200B <NA> 213 <NA> ... 185 <NA> <NA>
dtype = None, copy = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__array__#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, dtype=#x1B[94mNone#x1B[39;49;00m, copy=#x1B[94mNone#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m #x1B[96mTypeError#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mcannot directly convert an xarray.Dataset into a #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mnumpy array. Instead, create an xarray.DataArray #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mfirst, either with indexing on the Dataset or by #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33minvoking the `to_dataarray()` method.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       TypeError: cannot directly convert an xarray.Dataset into a numpy array. Instead, create an xarray.DataArray first, either with indexing on the Dataset or by invoking the `to_dataarray()` method.#x1B[0m

#x1B[1m#x1B[31m../../../..../anndata/88DSKUwu/hatch-test.stable/lib/python3.14.../xarray/core/dataset.py#x1B[0m:1299: TypeError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@ilan-gold ilan-gold modified the milestones: 0.12.10, 0.13.0 Feb 4, 2026


class Dataset2D(Mapping[Hashable, XDataArray | Self]):
class Dataset2D:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

adopt __dataframe__ protocol in a meaningful way ideally for writing, but potentially as a solution to the above to cases

So will Dataset2D eventually support the __dataframe__ protocol?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So will Dataset2D eventually support the dataframe protocol?

Mmmm depends if I actually implement its use here unless you have a use-case (you probably do?). In theory, I don't see why not but I haven't actually investigated what would go into that. There hasn't even been activity in the repo that hosts the protocols for like 2 years but it is documented on the arrow website: https://arrow.apache.org/docs/python/interchange_protocol.html

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks like in DataFrame land people have been using PyCapsule for an interchange as of late, here it is in pandas

Specifically Pandas seem to be fully onboard with the Arrow PyCapsule interface.

For new development, we highly recommend using the Arrow C Data Interface alongside the Arrow PyCapsule Interface instead of the interchange protocol. From pandas 3.0 onwards, from_dataframe uses the PyCapsule Interface, only falling back to the interchange protocol if that fails.

From pandas 4.0 onwards, that fallback will no longer be available and only the PyCapsule Interface will be used.

I guess with this now, do you think __dataframe__ is still worth your time and effort, if you'll have to add some backwards compatibility or special handling come pandas 4?

data-apis/dataframe-api#363

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I guess with this now, do you think dataframe is still worth your time and effort, if you'll have to add some backwards compatibility or special handling come pandas 4?

I'm definitely not tied to the idea, so if that is the better interchange, we should use that instead. Thanks for pointing this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DataFrame API for obs and var keys via runtime-checkable Protocol Native support for cuPy/cuDF backed Anndata

2 participants