Skip to content

CI: test_cellxgene_adata fails — cellxgene-census AnnData now exposes a layers entry (live-data drift) #265

Description

@Elarwei001

Summary

The live integration test tests/test_cellxgene.py::TestCellxgene::test_cellxgene_adata currently fails on CI (all of py3.12 / py3.13 / py3.14). This is an upstream live-data / dependency drift, not caused by any code change in gget — it surfaces on unrelated PRs (e.g. #233, whose own changes are entirely in gget ucsc + docs).

Symptom

FAILED tests/test_cellxgene.py::TestCellxgene::test_cellxgene_adata
  AssertionError: {... 'layers': [None]} != {...}
  - {'layers': [None], ...}
tests/test_cellxgene.py:53: AssertionError

The actual result now contains an extra 'layers': [None] entry that the expected fixture does not.

Root cause

test_cellxgene_adata calls cellxgene(...), converts the returned AnnData to a dict via repr_dict(), and compares it to expected_result in tests/fixtures/test_cellxgene.json.

repr_dict() includes an attribute only when list(getattr(adata, attr).keys()) is non-empty. cellxgene_census.get_anndata(...) now returns an AnnData whose .layers contains a single entry keyed None, so list(adata.layers.keys()) is [None] and repr_dict adds "layers": [None]. The stored expected_result predates this, so the exact-dict comparison fails.

Timeline (confirms it is drift, not a regression)

  • The last CI run on dev (2026-06-28, "Bump dev version") was green, so this test passed then.
  • It fails on runs from 2026-07-08 onward → the change is in the upstream cellxgene-census data/library, independent of any gget commit.

Suggested fix

Prefer aligning the test with the new stable reality rather than loosening the assertion:

  • Update expected_result in tests/fixtures/test_cellxgene.json to include the new "layers": [None], or
  • If the None-keyed layer is considered noise, have repr_dict() drop a layer whose only key is None (and document why), so the comparison stays on the meaningful structure (obs / var / counts).

Reproduce

# with cellxgene-census installed
pytest tests/test_cellxgene.py::TestCellxgene::test_cellxgene_adata

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