Closed nigel5 closed 3 months ago
Latest python driver test run failed with the similar problem:
@vponomaryov I don't think your issue is related to the above issue description.
Regarding the original description, it's more of a request to register the UDT when importing but I'm not sure it's a behaviour we would like to adopt.
Problem
Hi, I have a question about the usage of UDTs. I was getting
<Error from server: code=2000 [Syntax error in CQL query] message="line 1:278 no viable alternative at input
despite registering the UDT with the default connection. After a sometime debugging I found that I needed to register the UDT each time it was imported.main.py
sets up the database cluster and session and then it registers the UDTs.myutilfuncs.py
tries to use the UDT with one of theModel
s but it gets a syntax error. After registering the UDT again then it worked.I thought once the UDTs are registered with the default connection with is a singleton, then they can be used anywhere in the project since the
Model
s will use that connection.Is this the expected behaviour or am I missing something to configure? Thanks!
Python version 3.9.6 scylla-driver version 3.26.7
main.py
myutilfuncs.py
Suggest a fix
Register the UDTs each time they are imported.