Skip to content

Commit 5619950

Browse files
docs: broaden merge_into docstring to cover sequences
1 parent 98ffe07 commit 5619950

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/ops.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ impl PyOp {
7171
}
7272

7373
/// Merge key-value pairs into an existing mapping.
74+
///
75+
/// The `updates` map must contain flat (scalar) values only. Non-scalar
76+
/// values (for example, nested mappings or sequences) will produce
77+
/// incorrect indentation due to yamlpatch's uniform-indent serialization
78+
/// in `handle_block_mapping_addition`.
79+
/// For nested values, use `Op.add` + `Op.replace` to route through
80+
/// the complex-replace path which preserves relative indentation.
7481
#[staticmethod]
7582
fn merge_into(key: &str, updates: &Bound<'_, PyAny>) -> PyResult<Self> {
7683
let dict = updates.cast::<pyo3::types::PyDict>().map_err(|_| {

0 commit comments

Comments
 (0)