# RAGC1M3 lab - validation (unittests) fails for no obvious reason (error related to number of outputs)

**URL:** <https://community.deeplearning.ai/t/ragc1m3-lab-validation-unittests-fails-for-no-obvious-reason-error-related-to-number-of-outputs/884995>\
**Category:** Retrieval Augmented Generation\
**Tags:** week-module-3, dl-ai-learning-platform\
**Created:** [December 13, 2025, 4:56pm UTC](https://community.deeplearning.ai/t/ragc1m3-lab-validation-unittests-fails-for-no-obvious-reason-error-related-to-number-of-outputs/884995 "2025-12-13T16:56:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NickRiches](https://avatars.discourse-cdn.com/v4/letter/n/9fc348/32.png) [@NickRiches](https://community.deeplearning.ai/u/NickRiches)\
**Post date:** [December 13, 2025, 4:56pm UTC](https://community.deeplearning.ai/t/ragc1m3-lab-validation-unittests-fails-for-no-obvious-reason-error-related-to-number-of-outputs/884995/1 "2025-12-13T16:56:14Z")

</div>

Hi. I am getting the error:

Failed test case: Incorrect number of elements for function call filter\_by\_metadata(property = title, values = [‘US’], limit = 1).  
Expected: 1  
Got: 2

But the code being run, supplied by the authors of the lab, specified as a limit of 2. The output of my function is exactly the same as the model output. I have tried changing the formatting of the function so arguments are on separate lines / the same line, but this makes no difference.

Does anyone have any suggestions?

---

<div class="post-metadata">

**Author:** ![lukmanaj](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/lukmanaj/32/161609_2.png) [@lukmanaj](https://community.deeplearning.ai/u/lukmanaj)\
**Post date:** [December 13, 2025, 7:57pm UTC](https://community.deeplearning.ai/t/ragc1m3-lab-validation-unittests-fails-for-no-obvious-reason-error-related-to-number-of-outputs/884995/2 "2025-12-13T19:57:18Z")

</div>

I think you missed something in your implementation. The hint is to check how you called `collection.query.fetch_objects`, especially the `limit` argument. Make sure your `filters` and `limit` arguments are set correctly.

---

<div class="post-metadata">

**Author:** ![NickRiches](https://avatars.discourse-cdn.com/v4/letter/n/9fc348/32.png) [@NickRiches](https://community.deeplearning.ai/u/NickRiches)\
**Post date:** [December 14, 2025, 9:21am UTC](https://community.deeplearning.ai/t/ragc1m3-lab-validation-unittests-fails-for-no-obvious-reason-error-related-to-number-of-outputs/884995/3 "2025-12-14T09:21:43Z")

</div>

Gotcha. For some reason I specified limit as a constant in the function. So my mistake.
