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

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?

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.

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

1 Like