Skip to content

CLI write path fails on anndata >= 0.11: allow_write_nullable_strings is False #23

Closed

Description

@settylab-dotto-bot

Surfaced while running the full suite for #22 (settylab/dotto-nexus#310 work); not caused by
that branch
— it reproduces at 19ee1a1 in a clean worktree. Filing rather than working around
it, per the lab-tool routing contract.

Symptom

49 tests fail in tests/test_cli.py, tests/test_cli_compute_config.py,
tests/test_cli_dm_coverage.py and tests/test_cli_smooth.py, all with the same error:

RuntimeError: `anndata.settings.allow_write_nullable_strings` is False, because writing of
`pd.arrays.StringArray` is new and not supported in anndata < 0.11, still use by many people.
Opt-in to writing these arrays by toggling the setting to True.

Minimal repro:

python -m pytest tests/test_cli_smooth.py::TestCLISmooth::test_smooth_basic

Scope

Environment: anndata 0.12.6, kompot 0.8.0 @19ee1a1, Python 3.13.5. The rest of the suite is
green (2,021 passed, 32 skipped) — this is confined to the CLI's .h5ad write path.

The CLI writes a var/obs column backed by a pandas StringArray, which anndata refuses to
write unless the caller opts in. Because it is the writing side, the failure only shows up in
the CLI tests; the library API paths never hit it.

Why it matters beyond the tests

If the CLI genuinely cannot write its output under a current anndata, kompot de / kompot da /
kompot smooth are broken for anyone on anndata >= 0.11 with default settings, not just in CI.
Worth confirming against a real invocation before deciding whether this is a test-fixture issue or
a user-facing one — I have not done that, since it is outside the scope of the work that surfaced
it.

Likely fixes

Either coerce the offending column to object/category before writing, or set
anndata.settings.allow_write_nullable_strings = True at the CLI's write site (narrow, explicit)
rather than globally at import.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions