Cassandra 4.0 supports transient replication feature. However, with python-driver version 3.21, the following code fails to execute. This is required for cqlsh to properly support DESCRIBE on TR enabled keyspaces. The issue seems to be related to an assumption that the replication factor for NetworkTopologyStrategy is always an integer (see: https://github.com/datastax/python-driver/blob/9297c74c9075b9eb732190f7f0bdf1b06493b808/cassandra/metadata.py#L503-L504):
from cassandra.cluster import Cluster
cluster = Cluster(contact_points=['127.0.0.1'])
session = cluster.connect()
session.execute("CREATE KEYSPACE bar WITH replication = {'class': 'NetworkTopologyStrategy', 'datacenter1': '3/1'};")
print(cluster.metadata.keyspaces['bar'].export_as_string())
Stack trace:
print(cluster.metadata.keyspaces['bar'].export_as_string())
File "cassandra/metadata.py", line 657, in cassandra.metadata.KeyspaceMetadata.export_as_string
File "cassandra/metadata.py", line 679, in cassandra.metadata.KeyspaceMetadata.as_cql_query
AttributeError: 'NoneType' object has no attribute 'export_for_schema'
Could we get this fixed so we can properly support DESCRIBE in cqlsh?