From 4003dedfd7228ac835b6bcb3203bde5840920b9a Mon Sep 17 00:00:00 2001 From: Dmitry Kropachev Date: Wed, 22 Jan 2025 20:46:29 -0400 Subject: [PATCH] Fix code to match cython expectation It fails to convert unicode to 'str', we have to help it out. ``` Error compiling Cython file: ------------------------------------------------------------ ... if metadata_request_timeout is None: return stmt ms = int(metadata_request_timeout / datetime.timedelta(milliseconds=1)) if ms == 0: return stmt return f"{stmt} USING TIMEOUT {ms}ms" ^ ------------------------------------------------------------ cassandra/util.py:1813:11: Cannot convert Unicode string to 'str' implicitly. This is not portable and requires explicit encoding. ``` --- cassandra/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cassandra/util.py b/cassandra/util.py index c6e2f0eda9..0fe768ff2f 100644 --- a/cassandra/util.py +++ b/cassandra/util.py @@ -1810,4 +1810,4 @@ def maybe_add_timeout_to_query(stmt: str, metadata_request_timeout: Optional[dat ms = int(metadata_request_timeout / datetime.timedelta(milliseconds=1)) if ms == 0: return stmt - return f"{stmt} USING TIMEOUT {ms}ms" + return str(f"{stmt} USING TIMEOUT {ms}ms")