Skip to content

Commit

Permalink
Fix code to match cypthon expectation
Browse files Browse the repository at this point in the history
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.
```
  • Loading branch information
dkropachev committed Jan 23, 2025
1 parent 62be415 commit 68721ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cassandra/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit 68721ee

Please sign in to comment.