From 5780679a2b3e3fac6eef1dcac5703a05adc660a5 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 13 Jun 2023 17:35:45 +0100 Subject: [PATCH] FEA: Add cloud function for extracting new measurement sessions --- data_gateway_sessions/main.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 data_gateway_sessions/main.py diff --git a/data_gateway_sessions/main.py b/data_gateway_sessions/main.py new file mode 100644 index 0000000..187991d --- /dev/null +++ b/data_gateway_sessions/main.py @@ -0,0 +1,18 @@ +import logging + +from aerosense_tools.queries import BigQuery +from octue.log_handlers import apply_log_handler + + +apply_log_handler() +logger = logging.getLogger(__name__) + + +def extract_and_add_new_measurement_sessions(event, context): + """Extract new measurement sessions from the sensor data table and add them to the sessions table. + + :param dict event: Google Cloud event + :param google.cloud.functions.Context context: metadata for the event + :return None: + """ + BigQuery().extract_and_add_new_measurement_sessions()