Bug in Capstone Exercise 8 – Grader wrongly flags correct solution
Hi everyone,
I’m reporting what appears to be a bug in the grader for Capstone – Exercise 8: Success Rates by Inspection Type.
Context
The instructions ask us to:
- Select
INSPECTION_TYPE
- Count total inspections per type (alias:
total_inspections
) - Compute pass_rate as
% of inspections with SCORE ≤ 13
- Compute avg_score using
AVG(SCORE)
- Filter out
NULL
scores - Only include rows with at least 5 inspections
- Group by
INSPECTION_TYPE
- Order by
pass_rate DESC
I implemented all of this strictly as instructed, and the resulting DataFrame matches the expected output exactly, including all column values, aliases, and sorting.
My Output
INSPECTION_TYPE | total_inspections | pass_rate | avg_score |
---|---|---|---|
Reopening Inspection | 736 | 58.152174 | 16.722826 |
Re-inspection | 13456 | 37.225030 | 27.152125 |
Initial Inspection | 33171 | 34.237738 | 27.753037 |
Second Compliance Inspection | 54 | 29.629630 | 30.648148 |
Compliance Inspection | 643 | 17.729393 | 35.023328 |
This is a perfect match with the “Expected Output” shown by the graded lab.
Grader Feedback (Incorrect)
“Failed test case: The number of rows in success_rate_df is less than expected. Make sure you did not filter out any additional rows, and that you are grouping by the correct column.”
This is clearly a false negative.
All other tests passed
- I’ve completed all other exercises in this Capstone with 10/10.
- I have a 100% score in this entire specialization.
- This is the only failing case, and I’ve debugged it fully.
Request
Please investigate this grader issue. The output is correct and the error seems to stem from:
- A hardcoded row count expectation
- Or a bug in filtering logic inside the grader
Happy to provide SQL code or notebook upon request.
Thanks!