Upgrade Python driver to 3.28.0

patch by Andrés de la Peña and Jeremiah Jordan; reviewed by Brandon Williams for CASSANDRA-18960

Co-authored-by: Jeremiah Jordan <jeremiah@datastax.com>
Co-authored-by: Andrés de la Peña <a.penya.garcia@gmail.com>
This commit is contained in:
Andrés de la Peña 2023-11-02 13:59:58 +00:00
parent dca76145c2
commit f41ecf586c
5 changed files with 34 additions and 4 deletions

View File

@ -1,4 +1,5 @@
5.0-alpha2 5.0-alpha2
* Upgrade Python driver to 3.28.0 (CASSANDRA-18960)
* Add retries to IR messages (CASSANDRA-18962) * Add retries to IR messages (CASSANDRA-18962)
* Add metrics and logging to repair retries (CASSANDRA-18952) * Add metrics and logging to repair retries (CASSANDRA-18952)
* Remove deprecated code in Cassandra 1.x and 2.x (CASSANDRA-18959) * Remove deprecated code in Cassandra 1.x and 2.x (CASSANDRA-18959)

Binary file not shown.

View File

@ -149,8 +149,8 @@ class CqlType:
def parse(self, typestring, ksmeta): def parse(self, typestring, ksmeta):
""" """
Parse the typestring by looking at this pattern: *<*>. If there is no match then the type Parse the typestring by looking at this pattern: *<*>. If there is no match then the type
is either a simple type or a user type, otherwise it must be a composite type is either a simple type or a user type, otherwise it must be a composite type or a vector type,
for which we need to look-up the sub-types. For user types the sub types can be extracted for which we need to look up the subtypes. For user types the subtypes can be extracted
from the keyspace metadata. from the keyspace metadata.
""" """
while True: while True:
@ -167,8 +167,15 @@ class CqlType:
typestring = m.group(2) typestring = m.group(2)
continue continue
name = m.group(1) # a composite type, parse sub types name = m.group(1) # a composite or vector type, parse subtypes
return name, self.parse_sub_types(m.group(2), ksmeta), self._get_formatter(name) try:
# Vector types are parameterized as name<type,size> so add custom handling for that here
type_args = m.group(2).split(',')
vector_type = CqlType(type_args[0])
vector_size = int(type_args[1])
return name, [vector_type for _ in range(vector_size)], self._get_formatter(name)
except (ValueError, IndexError):
return name, self.parse_sub_types(m.group(2), ksmeta), self._get_formatter(name)
@staticmethod @staticmethod
def _get_formatter(name): def _get_formatter(name):

View File

@ -935,6 +935,28 @@ class TestCqlshOutput(BaseTestCase):
"""), """),
)) ))
def test_vectors_output(self):
self.assertQueriesGiveColoredOutput((
("SELECT vectorcol FROM has_all_types;", r"""
vectorcol
MMMMMMMMM
-----------------------
[1, -2, NaN]
BGBBGGBBGGGB
[1, 2, 3]
BGBBGBBGB
[0, 0, 0]
BGBBGBBGB
null
RRRR
[1e+08, 1e+08, 1e+08]
BGGGGGBBGGGGGBBGGGGGB
(5 rows)
"""),
))
def test_expanded_output_counts_past_page(self): def test_expanded_output_counts_past_page(self):
query = "PAGING 5; EXPAND ON; SELECT * FROM twenty_rows_table;" query = "PAGING 5; EXPAND ON; SELECT * FROM twenty_rows_table;"
output, result = testcall_cqlsh(prompt=None, env=self.default_env, output, result = testcall_cqlsh(prompt=None, env=self.default_env,