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

Edge missing 'subject' causing uncaught error in ARAX #2424

Open
amykglen opened this issue Nov 21, 2024 · 0 comments
Open

Edge missing 'subject' causing uncaught error in ARAX #2424

amykglen opened this issue Nov 21, 2024 · 0 comments

Comments

@amykglen
Copy link
Member

noticed that this query is causing an uncaught error on arax.ci.transltr.io:

{
  "edges":{
    "e00":{
      "subject":"n00",
      "object":"n01"
    },
    "e01":{
      "subject":"n01",
      "object":"n02"
    },
    "e02":{
      "subject":"n02",
      "object":"n03"
    }
  },
  "nodes":{
    "n00":{
      "ids":[
        "NCBIGene:165"
      ]
    },
    "n01":{
      "categories":[
        "biolink:Pathway"
      ],
      "is_set":true
    },
    "n02":{
      "categories":[
        "biolink:BiologicalProcess"
      ],
      "is_set":true
    },
    "n03":{
      "ids":[
        "HP:0000938",
        "HP:0000974",
        "HP:0000978",
        "HP:0001373",
        "HP:0001382",
        "HP:0001582",
        "HP:0001760",
        "HP:0001763",
        "HP:0001765",
        "HP:0001822",
        "HP:0031158",
        "HP:0001537",
        "HP:0001634",
        "HP:0001999",
        "HP:0002827",
        "HP:0002933",
        "HP:0004976",
        "HP:0007457",
        "HP:0025509",
        "HP:0000023",
        "HP:0000028",
        "HP:0000189",
        "HP:0000218",
        "HP:0000347",
        "HP:0000400",
        "HP:0000465",
        "HP:0000483",
        "HP:0000486",
        "HP:0000545",
        "HP:0000692",
        "HP:0000704",
        "HP:0000767",
        "HP:0000819",
        "HP:0000960",
        "HP:0001097",
        "HP:0001166",
        "HP:0001252",
        "HP:0001263",
        "HP:0001270",
        "HP:0001488",
        "HP:0001596",
        "HP:0001698",
        "HP:0001780",
        "HP:0001852",
        "HP:0002155",
        "HP:0002616",
        "HP:0002619",
        "HP:0002751",
        "HP:0002808",
        "HP:0002943",
        "HP:0003042",
        "HP:0003834",
        "HP:0003994",
        "HP:0006243",
        "HP:0006439",
        "HP:0006480",
        "HP:0008138",
        "HP:0009938",
        "HP:0010810",
        "HP:0010829",
        "HP:0025232",
        "HP:0100546",
        "HP:0100658"
      ]
    }
  }
}

this is the error:

2024-11-21T23:32:25.347875 ERROR: An uncaught error occurred: Invalid value for subject, must not be None: ['Traceback (most recent call last):\n', ' File "/mnt/data/orangeboard/production/RTX/code/UI/OpenAPI/python-flask-server/openapi_server/../../../../ARAX/ARAXQuery/ARAX_query.py", line 781, in execute_processing_plan\n expander.apply(response, action['parameters'], mode=mode)\n', ' File "/mnt/data/orangeboard/production/RTX/code/UI/OpenAPI/python-flask-server/openapi_server/../../../../ARAX/ARAXQuery/ARAX_expander.py", line 441, in apply\n kp_answers = loop.run_until_complete(task_group)\n', ' File "/usr/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete\n return future.result()\n', ' File "/mnt/data/orangeboard/production/RTX/code/UI/OpenAPI/python-flask-server/openapi_server/../../../../ARAX/ARAXQuery/ARAX_expander.py", line 842, in _expand_edge_async\n answer_kg = self._deduplicate_nodes(answer_kg, kp_to_use, log)\n', ' File "/mnt/data/orangeboard/production/RTX/code/UI/OpenAPI/python-flask-server/openapi_server/../../../../ARAX/ARAXQuery/ARAX_expander.py", line 998, in _deduplicate_nodes\n edge.subject = curie_mappings.get(edge.subject)\n', ' File "/mnt/data/orangeboard/production/RTX/code/UI/OpenAPI/python-flask-server/openapi_server/models/edge.py", line 120, in subject\n raise ValueError("Invalid value for subject, must not be None") # noqa: E501\n', 'ValueError: Invalid value for subject, must not be None\n']

if I restrict the KPs to only KG2, everything is fine, so I think it's an external KP that's returning an invalid edge (missing edge.subject). should probably trace which KP it is (maybe let them know), and add better handling - think we'll want to ignore such invalid edges from KPs (maybe issue a summarized warning, noting N invalid edges were returned from KP X...)

@amykglen amykglen changed the title Edge missing 'subject' causing ARAX to throw an error Edge missing 'subject' causing uncaught error in ARAX Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant