@@ -554,22 +554,30 @@ def exporter_create_ts(rts, time_series, timeseries_name):
554554 )
555555 )
556556 rts .create (timeseries_name , labels = time_series ["labels" ])
557- except redis .exceptions .ResponseError :
558- logging .debug (
559- "Timeseries named {} already exists. Checking that the labels match." .format (
560- timeseries_name
557+ except redis .exceptions .ResponseError as e :
558+ if "already exists" in e .__str__ ():
559+ logging .debug (
560+ "Timeseries named {} already exists. Checking that the labels match." .format (
561+ timeseries_name
562+ )
561563 )
562- )
563- set1 = set (time_series ["labels" ].items ())
564- set2 = set (rts .info (timeseries_name ).labels .items ())
565- if len (set1 - set2 ) > 0 or len (set2 - set1 ) > 0 :
566- logging .info (
567- "Given the labels don't match using TS.ALTER on {} to update labels to {}" .format (
568- timeseries_name , time_series ["labels" ]
564+ set1 = set (time_series ["labels" ].items ())
565+ set2 = set (rts .info (timeseries_name ).labels .items ())
566+ if len (set1 - set2 ) > 0 or len (set2 - set1 ) > 0 :
567+ logging .info (
568+ "Given the labels don't match using TS.ALTER on {} to update labels to {}" .format (
569+ timeseries_name , time_series ["labels" ]
570+ )
571+ )
572+ rts .alter (timeseries_name , labels = time_series ["labels" ])
573+ pass
574+ else :
575+ logging .error (
576+ "While creating timeseries named {} with the following labels: {} this error ocurred: {}" .format (
577+ timeseries_name , time_series ["labels" ], e .__str__ ()
569578 )
570579 )
571- rts .alter (timeseries_name , labels = time_series ["labels" ])
572- pass
580+ raise
573581
574582
575583def extract_redisgraph_version_from_resultdict (results_dict : dict ):
0 commit comments