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
{{ message }}
Repository navigation
Support upsert into empty documents without sentinel workaround #34
Document.upsert() raises PatchError when called on an empty document (no root node):
doc=yamltrip.loads("")
doc.upsert("x", value=1)
# PatchError: YAML query error: syntax node 'stream' is missing named child 'document'
This is because the underlying yamlpatch Add operation requires an existing mapping node at the target route.
Current workaround
In usethis, we work around this by seeding with a throwaway sentinel key to create a root mapping, inserting the real content, then removing the sentinel:
Activity