Skip to content

Commit b9a915a

Browse files
author
Jay Clifford
committed
HOTFIX: Escaping
1 parent 6ceac2c commit b9a915a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

influxdb_client_3/write_client/client/write/dataframe_serializer.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,23 +322,26 @@ def __init__(self, data_frame, point_settings, precision=DEFAULT_WRITE_PRECISION
322322
else:
323323
self.number_of_chunks = None
324324

325-
def escape_value(self,value):
325+
def escape_key(self,value):
326326
return str(value).translate(_ESCAPE_KEY)
327+
328+
def escape_value(self,value):
329+
return str(value).translate(_ESCAPE_STRING)
327330

328331

329332
def to_line_protocol(self, row):
330333
# Filter out None or empty values for tags
331334
tags = ""
332335

333336
tags = ",".join(
334-
f'{self.escape_value(col)}={self.escape_value(row[self.column_indices[col]])}'
337+
f'{self.escape_key(col)}={self.escape_key(row[self.column_indices[col]])}'
335338
for col in self.tag_columns
336339
if row[self.column_indices[col]] is not None and row[self.column_indices[col]] != ""
337340
)
338341

339342
if self.point_settings.defaultTags:
340343
default_tags = ",".join(
341-
f'{self.escape_value(key)}={self.escape_value(value)}'
344+
f'{self.escape_key(key)}={self.escape_key(value)}'
342345
for key, value in self.point_settings.defaultTags.items()
343346
)
344347
# Ensure there's a comma between existing tags and default tags if both are present

0 commit comments

Comments
 (0)