Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes a bug in pq_int #6

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/descender.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ def create_pq_to_descendant_int_ids(self,rc):
# Create a dictionary from pq to all of its descendant integer ids
# First, pull the integer id for every pq
pql = list(self.pq_to_descendants.keys())
pq_iids = rc.pipeline_gets(3, pql, True).values()
pq_int_ids = {pq:iid for pq,iid in zip(pql, pq_iids)}
pq_int_ids = rc.pipeline_gets(3, pql, True)
# now convert pq_to_descendants into int id values
pq_to_descendant_int_ids = {}
for pq in self.pq_to_descendants:
Expand Down
46 changes: 46 additions & 0 deletions tests/test_trapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,52 @@ def test_profile_asthma():
response = client.post("/query", json= query_graph).json()
print("How many results?",len(response["message"]["results"]))

def test_affects():
m = {
"message": {
"query_graph": {
"nodes": {
"subnode": {
"ids": [
"PUBCHEM.COMPOUND:70701426"
]
},
"objnode": {
"categories": [
"biolink:Gene"
]
}
},
"edges": {
"the_edge": {
"subject": "subnode",
"object": "objnode",
"predicates": [
"biolink:affects"
],
"qualifier_constraints": [
{
"qualifier_set": [
{
"qualifier_type_id": "biolink:object_aspect_qualifier",
"qualifier_value": "activity"
},
{
"qualifier_type_id": "biolink:object_direction_qualifier",
"qualifier_value": "decreased"
}
]
}
]
}
}
}
}
}
response = client.post("/query", json=m)
print("How many results?",len(response.json()["message"]["results"]))
assert response.status_code == 200

def test_500():
# This is giving a 500, seems like it's getting into the double ended query by mistake.
m = {
Expand Down
Loading