In Python explicit is better than implicithttps://www.python.org/dev/peps/pep-0020/
It is worth noting that using re.match instead of re.search provides, essentially, an implicit ^ to the regex argument. So, it could be left out in this instance.
I went through all my previous comments and marked them as spoiler as needed.
Thanks for letting me know. I assumed everything in the solutions section was hidden from anyone who hadn't completed the kata.
Please, do use the spoiler flag when you post comment (even here: comments about solutions are visible in the dashboard by anyone) with indications about the solution. I did flag your message.
This comment is hidden because it contains spoiler information about the solution
Right... Good call. In that case, the sales table should have a default for the department id field set to 0, and then the unknown row would have an ID of 0
Because id cannot be null in table departments (cause PK), then no values will be provided for result.
If the db is built properly, the departments table would have a null row that would have the name "Unknown"
And what happens if the department_id field of the sales table is null your solution falls.
eval() is now disabled
Note: python 2 & 3 compatible solution
It probably means that your solution doesn't work with integer string values as described in the problem description. Your solution returns [1.0, 2.0, 3.0] for parameter array ["1", "2", "3"] whereas it should return [1, 2, 3]. The test set seems to be a bit lacking as they are not testing this case.
Don't understand question :(
What about integers?