Hi [Instructor/Support Team],
I’m running into repeated grading issues in the lab. Although my code produces correct results — including valid API responses and correctly named columns — the grader continues to fail my submissions. Below are the specific issues I encountered, along with my corresponding code for each exercise.
Exercise 1a
Grader error:
“It seems you did not load the API key from the environment variable. Expected: <class ‘str’>.”
My code:
python
CopyEdit
# GRADED CELL: Exercise 1a
import os
import requests
from dotenv import load_dotenv
BASE_URL = "https://2eraiuh.dlai.link/api/UScensus"
### START CODE HERE ###
# mentor edit: code removed - not allowed by the Code of Conduct
### END CODE HERE ###
This returns status code
200
and real data, confirming that the API key is loaded correctly as a string.
Exercise 7
Grader error:
“Object required for grading not found. The grader omits cells that throw errors.”
My code:
python
CopyEdit
# GRADED CELL: Exercise 7
### START CODE HERE ###
# mentor edit: code removed
### END CODE HERE ###
This code runs successfully, and the
"priority_score"
column appears in the DataFrame. However, the grader seems to ignore it.
Exercise 8
Grader error:
“[‘priority_score’] not found in axis”
My code:
python
CopyEdit
# GRADED CELL: Exercise 8
### START CODE HERE ###
# mentor edit: code removed
### END CODE HERE ###
This fails only because the grader cannot find the
"priority_score"
column — likely due to Exercise 7 not being detected as completed.
Summary:
- API calls return expected results.
- Column names match the spec (
"priority_score"
, not"priority score"
). - All output appears correct in the notebook, yet the grader fails due to environment or dependency issues.
I’d appreciate your help resolving this, or guidance on how to match the grader’s expectations more closely.
Thank you,
Anil