Skip to content

Fix bug unserializable attrs new pyarrow - #1003

Merged
LucaMarconato merged 2 commits into
mainfrom
fix/pyarrow_attrs
Oct 27, 2025
Merged

LucaMarconato merged 2 commits into
mainfrom
fix/pyarrow_attrs

Conversation

@LucaMarconato

Copy link
Copy Markdown
Member

Fix for #1000, which replaces the temporary fix added in #1002

@LucaMarconato

Copy link
Copy Markdown
Member Author

The bug was caused by newer versions of pyarrow starting to serialize .attrs (previously they were ignored). Specifically the problem was with transformations objects included in .attrs. These objects aren’t automatically JSON-serializable as they need an explicit conversion like json.dumps(my_transformation.to_ngff(...).to_dict()). When pyarrow attempted to serialize these objects into Parquet, it failed. Since we don’t want these transformation classes in the .parquet file anyway (they belong in Zarr metadata), the fix was to discard .attrs before writing to Parquet so pyarrow wouldn’t try to serialize them.

@codecov

codecov Bot commented Oct 27, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.11%. Comparing base (28e4975) to head (8228b52).
⚠️ Report is 29 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1003   +/-   ##
=======================================
  Coverage   92.11%   92.11%           
=======================================
  Files          48       48           
  Lines        7440     7442    +2     
=======================================
+ Hits         6853     6855    +2     
  Misses        587      587           
Files with missing lines Coverage Δ
src/spatialdata/_io/io_points.py 97.67% <100.00%> (+0.11%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LucaMarconato
LucaMarconato merged commit 2445eb7 into main Oct 27, 2025
2 checks passed
@LucaMarconato
LucaMarconato deleted the fix/pyarrow_attrs branch October 27, 2025 12:34
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.

1 participant