Ok. Submitted as ticket #1770 On 14 abr, 17:06, "Michael Bayer" <mike...@zzzcomputing.com> wrote: > ogg...@gmail.com wrote: > > Hi, > > > I'm just testing version 0.6 beta 3 with mssql and I've discovered > > that reflecting tables with indexes that contains fields with blank > > spaces raises a KeyError. > > > To correct this I've changed sqlalchemy.dialects.mssql.base: > > > --- sqlalchemy/dialects/mssql/base.py.orig<---->2010-04-14 > > 17:45:54.886344082 +0200 > > +++ sqlalchemy/dialects/mssql/base.py<->2010-04-14 17:45:22.822346126 > > +0200 > > @@ -1090,7 +1090,6 > > @@ > > > @reflection.cache > > def get_indexes(self, connection, tablename, schema=None, > > **kw): > > current_schema = schema or > > self.default_schema_name > > - col_finder = re.compile("(\w > > +)") > > full_tname = "%s.%s" % (current_schema, > > tablename) > > indexes = > > [] > > s = sql.text("exec sp_helpindex '%s'" % > > full_tname) > > @@ -1102,7 +1101,7 > > @@ > > if 'primary key' not in > > row['index_description']: > > > indexes.append({ > > 'name' : > > row['index_name'], > > - 'column_names' : > > col_finder.findall(row['index_keys']), > > + 'column_names' : row['index_keys'].split(', > > '), > > 'unique': 'unique' in > > row['index_description'] > > }) > > return > > indexes > > > Can anybody check this behaviour and then patch the trunk? > > it would be very helpful if you could submit this patch as an attachment > to a new trac ticket (the formatting is screwed up here), as well as an > example of such an index (the blanks are in ...the name ?) > > > > > -- > > You received this message because you are subscribed to the Google Groups > > "sqlalchemy" group. > > To post to this group, send email to sqlalch...@googlegroups.com. > > To unsubscribe from this group, send email to > > sqlalchemy+unsubscr...@googlegroups.com. > > For more options, visit this group at > >http://groups.google.com/group/sqlalchemy?hl=en.
-- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.