[Zope-Coders] Re: [Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/DateRangeIndex - DateRangeIndex.py:1.6.2.2

Tres Seaver tseaver at zope.com
Tue Nov 4 08:36:10 EST 2003


On Mon, 2003-11-03 at 20:32, Chris McDonough wrote:
> On Mon, 2003-11-03 at 20:03, Tres Seaver wrote:
> > I think a better fix here would be to raise ValueError if the Date is
> > outside the "int-able" range;  otherwise, we end up moving the
> > "surprise" point for the one where we have information (indexing) to the
> > one where we don't (querying).
> 
> The problem with raising any error here is that it stops indexing from
> happening.  Without really fixing the problem (using OOBTrees), we need
> to prevent indexing from throwing errors (the other indexes do similar
> stuff).  Maybe we could log the error?

Hmm, I don't see how we can satisfy these competing goals:

  - Trying to index an object with invalid target value(s) for a given
    index must allow other indexing  to occur;  hence, the index may not
    raise an exception;

  - Users should not be surprised at being unable to find such objects.

It seems to me to be either an application error or a configuration
error to catalog such an object at all:  the remedy is either to remove
the index, or repair the object.  I guess the choice here should really
be the applications (in this case, the catalog);  the index should
probably raise the exception, but then have the catalog drop it on the
floor, if appropriate.  We could then add a configuration option to the
catalog to enable "strict" indexing, if so desired

BTW,what does a text index do if asked to index a non-StringTypes value?

Tres.
-- 
===============================================================
Tres Seaver                                tseaver at zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com




More information about the Zope-Coders mailing list