Can't override partition key settings when subclassing a Model
PYTHON-1165
Stop using deprecated SSL calls
PYTHON-1164
Cloud Twisted support
PYTHON-1163
Allow passing ssl context for Eventlet
PYTHON-1162
Allow passing ssl context for Twisted
PYTHON-1161
Create a "Migrating from dse-driver" documentation page
PYTHON-1157
cluster.metadata.token_map.get_replicas(keyspace, token) returning more host instances than replication factor
PYTHON-1156
Event loops failing to connect to cloud
PYTHON-1153
Verify integration test against Cassandra 4.0
PYTHON-1146
Investigate duration time of tests.integration.long.test_loadbalancingpolicies
PYTHON-1142
Allow testing multiple endpoints without test duplication
PYTHON-1138
Ability to execute Fluent Graph queries asynchronously using .promise()
PYTHON-1129
Handle prepared id mismatch when repreparing on the fly
PYTHON-1124
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
Application thread stuck in ResponseFuture result on event wait
PYTHON-1032
Exception refreshing schema in response to schema change
PYTHON-1030
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
issue 1 of 147

Can't override partition key settings when subclassing a Model

Description

When subclassing a Model changes to the partition_key are not working because of the way the code handles the column definition processing.

Example:

 

Running this code raises an exception:

{{Traceback (most recent call last):
File "/home/bobh/test.py", line 10, in <module>
class B(A):
File "/home/bobh/.virtualenvs/traffica_stc/lib/python3.7/site-packages/cassandra/cqlengine/models.py", line 977, in _new_
raise ModelException("clustering_order may be specified only for clustering primary keys")
cassandra.cqlengine.models.ModelException: clustering_order may be specified only for clustering primary keys}}

because in ModelMetaClass (models.py:920) the code transforms the column definitions using the combined list of columns - inherited columns + column_definitions, instead of using the defined_columns OrderedDict() which merges the attributes properly.

CHanging line 920 from:

for k, v in column_definitions:

to
for k, v in defined_columns.items():

resolves the problem and allows the attributes of the columns to be processed properly.

Environment

None

Pull Requests

None

Status

Assignee

Unassigned

Reporter

Bob Haddleton

Fix versions

None

Labels

Reproduced in

None

PM Priority

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

Doc Impact

None

Reviewer

None

Size

None

Affects versions

3.19.0

Priority

Major
Configure