def METHOD_NAME(query, expected_unique_vals, expected_nunique_vals):
    cat = ESMCatalogModel.from_dict({'esmcat': sample_esmcat_data, 'df': sample_df})
    df_sub = cat.search(query=query)
    cat_sub = ESMCatalogModel.from_dict({'esmcat': sample_esmcat_data, 'df': df_sub})
    assert cat_sub.unique().to_dict() == expected_unique_vals
    assert cat_sub.nunique().to_dict() == expected_nunique_vals