[Zope-Coders] Re: [Zope-Checkins] CVS:
Zope/lib/python/Products/PluginIndexes/DateRangeIndex -
DateRangeIndex.py:1.6.2.2
Casey Duncan
casey at zope.com
Tue Nov 4 09:11:59 EST 2003
On 04 Nov 2003 08:36:10 -0500
Tres Seaver <tseaver at zope.com> wrote:
> 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?
Are you sure? It looks to me like any arbitrary error can be raised during indexing. There doesn't seem to be any particular policy in the indexes and catalog code for swallowing errors.
I would argue that if an index cannot process a value to be indexed, it should raise an error and prevent indexing from succeeding. Otherwise there is no way for the programmer to know when he f***ed up and sent the wrong data to the index.
In this particular case, DateIndexes failing for very large dates is tricky. I'm tempted to chaulk it up to a (now) known limitation of the implementation. Perhaps it should be an option when you create a DateRangeIndex to use an OOBTree? Some sort of "support far future dates (> 2038)" checkbox on the add form. With documentation explaining the tradeoffs. That would maintain BW compatibility, fix your bug and keep things efficient for people who decide they don't care about those kinds of dates.
-Casey
More information about the Zope-Coders
mailing list