added the query at sample level based on fields. 

It is very limited on purpose, I'll open more functions if they are needed.
dude this is pro python! :clap: 

btw, you can remove the commented line :-P