pub fn load_sidecar(py_path: &Path) -> Result<Option<MigrationSpec>>Expand description
Load the sidecar spec for a given .py migration path.
Derives the sidecar path by replacing the .py extension with .json
(same stem, sibling file).
- If the
.jsonsibling does not exist โOk(None). The caller should fall back to the trusted-import Python path for this file. - If it exists โ read, deserialize, and return
Ok(Some(spec)). - If it exists but is malformed โ
Err(MigrationError::Loader { .. }).
ยงErrors
Returns MigrationError::Loader when the sidecar exists but cannot be
read or deserialized.