Skip to content

Fix render_shapes crash when obs index name conflicts with column#558

Open
timtreis wants to merge 1 commit intomainfrom
fix/issue-441-conflicting-index-name
Open

Fix render_shapes crash when obs index name conflicts with column#558
timtreis wants to merge 1 commit intomainfrom
fix/issue-441-conflicting-index-name

Conversation

@timtreis
Copy link
Member

@timtreis timtreis commented Mar 25, 2026

Summary

  • Workaround for upstream spatialdata bug (join_spatialelement_table crashes when obs index name matches an existing column spatialdata#1099) where join_spatialelement_table calls table.obs.reset_index() without handling the case where the index name already exists as a column
  • Affects Merfish data where EntityID is both the obs index name and a column, causing ValueError: cannot insert EntityID, already exists when calling render_shapes(color=...)
  • Temporarily drops the conflicting index name before the join call and restores it via try/finally

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.94%. Comparing base (edca5a5) to head (577235e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #558      +/-   ##
==========================================
+ Coverage   73.89%   73.94%   +0.05%     
==========================================
  Files          10       10              
  Lines        2777     2783       +6     
  Branches      645      646       +1     
==========================================
+ Hits         2052     2058       +6     
  Misses        451      451              
  Partials      274      274              
Files with missing lines Coverage Δ
src/spatialdata_plot/pl/render.py 82.34% <100.00%> (+0.19%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants