Skip to content

Commit f6ef42b

Browse files
authored
InfluxDb v3 sink tags improvements (#795)
The sink will not fail if some of the tags specified are not present in some rows.
1 parent f299616 commit f6ef42b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

quixstreams/sinks/core/influxdb3.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,9 @@ def write(self, batch: SinkBatch):
253253
# by doing str().
254254
# We may add some extra validation here in the future to prevent
255255
# unwanted conversion.
256-
tag = value.pop(tag_key)
257-
tags[tag_key] = tag
256+
if tag_key in value:
257+
tag = value.pop(tag_key)
258+
tags[tag_key] = tag
258259

259260
if self._include_metadata_tags:
260261
tags["__key"] = item.key

0 commit comments

Comments
 (0)