Skip to content

Preserve table display names on self assignment#537

Open
gaoflow wants to merge 1 commit into
python-poetry:masterfrom
gaoflow:fix-291-preserve-dotted-display-name
Open

Preserve table display names on self assignment#537
gaoflow wants to merge 1 commit into
python-poetry:masterfrom
gaoflow:fix-291-preserve-dotted-display-name

Conversation

@gaoflow

@gaoflow gaoflow commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #291.

Summary

  • avoid invalidating parsed table display names when a table is assigned back to its existing slot
  • add a regression test for preserving whitespace and quoting in dotted table headers after self-assignment

Verification

  • uv run --no-project --with pytest --with pyyaml python -m pytest tests/test_toml_document.py::test_replace_table_with_itself_preserves_display_name tests/test_toml_document.py::test_replace_with_table_of_nested tests/test_toml_document.py::test_nested_table_update_display_name -q
  • uv run --no-project --with pytest --with pyyaml python -m pytest -q
  • uv run --no-project --with ruff ruff check tomlkit/container.py tests/test_toml_document.py
  • uv run --no-project --with ruff ruff format --check tomlkit/container.py tests/test_toml_document.py
  • python -m compileall tomlkit/container.py tests/test_toml_document.py
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Difference in whitespace in dot notation disappears

1 participant