Skip to content

Commit

Permalink
Merge pull request #3783 from betagouv/missing_param_open_extract
Browse files Browse the repository at this point in the history
Extract open-data : Fix colonne canteen_central_kitchen_siret
  • Loading branch information
alemangui authored Apr 8, 2024
2 parents 7ac5ed9 + d7a4072 commit 3c9cd15
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions data/schemas/CHANGELOG_TELEDECLARATION.MD
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ Tous les changements notables apportés aux jeux de données exposés sur data.g

### Modification
* Amélioration du remplissage des données `department` et `region` pour les jeux de données télédéclaration
* Uniformisation du nom de colonnes :
* `cantine_central_kitchen_siret` => `canteen_central_kitchen_siret`
* `cantine_satellite_canteens_count` => `canteen_satellite_canteens_count`
* `cantine_management_type` => `canteen_management_type`
* `cantine_production_type` => `canteen_production_type`

## 2024-03-29

Expand Down
7 changes: 6 additions & 1 deletion macantine/extract_open_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,12 @@ def extract_dataset(self):
self.df["teledeclaration_ratio_egalim_hors_bio"] = (
self.df["teledeclaration.value_sustainable_ht"] / self.df["teledeclaration.value_total_ht"]
)
self.df["teledeclaration_type"] = self.df["teledeclaration.diagnostic_type"] # Renaming to match schema

# Renaming to match schema
if "teledeclaration.diagnostic_type" in self.df.columns:
self.df["teledeclaration_type"] = self.df["teledeclaration.diagnostic_type"]
if "central_kitchen_siret" in self.df.columns:
self.df["canteen.central_kitchen_siret"] = self.df["central_kitchen_siret"]

logger.info("TD campagne : Clean dataset...")
self._clean_dataset()
Expand Down

0 comments on commit 3c9cd15

Please sign in to comment.