actually, the issue is that it requires a SQL expression, this should be
improved, but for now do this:
from sqlalchemy.sql import text
op.create_index(
'geocoded',
'locations',
['coordinates'],
postgresql_where=text("locations.coordinates != Null"))
On Apr 24, 2013, at 10:35 AM, Michael Bayer <[email protected]> wrote:
> are you getting a stack trace (I am) ? that would be a bug which needs
> repair.
>
>
> On Apr 24, 2013, at 10:24 AM, Stephan Hügel <[email protected]> wrote:
>
>> This will probably be an obvious answer, but I'm struggling to figure out
>> how to add a partial index using an Alembic (0.5.0) revision.
>>
>> from alembic import op
>> import sqlalchemy as sa
>>
>>
>> def upgrade():
>> op.create_index(
>> 'geocoded',
>> 'locations',
>> ['coordinates'],
>> postgresql_where=locations.coordinates != Null")
>>
>>
>> def downgrade():
>> op.drop_index("geocoded")
>>
>> Isn't working – is it valid to pass that keyword to create_index, and if so,
>> what string should I be passing?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "sqlalchemy" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.