From b23147ce48f484045434f1542c6da71498f03d83 Mon Sep 17 00:00:00 2001 From: Paul Makepeace Date: Tue, 26 Apr 2011 18:56:59 -0400 Subject: [PATCH] Fix TextFilterFacet and make query most important option. --- google/refine/facet.py | 6 +++--- google/test/test_facet.py | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/google/refine/facet.py b/google/refine/facet.py index 6d0044c..88d52ac 100644 --- a/google/refine/facet.py +++ b/google/refine/facet.py @@ -36,9 +36,9 @@ class Facet(object): class TextFilterFacet(Facet): - def __init__(self, column, query): - super(TextFacet, self).__init__(column, type='text', mode='text', - query=query, **options) + def __init__(self, column, query, **options): + super(TextFilterFacet, self).__init__(column, query=query, type='text', + mode='text', **options) class TextFacet(Facet): diff --git a/google/test/test_facet.py b/google/test/test_facet.py index 1a8ca83..7f90444 100644 --- a/google/test/test_facet.py +++ b/google/test/test_facet.py @@ -49,6 +49,8 @@ class FacetTest(unittest.TestCase): facet = FlaggedFacet(False) self.assertEqual(facet.selection[0]['v']['v'], False) self.assertRaises(ValueError, FlaggedFacet, 'false') # no strings + facet = TextFilterFacet('column name', 'query') + self.assertEqual(facet.query, 'query') def test_selections(self): facet = TextFacet('column name')