Table `region_key` column is not `categorical` anymore after `concatenate()`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 394
- Forks
- 95
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 7
Description
While working on the Lundeberg data I have a list of SpatialData objects for which the table has a region_key column with a categorical dtype. After concatenating the table I get a table which has dtype object for that column.
I am simply doing
sdata_patient1_visium_expression.table.obs['region'] = sdata_patient1_visium_expression.table.obs['region'].astype('category')
for the moment, but we'll have to fix this (I think the problem is concatenate() but I haven't investigated), add tests, and remove the line above from the Lundeberg notebook.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the concatenate() entry point used for the list of SpatialData tables and inspect how the table.obs region_key column's categorical dtype is handled. Add regression tests for concatenation, then remove the astype('category') workaround from the Lundeberg notebook and confirm the concatenated column remains categorical.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100