query=f"SELECT timestamp, kpi_value FROM {self.table} WHERE kpi_id = '{kpi_id}' AND (timestamp BETWEEN '{timestamp_float_to_string(start_date)}' AND '{timestamp_float_to_string(end_date)}')"
ifself.postgre:
kpi_list=self.run_query_postgre(query)
LOGGER.debug(f"kpi_list postgre: {kpi_list}")
else:
kpi_list=self.run_query(query)
LOGGER.debug(f"kpi_list influx: {kpi_list}")
ifkpi_list:
LOGGER.debug(f"New data received for subscription to KPI {kpi_id}")
returnkpi_list
else:
LOGGER.debug(f"No new data for the subscription to KPI {kpi_id}")
except (Exception)ase:
LOGGER.debug(f"Subscription data cannot be retrieved. {e}")