Skip to content

Render the header of emptied super tables created from dotted keys - #590

Open
abhijeet117 wants to merge 1 commit into
python-poetry:masterfrom
abhijeet117:fix/empty-super-table-render
Open

Render the header of emptied super tables created from dotted keys#590
abhijeet117 wants to merge 1 commit into
python-poetry:masterfrom
abhijeet117:fix/empty-super-table-render

Conversation

@abhijeet117

Copy link
Copy Markdown

Summary

Popping the last key of a dotted-key chain (x.y.z = 1) left the still-present parent path rendering as blank whitespace instead of an explicit header, so parse(dumps(doc)) silently lost the empty x.y structure.

_render_table now emits the explicit header when a super table materialized from a dotted key has no renderable content left, so the structure survives the round trip. Out-of-order table parts, arrays of tables and whole-key deletions are untouched: this fixes only the super-table half of #553 and is independent of #567.

Testing

  • Added test_pop_leaf_of_dotted_key_keeps_super_table_in_output: it fails before the fix and passes after.
  • Full suite: 1053 passed, matching the pristine master baseline plus the new test. Ruff check and ruff format are clean.

Checklist

  • bug reproduced before fix
  • root cause identified
  • bug fixed
  • tests passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant