Skip to content

fix: point table validation to public sanitizer - #1165

Merged
LucaMarconato merged 2 commits into
scverse:mainfrom
stanbot8:fix/1154-sanitize-table-path
Aug 19, 2026
Merged

fix: point table validation to public sanitizer#1165
LucaMarconato merged 2 commits into
scverse:mainfrom
stanbot8:fix/1154-sanitize-table-path

Conversation

@stanbot8

@stanbot8 stanbot8 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

The table-name validation error in issue #1154 points to spatialdata.utils.sanitize_table(adata). This path does not exist. The error now points to spatialdata.sanitize_table(adata). Closes #1154.

Design

Use the top-level function that spatialdata exports. Keep validation and sanitization behavior unchanged.

The implementation changes src/spatialdata/_core/validation.py.

Tests

The regression test fails on main and passes on this branch. The full suite passes with 1,365 tests, 7 skips, and 1 expected failure. The installed wheel passes the reported sanitize-and-validate workflow.

The tests are in tests/models/test_models.py.

All 7 CPU matrix jobs passed.

Commands
uv run pytest tests/models/test_models.py::TestModels::test_table_model_invalid_name_suggests_public_sanitizer -q

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.41%. Comparing base (79c30c5) to head (0b9feb6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1165   +/-   ##
=======================================
  Coverage   92.41%   92.41%           
=======================================
  Files          52       52           
  Lines        7874     7874           
=======================================
  Hits         7277     7277           
  Misses        597      597           
Files with missing lines Coverage Δ
src/spatialdata/_core/validation.py 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stanbot8
stanbot8 marked this pull request as ready for review July 24, 2026 09:46
@stanbot8
stanbot8 force-pushed the fix/1154-sanitize-table-path branch from 35c771b to 63a5780 Compare July 24, 2026 13:16
@LucaMarconato
LucaMarconato enabled auto-merge (squash) August 19, 2026 11:45
Comment on lines +632 to +633
ValidationError,
match=r"`spatialdata\.sanitize_table\(adata\)`",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good, gonna decrease the coverage a bit.

@LucaMarconato
LucaMarconato merged commit 0d8ab85 into scverse:main Aug 19, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error message points to wrong path

2 participants