Params for PyTigerGraph not picking up my input

I have created the following interpreted query via graph studio:

INTERPRET QUERY (Vertex<Diagnosis_test> d) FOR GRAPH graphName { SetAccum @@edgeset; SumAccum @cnt = 0; diag = {d}; L1 = SELECT a FROM diag-(hasDiagnosis_Test:z)->Claims_test:a LIMIT 5; L2 = SELECT b FROM diag-(ref_prvdr_diag_specialist_in_Test:y)-REF_PRVDR_TEST:b ACCUM @@edgeset+=y LIMIT 5; L3 = SELECT c FROM L2-(hasRefProvider_Test:x)->Claims_test:c ACCUM @@edgeset+=x; PRINT L3, @@edgeset;}

And this works just fine in GraphStudio, I am prompted to input a param and when I do, I am given results back and a graph visualization and valid JSON, however, with pyTigerGraph I am trying the following:

conn.runInterpretedQuery(“INTERPRET QUERY (Vertex<Diagnosis_test> d) FOR GRAPH graphName{ SetAccum @@edgeset; SumAccum @cnt = 0; diag = {d}; L1 = SELECT a FROM diag-(hasDiagnosis_Test:z)->Claims_test:a LIMIT 5; L2 = SELECT b FROM diag-(ref_prvdr_diag_specialist_in_Test:y)-REF_PRVDR_TEST:b ACCUM @@edgeset+=y LIMIT 5; L3 = SELECT c FROM L2-(hasRefProvider_Test:x)->Claims_test:c ACCUM @@edgeset+=x; PRINT L3, @@edgeset;}”, params={“d”:“D12”})

As you can see I have the params parameter in a dict format as the docs clearly state I can use but I end up with the following error:

(‘Failed to convert Diagnosis_test vertex id for parameter d’, ‘GSQL-2500’)

Not sure why there would be this discrepancy as the Queries are written exactly the same and the input of D12 in GraphStudio works perfectly

Try calling parameters with this structure instead:

conn.runInterpretedQuery("queryName", "arg1=" + term1 + "&arg2=" + term2)

In your case, “arg1=” becomes “d=” and term1 would be the PRIMARY ID of your target Vertex<Diagnosis_test>. You can ignore the second argument, it’s just there as an example.

You can read more about passing arguments to pyTG functions in the docs here

I have gone through and tried this method as well, it results in the following exception:

‘Failed to convert Diagnosis_test vertex id for parameter d’, ‘GSQL-2500’

When I input the params like this:

params = ‘d=“D12”’

or like this:

params=“d=D12”

or like this:

params=“d=” + “D12”

Sorry for the late response. Try calling like this instead:

conn.runInterpretedQuery(queryName, "d=" + "D12")

You do not need to write “params” anywhere, it is just a placeholder for the name of the parameter.

However, your error message makes me think that something could also be wrong with the provided argument.