Skip to content

Fix MCQ qualifier constraint parsing - #142

Merged
wumirose merged 3 commits into
masterfrom
codex/fix-qedge-qualifiers-141
Jun 6, 2026
Merged

Fix MCQ qualifier constraint parsing#142
wumirose merged 3 commits into
masterfrom
codex/fix-qedge-qualifiers-141

Conversation

@cbizon

@cbizon cbizon commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Parse TRAPI constraints.qualifiers in addition to qualifier_constraints.
  • Reuse one QEdge qualifier parser for MCQ and single-curie query paths so qualifier filters are constructed consistently.
  • Add regression coverage for issue QEdge qualifier constraints are not applied as a strict filter for set-input affects queries #141 qualified biolink:affects MCQ queries.
  • Make pytest import this repo's local src package instead of any globally injected src package.
  • Split test-only dependencies into requirements-test.txt and document conda/venv-based installs.

Why

  • Qualified set-input queries were preserving qualifier constraints in the echoed query graph but passing only the bare predicate into graph coalescence, so missing, broader, or opposite qualifier rows could pass through.
  • This repo uses src as its top-level import package, but src lacked an init.py and pytest had no local pythonpath config. On a machine with another installed src package, normal pytest could import the wrong repo.
  • Deployment installs requirements.txt, so pytest dependencies should not be runtime requirements. Local installs and CI now use an explicit conda or virtual environment rather than system Python.

Test

  • python -m venv /private/tmp/ac-test-env-answercoalesce-141
  • /private/tmp/ac-test-env-answercoalesce-141/bin/python -m pip install -r requirements-test.txt
  • /private/tmp/ac-test-env-answercoalesce-141/bin/python -m pytest tests/test_trapi_generation.py

Fixes #141

- Parse TRAPI constraints.qualifiers in addition to qualifier_constraints

- Reuse one QEdge qualifier parser for MCQ and single-curie query paths

- Add regression coverage for issue 141 qualified affects queries
@cbizon
cbizon requested a review from wumirose June 6, 2026 21:26
cbizon added 2 commits June 6, 2026 17:31
- Add a package initializer so this repo's src package wins over globally injected packages

- Configure pytest to put the repository root on the import path
- Keep deployment requirements focused on runtime dependencies

- Add requirements-test.txt for pytest dependencies

- Document conda environment setup for local installs and tests

- Run CI installs inside a virtual environment
@wumirose
wumirose merged commit 8b410b0 into master Jun 6, 2026
2 checks passed

@wumirose wumirose left a comment

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.

Looks good to me

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.

QEdge qualifier constraints are not applied as a strict filter for set-input affects queries

2 participants