sdbrgo commited on
Commit
2b8ffe7
·
verified ·
1 Parent(s): 6f26c8c

Update phase/ingestion.py

Browse files

modified validation for required column; changed from "barangay" to "group"

Files changed (1) hide show
  1. phase/ingestion.py +4 -3
phase/ingestion.py CHANGED
@@ -32,9 +32,10 @@ def ingest_adoption(file):
32
  return {}
33
 
34
  # handle missing required column
35
- if "barangay" not in adoption_df.columns:
36
- raise ValueError("Adoption data must contain \"barangay\" column.")
 
37
 
38
- participants_by_group = adoption_df.groupby("barangay").size().to_dict()
39
 
40
  return participants_by_group
 
32
  return {}
33
 
34
  # handle missing required column
35
+ # there must be a "group" column in the adoption dataset
36
+ if "group" not in adoption_df.columns:
37
+ raise ValueError("Adoption data must contain \"group\" column.")
38
 
39
+ participants_by_group = adoption_df.groupby("group").size().to_dict()
40
 
41
  return participants_by_group