ENH: add filter_by_patch query