single-cell-data / TileDB-SOMA

Python and R SOMA APIs using TileDB’s cloud-native format. Ideal for single-cell data at any scale.
https://tiledbsoma.readthedocs.io
MIT License
90 stars 25 forks source link

[c++] Fix bug in `nnz` of variant-indexed dataframes #2990

Closed johnkerl closed 4 weeks ago

johnkerl commented 1 month ago

Issue and/or context: Pre-existing bug found while working on issue #2407 / [sc-51048].

I ran sdf.count() on a variant-indexed dataframe which has dim0 being a string (which the spec allows even though most users don't take advantage of this). I got the error

[TileDB::FragmentInfo] Error: Cannot get non-empty domain; Dimension is variable-sized

There is a repro now built into the unit-test cases on this PR.

Changes:

Only use the code that assumes dim0 is int64 soma_joinid when that is in fact the case.

Notes for Reviewer:

johnkerl commented 1 month ago

Leaving in draft while I address a unit-test failure

codecov[bot] commented 4 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 89.79%. Comparing base (4a13a82) to head (265c9b4). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2990 +/- ## ========================================== + Coverage 89.64% 89.79% +0.14% ========================================== Files 40 40 Lines 4096 4096 ========================================== + Hits 3672 3678 +6 + Misses 424 418 -6 ``` | [Flag](https://app.codecov.io/gh/single-cell-data/TileDB-SOMA/pull/2990/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=single-cell-data) | Coverage Δ | | |---|---|---| | [python](https://app.codecov.io/gh/single-cell-data/TileDB-SOMA/pull/2990/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=single-cell-data) | `89.79% <ø> (+0.14%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=single-cell-data#carryforward-flags-in-the-pull-request-comment) to find out more. | [Components](https://app.codecov.io/gh/single-cell-data/TileDB-SOMA/pull/2990/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=single-cell-data) | Coverage Δ | | |---|---|---| | [python_api](https://app.codecov.io/gh/single-cell-data/TileDB-SOMA/pull/2990/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=single-cell-data) | `89.79% <ø> (+0.14%)` | :arrow_up: | | [libtiledbsoma](https://app.codecov.io/gh/single-cell-data/TileDB-SOMA/pull/2990/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=single-cell-data) | `∅ <ø> (∅)` | |