If it didn’t work like that, I reckon (without testing) it’ll work if you make the key a text:
```dataview
TABLE WITHOUT ID "![coverimg|100](" + cover + ")" as Cover, link(file.link, title) AS Title, author AS Author, completed AS Read, ratingIcon as Rating
FROM "Books"
FLATTEN {"0": "","1": "★☆☆☆☆","2": "★★☆☆☆","3": "★★★☆☆","4": "★★★★☆","5:: "★★★★★"}[rating] as ratingIcon
WHERE econtains(status, "read")
```