fix([2fd88f42]): normalize PLZ column name before final output

This commit is contained in:
2026-02-04 13:07:09 +00:00
parent a942d26baa
commit 5003b2ea58

View File

@@ -132,6 +132,9 @@ async def get_heatmap_data(request: FilterRequest):
# Rename columns to match frontend expectations ('lon' and 'lat')
merged_df.rename(columns={'x': 'lon', 'y': 'lat'}, inplace=True)
# Also rename the original PLZ column to the consistent name 'plz'
merged_df.rename(columns={plz_column_name: 'plz'}, inplace=True)
# Convert to the required JSON format
heatmap_data = merged_df[['plz', 'lat', 'lon', 'count']].to_dict(orient='records')