spatialdata icon indicating copy to clipboard operation
spatialdata copied to clipboard

Include name of index column for Parquet tables in `spatialdata_attrs` for shapes/points

Open keller-mark opened this issue 4 months ago • 0 comments

Is your feature request related to a problem? Please describe.

When accessing the Parquet data for points and shapes on-disk (for Vitessce), it is currently unclear which column of the Parquet table to treat as the dataframe index column.

Describe the solution you'd like

Similar to how AnnData's on-disk representation for dataframes (e.g., adata.obs) specifies the name of the index column in the Zarr attributes _index field, SpatialData could do this as well, with an _index field in the spatialdata_attrs metadata.

Image

My current workaround is to look for the field index_columns of the Parquet tables' pandas metadata, but it is unclear to me if this will always work as I do not see this documented. This approach also requires loading the Parquet table schema first, whereas storing in .zattrs would allow to directly specify Parquet columns to load (without always needing to load the Parquet metadata as a first step).

Image

Describe alternatives you've considered Continue to use the pandas metadata and document it in the Design Doc.

keller-mark avatar Jul 18 '25 19:07 keller-mark