get_connection method invoked with incorrect parameter in several methods of cqlengine\connection.py
PYTHON-1195
Stop ResponseFuture creating unnecessary query plans
PYTHON-1194
Remove deprecated murmur3 checks
PYTHON-1191
New default load balancing policy
PYTHON-1190
Good error messages for an unconfigured DC in DCA LBP
PYTHON-1188
Exceptions thrown from registered listeners are not caught
PYTHON-1184
Allow tests to run with minimal requirements
PYTHON-1176
Stop using deprecated SSL calls
PYTHON-1164
Verify integration test against Cassandra 4.0
PYTHON-1146
Allow testing multiple endpoints without test duplication
PYTHON-1138
Remove legacy ssl_options handling
PYTHON-1116
The documentation search doesn´t provide useful results
PYTHON-1102
Add prepared statement message support for protocol v5
PYTHON-1086
Engage the LoadBalancingPolicy after the control connection
PYTHON-1080
Execution profile API tweaks
PYTHON-1071
Add support of NaN, Infinity and -Infinity to the BigDecimalTypeIO
PYTHON-1070
Cache prepared statements by query
PYTHON-1066
Handle properly SSL_ERROR_WANT_WRITE error in the asyncio reactor
PYTHON-1062
Prepared statement logging doesn't log parameters
PYTHON-1052
Investigate if cleanup happens properly when Session is GC'd before a connection is returned
PYTHON-1043
Add support for describing additional_read_policy and additional_write_policy
PYTHON-1041
Remove %(thread) from test debugging
PYTHON-1038
Driver doesn't fail fast on UDTs with duplicate field names
PYTHON-1025
Remove references to ssl.SSL_ERROR_WANT_READ and SSL_ERROR_WANT_WRITE
PYTHON-1022
Make cqlengine context-aware
PYTHON-997
Add Unit tests for ProtocolVersionRegistry
PYTHON-991
Unit and Integration tests shouldn't use ProtocolVersion directly, but rather use the default ProtocolVersionRegistry
PYTHON-989
Refactor and improve the request processing model
PYTHON-986
Refactor to make the driver pluggable
PYTHON-983
Rename request_ids to _request_ids
PYTHON-980
In getting_started.rst in the setting the consistency level we specify the legacy mode
PYTHON-979
asyncio tests get hanged sometimes in test_execute_concurrent_paged_result_generator
PYTHON-969
Write DSEGSSAPIAuthProvider test after merge to DSE
PYTHON-967
Create an efficient iterator for a QuerySet
PYTHON-964
Introduce the DriverContext
PYTHON-958
Make types pluggable
PYTHON-957
Make ProtocolVersion pluggable
PYTHON-954
Consider change ResultSet.was_applied to work as well for query strings
PYTHON-943
Decide global max protocol version using system.peers
PYTHON-938
Remove DowngradingConsistencyRetryPolicy
PYTHON-936
Investigate if we should deserialize inet addresses to ipaddress.* in Python 3
PYTHON-933
Investigate if min_length for Text fields in CQLengine be set to 0 by default instead of 1
PYTHON-929
Change idle_heartbeat_timeout default should be changed to 10s instead of 30s
PYTHON-928
Reorder and group Cluster kwargs
PYTHON-927
Allow for counter columns be static
PYTHON-926
Remove old cluster/session management code from cassandra.cqlengine.connection
PYTHON-925
Investigate aliases creation for metrics
PYTHON-924
PreparedStatement.keyspace should be renamed to prepared_keyspace
PYTHON-923
Default to truncating datetime micros in cqlengine instances
PYTHON-922
Don't allow field overriding in models
PYTHON-921
issue 1 of 138

get_connection method invoked with incorrect parameter in several methods of cqlengine\connection.py

Description

In cqlengine/connection.py file, you could easily find a defect in several methods.
Namely, in below methods

  • execute

  • get_session

  • get_cluster
    assign Connection instances to invoke get_connection method instead of connection name which is expected.

def execute(query, params=None, consistency_level=None, timeout=NOT_SET, connection=None):
conn = get_connection(connection)
...

def get_session(connection=None):
conn = get_connection(connection)
return conn.session

def get_cluster(connection=None):
conn = get_connection(connection)
if not conn.cluster:
raise CQLEngineException("%s.cluster is not configured. Call one of the setup or default functions first." % _name_)
return conn.cluster

SHOULD assign name of connection as parameter.

def get_connection(name=None):

if not name:
name = DEFAULT_CONNECTION

if name not in _connections:
raise CQLEngineException("Connection name '{0}' doesn't exist in the registry.".format(name))

conn = _connections[name]
conn.handle_lazy_connect()

return conn

Environment

None

Pull Requests

None

Status

Assignee

Unassigned

Reporter

Cooper Yang

Fix versions

None

Labels

Reproduced in

3.20.2

PM Priority

None

External issue ID

None

Doc Impact

None

Reviewer

None

Size

None

Affects versions

Priority

Major
Configure