Skip to content

Commit 5e861af

Browse files
committed
fix get_schema_names to remove trailing spaces
Fixes #172 Signed-off-by: Michael Maltese <[email protected]>
1 parent 894c608 commit 5e861af

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ibm_db_sa/reflection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def get_schema_names(self, connection, **kw):
217217
query = sql.select(sysschema.c.schemaname).\
218218
where(not_(sysschema.c.schemaname.like('SYS%'))).\
219219
order_by(sysschema.c.schemaname)
220-
return [self.normalize_name(r[0]) for r in connection.execute(query)]
220+
return [self.normalize_name(r[0].rstrip()) for r in connection.execute(query)]
221221

222222
@reflection.cache
223223
def get_table_names(self, connection, schema=None, **kw):
@@ -640,7 +640,7 @@ def get_schema_names(self, connection, **kw):
640640
where(~sysschema.c.schemaname.like(str('Q%'))). \
641641
where(~sysschema.c.schemaname.like(str('SYS%'))). \
642642
order_by(sysschema.c.schemaname)
643-
return [self.normalize_name(r[0]) for r in connection.execute(query)]
643+
return [self.normalize_name(r[0].rstrip()) for r in connection.execute(query)]
644644

645645
# Retrieves a list of table names for a given schema
646646
@reflection.cache
@@ -990,7 +990,7 @@ def get_schema_names(self, connection, **kw):
990990
query = sql.select(sysschema.c.tabschema).\
991991
where(not_(sysschema.c.tabschema.like('SYS%'))).\
992992
distinct(sysschema.c.tabschema)
993-
return [self.normalize_name(r[0]) for r in connection.execute(query)]
993+
return [self.normalize_name(r[0].rstrip()) for r in connection.execute(query)]
994994

995995
def get_table_comment(self, connection, table_name, schema=None, **kw):
996996
raise NotImplementedError()

0 commit comments

Comments
 (0)