TranslatorSRI / PerformanceTestRunner

Run performance tests against the Translator system
MIT License
0 stars 0 forks source link

Throw errors instead of logging them #1

Open maximusunc opened 3 months ago

maximusunc commented 3 months ago

I gave this input:

('ci', 1, 'biolink:affects', ['inferred'], 'activity_or_abundance', 'increased', 'biolink:ChemicalEntity', 'PUBCHEM.COMPOUND:2733526', 'KPs')

But then it returned the output with all the kps but they were all empty. I had to dig in to the code to see these errors:

[{'error': 'You have provided input lists of unequal lengths'}]
'NoneType' object has no attribute 'values'

Neither of these caused the runner to actually fail, though they probably should have.

ShervinAbd92 commented 3 months ago

So certain parameters are expected to be inputted as list, left generating a query message we look at the length of input_query list, if you want to put them as strings, then i need to make sure on my end they are converted to list. Next we have chosen count=1 and sent 2 input curie, i always considered opposite condition where count is 3 and i only have been given a list of 2 input curie, then i duplicate, should i consider a case like yours here where i need to cut the input curie based on count?

maximusunc commented 3 months ago

I think it would be good to somehow validate the inputs and throw an error if they aren't what you expected.

And yes, I think we need to handle both cases where the count is both more and less than the provided input curie list.

ShervinAbd92 commented 3 months ago

So if you don't input arguments in list, you want to see error right away? i can add a condition for when count < len(input_curie)

ShervinAbd92 commented 3 months ago

would this error message be sufficient? "Unsupported input type, Please assure the following parameters ['biolink:affects', 'activity_or_abundance', 'increased', 'biolink:ChemicalEntity', 'PUBCHEM.COMPOUND:2733526'] are inputted as a List"

ShervinAbd92 commented 3 months ago

the count condition is now implemented as well.

maximusunc commented 3 months ago

I wouldn't necessarily include examples in the error message. I'm imagining some number of errors popping up, be it a wrong input type, no messages created.

ShervinAbd92 commented 3 months ago

sounds good, this feature has been implemented