TST: add test for dtype query fix
BUG/FIX: fix dtype issue when querying