From cc71cbba2d948e19fb84cab9e715722b330db8e9 Mon Sep 17 00:00:00 2001 From: mmaurostoffel <166130318+mmaurostoffel@users.noreply.github.com> Date: Thu, 9 Jan 2025 14:48:33 +0100 Subject: [PATCH] =?UTF-8?q?Endpoint=20f=C3=BCr=20etl=5Fproperty=5Fneighbou?= =?UTF-8?q?rs=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- etl/src/api/main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/etl/src/api/main.py b/etl/src/api/main.py index 1133bec..557dd44 100644 --- a/etl/src/api/main.py +++ b/etl/src/api/main.py @@ -3,6 +3,7 @@ import polars as pl from data import etl_property_capacities as etl_pc from data import etl_property_capacities_monthly as etl_pcm from data import etl_property_capacities_weekdays as etl_pcw +from data import etl_property_neighbours as etl_pn from data import etl_region_capacities as etl_rc from data import etl_region_capacities_comparison as etl_rcc from fastapi import FastAPI, Response @@ -35,6 +36,11 @@ def properties_growth(): def properties_geo(): return d.properties_geo().pl().to_dicts() +@app.get("/property/{id}/neighbours") +def property_extractions(id: int): + capacities = etl_pn.property_neighbours(id) + return capacities + @app.get("/property/{id}/extractions") def property_extractions(id: int): return d.extractions_for(property_id = id).pl().to_dicts()