Skip to content

Commit b4ceab9

Browse files
author
Debanjan Basu
committed
[fix] typo in comment + [fix] handles leading comma for the case that the first value column is Null valued
1 parent afcfd25 commit b4ceab9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

influxdb/_dataframe_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def _convert_dataframe_to_lines(self,
363363
tag_df = self._stringify_dataframe(
364364
tag_df, numeric_precision, datatype='tag')
365365

366-
# join preprendded tags, leaving None values out
366+
# join prepended tags, leaving None values out
367367
tags = tag_df.apply(
368368
lambda s: [',' + s.name + '=' + v if v else '' for v in s])
369369
tags = tags.sum(axis=1)
@@ -392,6 +392,8 @@ def _convert_dataframe_to_lines(self,
392392
field_df.columns[1:]]
393393
field_df = field_df.where(~mask_null, '') # drop Null entries
394394
fields = field_df.sum(axis=1)
395+
# take out leading , where first column has a Null value
396+
fields = fields.str.lstrip(",")
395397
del field_df
396398

397399
# Generate line protocol string

0 commit comments

Comments
 (0)