We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e4c4c67 commit 6a49d9dCopy full SHA for 6a49d9d
1 file changed
cassandra/encoder.py
@@ -67,7 +67,7 @@ class Encoder(object):
67
68
def __init__(self):
69
self.mapping = {
70
- float: self.cql_encode_object,
+ float: self.cql_encode_float,
71
bytearray: self.cql_encode_bytes,
72
str: self.cql_encode_str,
73
int: self.cql_encode_object,
@@ -138,6 +138,12 @@ def cql_encode_object(self, val):
138
"""
139
return str(val)
140
141
+ def cql_encode_float(self, val):
142
+ """
143
+ Encode floats using repr to preserve precision
144
145
+ return repr(val)
146
+
147
def cql_encode_datetime(self, val):
148
149
Converts a :class:`datetime.datetime` object to a (string) integer timestamp
0 commit comments