Skip to content

Commit baf53b0

Browse files
Merge pull request #211 from datakind/fix/eda_endpoint_updates
fix: use latest edvise EdaSummary
2 parents 3a96073 + 55d3616 commit baf53b0

4 files changed

Lines changed: 38 additions & 10 deletions

File tree

cloudbuild-webapp.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@ steps:
3636
- '${_REGION}-docker.pkg.dev/${PROJECT_ID}/edvise-api/webapp:$COMMIT_SHA'
3737
- '--region'
3838
- '${_REGION}'
39+
- name: curlimages/curl
40+
args:
41+
- '-X'
42+
- POST
43+
- '-H'
44+
- 'Content-Type: application/json'
45+
- '-f'
46+
- '-d'
47+
- >-
48+
{"text":"🚀 *$REPO_NAME* deployed · `$BRANCH_NAME` · $TRIGGER_NAME · $BUILD_ID"}
49+
- >-
50+
https://hooks.slack.com/triggers/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
51+
id: notify-slack
3952
timeout: 600s
4053
options:
4154
logging: CLOUD_LOGGING_ONLY

src/webapp/routers/data.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -510,15 +510,21 @@ class GpaChartData(BaseModel):
510510
min_gpa: Optional[float] = None
511511

512512

513-
class TermSeries(BaseModel):
514-
key: str
515-
label: str
516-
data: List[int]
513+
class TermCountPct(BaseModel):
514+
count: int
515+
percentage: float
516+
name: str
517+
518+
519+
class YearTermSummary(BaseModel):
520+
year: str
521+
total: int
522+
terms: List[TermCountPct]
517523

518524

519525
class StudentsByCohortTerm(BaseModel):
520526
years: List[str]
521-
terms: List[TermSeries]
527+
by_year: List[YearTermSummary]
522528

523529

524530
class TermChartData(BaseModel):

src/webapp/routers/data_test.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,10 +854,16 @@ def mock_read_csv(bucket_name: str, blob_path: str) -> pd.DataFrame:
854854
assert "2020" in data["gpa_by_enrollment_type"]["cohort_years"]
855855
assert "2021" in data["gpa_by_enrollment_type"]["cohort_years"]
856856

857-
# Check term data structure
857+
# Check term data structure (degree_types style: years + by_year with total and terms[{ count, percentage, name }])
858858
assert "years" in data["students_by_cohort_term"]
859-
assert "terms" in data["students_by_cohort_term"]
859+
assert "by_year" in data["students_by_cohort_term"]
860860
assert len(data["students_by_cohort_term"]["years"]) == 2
861+
by_year = data["students_by_cohort_term"]["by_year"]
862+
assert len(by_year) == 2
863+
assert "year" in by_year[0] and "total" in by_year[0] and "terms" in by_year[0]
864+
assert all(
865+
"count" in t and "percentage" in t and "name" in t for t in by_year[0]["terms"]
866+
)
861867

862868
# Check enrollment type by intensity has categories and series
863869
assert "categories" in data["enrollment_type_by_intensity"]

uv.lock

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)