Problems creating queries in a Colab Notebook

I was following instructions from https://colab.research.google.com/drive/1fJpcv-q0NLfHj3X1k6Lbwddp8gVVcfES#scrollTo=SkQwdEZYyvzd and everything works in my own Colab notebook (a plain one, not a TigerCloud one) as expected except creating multiline queries. For instance:

conn.gsql(’’’
USE GRAPH plustoken
CREATE QUERY testQuery() FOR GRAPH plustoken { PRINT “Hola mudo” }
‘’’)

Fails with error:

ERROR:root:An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line string', (1, 0))

---------------------------------------------------------------------------
ExceptionCodeRet                          Traceback (most recent call last)
<ipython-input-18-2d715d8e1b2b> in <module>()
      2 USE GRAPH plustoken
      3 CREATE QUERY testQuery() FOR GRAPH plustoken { PRINT "Hola mudo" }
----> 4 ''')

4 frames
/usr/local/lib/python3.7/dist-packages/pyTigerDriver/pyDriver.py in __handle__interactive(reader)
    330                     ret = int(ret)
    331                     if ret != 0:
--> 332                         raise ExceptionCodeRet(ret)
    333                 elif line.startswith(PREFIX_INTERACT):
    334                     _, it, ik = line.split(",", 2)

ExceptionCodeRet: 212

What am I doing wrong here?

@tonicebrian Interesting.

For the example it looks like you are missing the --> ;

conn.gsql(’’’
USE GRAPH plustoken
CREATE QUERY testQuery() FOR GRAPH plustoken { 
PRINT “Hola mudo”; 
}
’’’)

Can you try adding that punctuation and let me know if it throws the same error?

Hi @Jon_Herke , still same result but this time with error 211

ERROR:root:An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line string', (1, 0))

---------------------------------------------------------------------------
ExceptionCodeRet                          Traceback (most recent call last)
<ipython-input-28-5f2690f7d3b5> in <module>()
      9 }
     10 
---> 11 ''')

4 frames
/usr/local/lib/python3.7/dist-packages/pyTigerDriver/pyDriver.py in __handle__interactive(reader)
    330                     ret = int(ret)
    331                     if ret != 0:
--> 332                         raise ExceptionCodeRet(ret)
    333                 elif line.startswith(PREFIX_INTERACT):
    334                     _, it, ik = line.split(",", 2)

ExceptionCodeRet: 211

Not sure if this will solve the issue, but you shouldn’t need the USE GRAPH clause beforehand, as by default the conn.gsql function will know that through your connection instantiation.