Skip to content

Commit

Permalink
fix: use sum instead of count with new observations mailles MV
Browse files Browse the repository at this point in the history
  • Loading branch information
jpm-cbna committed Apr 16, 2024
1 parent cc2096c commit 9b856ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions atlas/modeles/repositories/vmObservationsMaillesRepository.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
},
)
Expand Down

0 comments on commit 9b856ec

Please sign in to comment.