When using ExecutionProfile, any attempt to register or create a connection/session fails because some methods set attributes on session and this raises errors (from Session._validate_set_legacy_config), reason is that when you use ExecutionProfile you can't set attributes on Session objects, but this is made by cassandra-driver code, so it seems that it's rather impossible to use it.
I've tried many "escapes" and the code below is the last (dirty) attempt:
Result: ValueError raised:
In the code above, the ValueError is raised from Connection.from_session, but the same happens if you use register_connection, setup_connection or any other method related to the creation of a session/connection.
Am I missing anything?...
Linux Debian/Ubuntu
Hi Alan,
thanks for answering.
No, I've already tried. It calls the Connection.setup() method and it gives problems because this tries to set a property on session (default_consistency_level) which on turn calls the self._validate_set_legacy_config('default_consistency_level', cl)
This is the chain:
https://github.com/datastax/python-driver/blob/master/cassandra/cqlengine/connection.py#L194
https://github.com/datastax/python-driver/blob/master/cassandra/cqlengine/connection.py#L112
https://github.com/datastax/python-driver/blob/master/cassandra/cluster.py#L1960
https://github.com/datastax/python-driver/blob/master/cassandra/cluster.py#L2655
I think the work around is basically to use legacy config options.
Yes, it's totally fine. Just wanted to try this feature and report the issue.
Thanks!
Thanks for the report!
I think the goal here should be to make cqlengine compatible with both legacy and EP config until the next major: we can't break legacy config in a minor, and we should support EPs so that cqlengine users can transition to EPs for the next major.
, , do you agree?
If so, maybe we can alter some of the shorter cqlengine tests to run with both legacy and EP config. Seem like a plan?
Works for me.