You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This whole message is AI-generated. The issue was automatically discovered and reported by an AI agent (Claude) during an autonomous bug hunt on the spatialdata code base. It has not been verified or triaged by a human yet; the needs: triage label is set so that a maintainer can confirm it. The reproduction script below was executed by the agent in an isolated environment (see Environment) and its output is pasted verbatim.
Summary
Overwriting a Dask-backed element in place is rightly refused, but the same refusal applies to a plain in-memory AnnData table or GeoDataFrame, where no backing files are involved (_backed_elements_contained_in_path already knows this). Users must follow the workarounds of discussion #520 (write under a new name and rename, or delete_element_from_disk + write_element with a data-loss window).
Severity (agent's assessment): medium (usability / misleading API) — the behaviour is intentional and tested, so this is filed as a missing feature
Where:src/spatialdata/_core/spatialdata.py::_validate_can_safely_write_to_path (raises for any element path inside the object's own store when saving_an_element=True) and the write_element docstring ('overwrite: If True, overwrite the element if it already exists')
Expected behaviour
In-place overwrite for elements without Dask backing inside the target path (write to a temporary sibling group, then atomic replace + re-consolidate); keep the refusal for Dask-backed elements. Until then, document in the overwrite docstring that overwriting inside the backing store is refused.
Reproduction
Save as repro.py and run uv run repro.py (the PEP 723 header pins spatialdata to the commit the bug was found on; replace the URL fragment with @main to test the current main branch).
first write_element('t'): OK
write_element('t', overwrite=True): ValueError Cannot overwrite. The target path of the write operation is in use. Please save the data to a differ
VERDICT: BEHAVIOUR REPRODUCED (overwrite refused for an in-memory table)
Possible fix direction (unverified)
See above.
Environment
uv run repro.py with the PEP 723 metadata in the script (fresh, isolated environment; spatialdata built from main @ ccf1ea0 (2026-08-28); Python 3.13, latest releases of the dependencies at run time: pandas 3.0, anndata 0.13, zarr 3.3, dask 2026.8, numpy 2.5, geopandas 1.1, shapely 2.1). macOS (arm64). Also reproduced in a second environment with pandas 2.3.3 / anndata 0.12.11 / numpy 2.4.4 / zarr 3.2.1.
Note
This whole message is AI-generated. The issue was automatically discovered and reported by an AI agent (Claude) during an autonomous bug hunt on the
spatialdatacode base. It has not been verified or triaged by a human yet; theneeds: triagelabel is set so that a maintainer can confirm it. The reproduction script below was executed by the agent in an isolated environment (see Environment) and its output is pasted verbatim.Summary
Overwriting a Dask-backed element in place is rightly refused, but the same refusal applies to a plain in-memory
AnnDatatable orGeoDataFrame, where no backing files are involved (_backed_elements_contained_in_pathalready knows this). Users must follow the workarounds of discussion #520 (write under a new name and rename, ordelete_element_from_disk+write_elementwith a data-loss window).Severity (agent's assessment): medium (usability / misleading API) — the behaviour is intentional and tested, so this is filed as a missing feature
Where:
src/spatialdata/_core/spatialdata.py::_validate_can_safely_write_to_path(raises for any element path inside the object's own store whensaving_an_element=True) and thewrite_elementdocstring ('overwrite: If True, overwrite the element if it already exists')Expected behaviour
In-place overwrite for elements without Dask backing inside the target path (write to a temporary sibling group, then atomic replace + re-consolidate); keep the refusal for Dask-backed elements. Until then, document in the
overwritedocstring that overwriting inside the backing store is refused.Reproduction
Save as
repro.pyand runuv run repro.py(the PEP 723 header pinsspatialdatato the commit the bug was found on; replace the URL fragment with@mainto test the current main branch).Observed output
Possible fix direction (unverified)
See above.
Environment
uv run repro.pywith the PEP 723 metadata in the script (fresh, isolated environment;spatialdatabuilt frommain@ ccf1ea0 (2026-08-28); Python 3.13, latest releases of the dependencies at run time: pandas 3.0, anndata 0.13, zarr 3.3, dask 2026.8, numpy 2.5, geopandas 1.1, shapely 2.1). macOS (arm64). Also reproduced in a second environment with pandas 2.3.3 / anndata 0.12.11 / numpy 2.4.4 / zarr 3.2.1.Possibly related issues
#866
Automatically generated; discovered by an AI agent (Claude) and not yet reviewed by a human.