logged_query should not try to force "args" into a tuple, it might be a dictionary.
The map_values function does pass a dictionary and casting it into a tuple will cause an error.