Hi,
Here is the code
Code ::
alerts_list=[‘28000.0’,‘29000.0’]
#alerts_list=(‘28000.0’,‘29000.0’)
code = “”"INTERPRET QUERY (SET State_ID, STRING New_Status, STRING Reason_L1) FOR GRAPH TX_CRD {
start = {Alert.*};
result =
SELECT src
FROM start:src
WHERE src.State_ID IN State_ID
POST-ACCUM src.Alert_Status = New_Status,
//POST-ACCUM src.Reason_Status_L1 = Reason_L1
src.Reason_Status_L1 = src.Reason_Status_L1 + "|" + Reason_L1;
}""",
params={“State_ID”: alerts_list}
res = conn.runInterpretedQuery(code, {“New_Status”: “actions”,“Reason_L1”: “rationale”})
#res = conn.runInterpretedQuery(code, {“State_ID”: alerts_list,“New_Status”: “Escalated”,“Reason_L1”: “rationale”})
Error ::
AttributeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_15664/3472283601.py in
17
18
—> 19 res = conn.runInterpretedQuery(code, {“New_Status”: “actions”,“Reason_L1”: “rationale”})
20
21 #conn.vertexSetToDataFrame(res[0][“mac”])
~\Anaconda3\lib\site-packages\pyTigerGraph\pyTigerGraph.py in runInterpretedQuery(self, queryText, params)
1192 Documentation: Built-in Endpoints :: TigerGraph Server
1193 “”"
→ 1194 queryText = queryText.replace("$graphname", self.graphname)
1195 return self._post(self.gsUrl + “/gsqlserver/interpreted_query”, data=queryText, params=params, authMode=“pwd”)
1196
AttributeError: ‘tuple’ object has no attribute ‘replace’
Looking for the solution on the same,Thanks in advance!