Module 4 - Capstone - Exercice 8 - Grader Error : The number of rows in success_rate_df is less than expected

:red_exclamation_mark: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.

:magnifying_glass_tilted_left: 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.

:white_check_mark: 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.

:cross_mark: 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.

:test_tube: 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.

:speech_balloon: 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!

This API key problem is not related…
@MiloAndelic could you please remove your posts from this thread, since you did the right thing by creating a proper thread on this matter ? Thank you

The main problem with exercice 8 is still unresolved.
Anyone is facing the same grading issue or managed to get through it ?

Hi Christophe, and thank you for reporting! We’ll look into this today.

1 Like

And yes please send me your notebook via direct message so we can replicate the issue. Thanks!

1 Like

Hi @chris.favila, I just DM you with my notebook so you can replicate the issue

Thank you !

The issue was caused by the instruction:
“Only shows inspection types that have at least 5 inspections.”

As @chris.favila pointed out, this condition was triggering the grader error. Removing that part resolved the issue, and the notebook now scores 100%.

:repeat_button: The exercise has been updated to remove this instruction while the team investigates the grader.

Thanks again!

1 Like