Can you just use `if not data` here, or do you need to check if it is a dict explicitly?