Skip to content

Tighten table and attachment annotation ref checks in tests - #573

Open
FedyaBadyilo wants to merge 1 commit into
ispras:developfrom
FedyaBadyilo:test/object-annotation-refs
Open

Tighten table and attachment annotation ref checks in tests#573
FedyaBadyilo wants to merge 1 commit into
ispras:developfrom
FedyaBadyilo:test/object-annotation-refs

Conversation

@FedyaBadyilo

Copy link
Copy Markdown

Summary

  • Extend the existing _test_table_refs helper: reject dangling table/attach annotations always; require every table to be linked on placement formats (docx, pptx, pdf); optionally compare uid multisets so a lost ref is visible when two DOCX tables share a content-hash uid.
  • Call the helper from the format tests that already parse those documents (docx, pptx, pdf, image-refs). Article and unused office media keep the weak side only (no dangling refs).
  • Add a small unit test that builds a synthetic document, runs DefaultStructureExtractor + TreeConstructor, and checks both tables and attachments survive a raw_text merge.

This is tests only. It does not change the public contract and does not claim that every format must have a 1:1 annotation↔object map (HTML / Excel / CSV / email / uncited GROBID figures stay out).

Test plan

  • python -m unittest tests.unit_tests.test_misc_object_refs -v
  • API tests against a local dedoc on :1231:
    test_docx, test_pptx, test_structure_and_annotations,
    test_pdf_with_some_tables (scan + text layer),
    tests.api_tests.test_api_misc_with_images_refs
    (article needs Grobid; without it the request 500s in ArticleStructureExtractor, unrelated to this change)
  • flake8 on the touched test files

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