allow data helper to be a function
Fixing when the data helper is a function for the local query

Signed-off-by: Igor Vaynberg <igor.vaynberg@gmail.com>