Skip to content

Reject empty keypaths separator#580

Open
CodingFeng101 wants to merge 1 commit into
fabiocaccamo:mainfrom
CodingFeng101:codex/small-fix
Open

Reject empty keypaths separator#580
CodingFeng101 wants to merge 1 commit into
fabiocaccamo:mainfrom
CodingFeng101:codex/small-fix

Conversation

@CodingFeng101

Copy link
Copy Markdown

What changed

keypaths(..., separator="") now raises the same ValueError as other invalid separators instead of silently falling back to the default "." separator.

Why

The function documents and reports that the separator must be a non-empty string. An explicit empty separator is most likely a caller mistake, and silently converting it to "." can hide the invalid input and return keypaths with an unexpected separator.

separator=None still preserves the previous default behavior.

Validation

  • python -m pytest tests\core\test_keypaths.py -q
  • python -m pytest tests\core -q
  • python -m ruff check benedict\core\keypaths.py tests\core\test_keypaths.py
  • python -m black --check benedict\core\keypaths.py tests\core\test_keypaths.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.

1 participant