From 9b856ecbf0d8d1b7191952635b04ded0c364f2eb Mon Sep 17 00:00:00 2001 From: Jean-Pascal MILCENT Date: Tue, 16 Apr 2024 15:01:21 +0200 Subject: [PATCH] fix: use sum instead of count with new observations mailles MV --- atlas/modeles/repositories/vmObservationsMaillesRepository.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atlas/modeles/repositories/vmObservationsMaillesRepository.py b/atlas/modeles/repositories/vmObservationsMaillesRepository.py index 5a3180fb1..46e53e1c7 100644 --- a/atlas/modeles/repositories/vmObservationsMaillesRepository.py +++ b/atlas/modeles/repositories/vmObservationsMaillesRepository.py @@ -22,7 +22,7 @@ def getObservationsMaillesChilds(session, cd_ref, year_min=None, year_max=None): VmObservationsMailles.id_maille, TMaillesTerritoire.geojson_maille, func.max(VmObservationsMailles.annee).label("last_obs_year"), - func.count(VmObservationsMailles.nbr).label("obs_nbr"), + func.sum(VmObservationsMailles.nbr).label("obs_nbr"), ) .join( TMaillesTerritoire, @@ -44,7 +44,7 @@ def getObservationsMaillesChilds(session, cd_ref, year_min=None, year_max=None): geometry=json.loads(o.geojson_maille), properties={ "id_maille": o.id_maille, - "nb_observations": o.obs_nbr, + "nb_observations": int(o.obs_nbr), "last_observation": o.last_obs_year, }, )