I’m encountering the following error in the M2_UGL_1 lab on
Step 2: Executing chart code (V1)… :
TypeError: datetime64 type does not support sum operations
This error occurs in the part of the code that runs the complete agentic workflow. Before the error appears, the generated graph resulting from the reflection step has no bars.
I’ll do some debugging on my end, but it might be helpful if the course monitors could take a look at this lab as well.
please follow the below thread to see the update from staff while developers are working on resolving this issue. This issue was raised recently by other learners too.
This is pretty bad way to escalate the issue. It has been over 2 weeks and people are still experiencing the same issue. Practically speaking, as one is learning, does Deeplearning expect people to sit and wait for a resolution for 2 weeks? At that rate, the course would complete in very long time making it unreliable.
Hi - after some reflection I changed the user instructions in the prompt as below and was able to generate V1 charts (although they were not stacked bar charts):
User instruction: {instruction}
Requirements for the code:
Assume the DataFrame is already loaded as ‘df’.
When concatenating columns with dates or times, convert the columns to str first
When performing columns sums, only sum numeric columns
Use matplotlib for plotting.
Add clear title, axis labels, and legend if needed.
Hello DeepSpark! - I get how frustrating it can be when the lab doesn’t run properly and thank you for reporting this and coming up with a reflection! super useful!
Here are my notes about this lab, remember that the LLM actually writes code that’s then executed to make the chart. Sometimes it doesn’t format the code correctly.
Try these quick fixes:
Run the cell again (often works on the second or third try).
Make a tiny change in your prompt or code so the LLM regenerates fresh output. (I, myself, am testing the generated code by the LLM in a colab notebook to test the result and so and how I can improve the prompt to get it working)
If it still fails, it’s likely the model just produced incorrect code — totally normal for some models.
I’d also add this “kind of” warning in the prompt:
"remove/avoid the line that attempts to combine the date and year string, as the date column already contains the complete date information."