Open Simoliv opened 3 weeks ago
Great somebody took a look.
Broken in 5.0.4, tried latest version also
>>> redis.VERSION
(5, 1, '0b6')
>>>
Hi @Simoliv ,
When you create the timeseries, you can't use kwargs. You must write it as:
r.execute_command('TS.CREATE', 'ts_key', 'labels', "label1", 1, "label2", 2, 'duplicate_policy', "LAST")
and then things start to work. Just like you did when adding entries to the time series.
Though the simpler code to create the series would be:
ts.create("ts_key", labels={"label1": "1", "label2": "2"})
Not sure if you are aware of this detail from the TS.ADD command documentation:
LABELS {label value}... is set of label-value pairs that represent metadata labels of the time series. Use it only if you are creating a new time series. It is ignored if you are adding samples to an existing time series. See LABELS in TS.CREATE.
So, given that you pre-create your timeseries with labels, by the time you do TS.ADD
you don't need to specify the labels. They would be useful if the timeseries would be missing and have to be created before adding.
Hope this helps.
Regards, Gabriel
Version: Latest I guess, installed from pypi, redis is docker container, also latest
Platform: Ubuntu 22.04
Description:
I do not get any labels, no matter what I try. I tried from the documentation:
results in
No labels. Is it a problem or am I doing anything wrong ?