Re: Migrating to BTrees 4.x
Jim Fulton <[email protected]>
| Newsgroups | gmane.comp.web.zope.zodb |
|---|---|
| Message-ID | <CAPDm-FhmwugfqcfH+Ug7wg75paT+cDfk9PPhiJGkRokDd-zwfg@mail.gmail.com> |
On Thu, Jan 5, 2017 at 1:11 PM, David Glick (Glick Software) < [email protected]> wrote: > On 1/5/17 10:01 AM, Jim Fulton wrote: > >> So, now the problem will move up through the application stack. :) >> >> And perhaps become harder. >> >> But surely people have built apps with BTrees 4, because BTrees 4 was >> released a loooooooong time ago (late 2012), and this seatbelt was >> introduced in BTrees 4.0. >> >> When indexing content, you will very often encounter content without a >> value set, typically defaulting to None. >> >> When such values are indexed, you'll get an error. I don't see any guard >> against this error in, for example, zope.index. >> >> Have people built newer apps with indexing on BTrees 4? If so, how have >> you dealt with this issue? >> >> Thanks for the release. > > Products.ZCatalog was updated some time ago to work with BTrees 4. It > explictly checks for None and silently skips indexing it, to avoid erroring > in that scenario: https://github.com/zopefoundat > ion/Products.ZCatalog/blob/master/src/Products/ > PluginIndexes/unindex.py#L246 Thanks David (and Hanno). Good to know. It's sad that zope.index hasn't gotten a fix. In Postgres (and I assume other RDBMSs), you can specify how nulls are handled, so null values are still handled. I wonder if that's something that should be done here as well. That is, I wonder if indexes should have some special None accommodation. Jim -- Jim Fulton http://jimfulton.info -- You received this message because you are subscribed to the Google Groups "zodb" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.