Skip to content

Preserve nonmatching text when no common block qualifies - #72

Open
AlvaroBalbin wants to merge 1 commit into
OCHA-DAP:mainfrom
AlvaroBalbin:fix/audit-OCHA-DAP-hdx-python-utilities-ef
Open

AlvaroBalbin wants to merge 1 commit into
OCHA-DAP:mainfrom
AlvaroBalbin:fix/audit-OCHA-DAP-hdx-python-utilities-ef

Conversation

@AlvaroBalbin

Copy link
Copy Markdown
Contributor

I fixed text combination discarding both inputs when no common block qualifies. I changed the final append conditions to preserve remaining nonmatching text with the existing separator handling.

The same regression test failed on the original code and passed with the fix.

Local verification

  • .venv/project/bin/python -m pytest -q passed.
  • .venv/bin/pre-commit run --all-files passed.
  • .venv/bin/python -m build --outdir .venv/oss-dist passed.
  • Native check 4 passed.
  • .venv/bin/uv run ruff format --check passed.
  • .venv/bin/uv run ruff check passed.
  • .venv/bin/uv run --extra html --extra diff --extra email pytest passed.

Behavioral checks passed in fork CI for d7eadb2.

AI-assisted contribution using OpenAI Codex.

I fixed text combination discarding both inputs when no common block qualifies. I changed the final append conditions to preserve remaining nonmatching text with the existing separator handling.
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 95.911% (+0.04%) from 95.87% — AlvaroBalbin:fix/audit-OCHA-DAP-hdx-python-utilities-ef into OCHA-DAP:main

@@ -0,0 +1,17 @@
"""AI-assisted regression for text loss when no matching block qualifies."""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this test into test_matching.py and add a trailing nonmatching text case

This branch has not been deployed

No deployments
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.

3 participants