-
Notifications
You must be signed in to change notification settings - Fork 118
Description
Hello,
First of all thank you for setting up this lab π₯
I spotted one typo:
The return type of service.models.Product.find_by* methods is a flask_sqlalchemy.query.Query, and not a list as what is shown in the code in https://github.com/ibm-developer-skills-network/xgcyk-tdd-bdd-final-project-template/blob/main/service/models.py#L193
I.e. in line https://github.com/ibm-developer-skills-network/xgcyk-tdd-bdd-final-project-template/blob/main/service/models.py#L193 we see:
def find_by_name(cls, name: str) -> list:
"""Returns all Products with the given name
:param name: the name of the Products you want to match
:type name: str
:return: a collection of Products with that name
:rtype: list
"""
logger.info("Processing name query for %s ...", name)
return cls.query.filter(cls.name == name)However, actually the return type is flask_sqlalchemy.query.Query : the cls.query.filter functionsreturns a Query object
So I think this typo could be fixed, and furthermore could be spotted by the static linter
This typo is present in all of the find_by functions.
Lore: I discovered this typo when I was working on the lab, trying to get the length of the returned list with len was failing π₯²
Thank you and have a nice day ! π