test: check annotations DataFrame columns by name, not strict shape[1] == 5#43
Open
ppavlidis wants to merge 1 commit into
Open
test: check annotations DataFrame columns by name, not strict shape[1] == 5#43ppavlidis wants to merge 1 commit into
ppavlidis wants to merge 1 commit into
Conversation
``test_get_dataset_annotations`` asserted ``res.shape[1] == 5`` against
the gemma-rest ``/datasets/{id}/annotations`` response. gemmapy commit
``fb7afb8`` ("add evidence code to annotation processing") added
``evidence_code`` to the DataFrame projection but didn't update this
test, so the assertion has been one column behind (now 6 cols, asserts
== 5).
Replace the bare shape[1] check with an expected-column-name subset
assertion. Verifies the columns we care about are present without
breaking the next time gemma-rest emits an additive field, which is the
contract direction (server-side additive fields are backwards-compatible
for clients that don't strict-check column counts.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
EOF
)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test_get_dataset_annotationshas been one column behind since gemmapy commitfb7afb8("add evidence code to annotation processing") addedevidence_codeto the DataFrame projection without updating the test'sshape[1] == 5assertion./datasets/{id}/annotationswill not break this test the next time something is added.Why this matters
While auditing v1/v2 API compatibility between the current
gemma-rest(2.0.0-alpha-SNAPSHOT) and gemmapy / gemma.R, this was the only gemmapy test that failed against a fresh local container. 10/11test_basic.pytests pass; this one fails purely because the assertion is rigid against an additive change that already landed on both sides.Server-side wire shape is unchanged from gemmapy's perspective. No new client-visible field; this is purely a test-fixture update.
Test plan
http://localhost:8080/rest/v2— passes.