Hello,
Since Cassandra 3.7 I cannot import anymore a model using UserType without having initialized first a connection:
Problem comes from this code:
In ModelMetaClass._new_ (cassandra/cqlengine/models.py).
I don't think you can expect having a fully setup connection when import a class inheriting from base model class.
I found at least one other person complaining from the same issue:
http://stackoverflow.com/questions/39720240/cql-engine-exception-about-a-connection-name-not-existing-in-registry
PS: It used to work before upgrading to 3.7.
Best regards, Adam.
Ah, yep. So one way to avoid breaking the register_for_keyspace API would be to add that to the UDT-registration code in ModelMetaClass._new_?
Is that behavior – registering a UDT to all registered connections on UDT class definition – what we want?
I am wondering if we could simply re-apply the checks we had before this new feature. IIRC, only 1 or 2 management functions had this connection check. Am I right?
Ready for further review. Commit history needs some cleanup, but the dedupe we talked about should be gone. This may need more tests.
Documentation and a couple small code changes ready for final review.
Great Job, added some metadata docs to the integration tests, and some negative validation scenarios.
https://github.com/riptano/python-dse-driver/commit/234aa40b659cafa029505e95819b8eb0174475ed
Sending this to done.