Skip to content

Commit b16c479

Browse files
committed
Fix minor metadata errors
1 parent d8d6927 commit b16c479

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

cassandra/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,7 @@ def uses_error_code_map(cls, version):
225225

226226
@classmethod
227227
def uses_keyspace_flag(cls, version):
228-
# OSS was >= cls.V5... we should verify that this change is correct.
229-
return version >= cls.DSE_V2
228+
return version >= cls.V5 and version != cls.DSE_V1
230229

231230
@classmethod
232231
def has_continuous_paging_support(cls, version):

cassandra/cluster.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,8 @@ def __init__(self,
875875
idle_heartbeat_timeout=30,
876876
no_compact=False,
877877
ssl_context=None,
878-
endpoint_factory=None):
878+
endpoint_factory=None,
879+
monitor_reporting_enabled=False): # TODO just added for tests purpose before insights integration
879880
"""
880881
``executor_threads`` defines the number of threads in a pool for handling asynchronous tasks such as
881882
extablishing connection pools or refreshing metadata.
@@ -3960,8 +3961,8 @@ def _set_result(self, host, connection, pool, response):
39603961
self, connection, **response.schema_change_event)
39613962
elif response.kind == RESULT_KIND_ROWS:
39623963
self._paging_state = response.paging_state
3963-
self._col_types = response.column_names
3964-
self._col_names = response.column_types
3964+
self._col_types = response.column_types
3965+
self._col_names = response.column_names
39653966
self._set_final_result(self.row_factory(
39663967
response.column_names, response.parsed_rows))
39673968
elif response.kind == RESULT_KIND_VOID:

cassandra/protocol.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -677,10 +677,10 @@ def recv_results_rows(self, f, protocol_version, user_type_map, result_metadata)
677677
for row in rows:
678678
for i in range(len(row)):
679679
try:
680-
self.column_typess[i].from_binary(row[i], protocol_version)
680+
self.column_types[i].from_binary(row[i], protocol_version)
681681
except Exception as e:
682682
raise DriverException('Failed decoding result column "%s" of type %s: %s' % (self.column_names[i],
683-
self.column_names[i].cql_parameterized_type(),
683+
self.column_types[i].cql_parameterized_type(),
684684
str(e)))
685685

686686
def recv_results_prepared(self, f, protocol_version, user_type_map):
@@ -910,7 +910,6 @@ def send_body(self, f, protocol_version):
910910
write_long(f, self.timestamp)
911911

912912

913-
914913
class BatchMessage(_MessageType):
915914
opcode = 0x0D
916915
name = 'BATCH'

0 commit comments

Comments
 (0)