Skip to content

Commit b081fa1

Browse files
committed
Don't append 'i' to bools (Closes: influxdata#235)
1 parent cec332f commit b081fa1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

influxdb/line_protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _escape_value(value):
5959
"\n", "\\n"
6060
)
6161
)
62-
elif isinstance(value, integer_types):
62+
elif isinstance(value, integer_types) and not isinstance(value, bool):
6363
return str(value) + 'i'
6464
else:
6565
return str(value)

influxdb/tests/test_line_protocol.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def test_make_lines(self):
2222
"int_val": 1,
2323
"float_val": 1.1,
2424
"none_field": None,
25+
"bool_val": True,
2526
}
2627
}
2728
]
@@ -30,7 +31,7 @@ def test_make_lines(self):
3031
self.assertEqual(
3132
line_protocol.make_lines(data),
3233
'test,integer_tag=2,string_tag=hello '
33-
'float_val=1.1,int_val=1i,string_val="hello!"\n'
34+
'bool_val=True,float_val=1.1,int_val=1i,string_val="hello!"\n'
3435
)
3536

3637
def test_string_val_newline(self):

0 commit comments

Comments
 (0)