From 5e861afee091442a6226538cb9372e77aca4dcb1 Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Thu, 9 Oct 2025 16:27:28 -0400 Subject: [PATCH] fix get_schema_names to remove trailing spaces Fixes #172 Signed-off-by: Michael Maltese --- ibm_db_sa/reflection.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ibm_db_sa/reflection.py b/ibm_db_sa/reflection.py index 9340049..0db54a7 100644 --- a/ibm_db_sa/reflection.py +++ b/ibm_db_sa/reflection.py @@ -217,7 +217,7 @@ def get_schema_names(self, connection, **kw): query = sql.select(sysschema.c.schemaname).\ where(not_(sysschema.c.schemaname.like('SYS%'))).\ order_by(sysschema.c.schemaname) - return [self.normalize_name(r[0]) for r in connection.execute(query)] + return [self.normalize_name(r[0].rstrip()) for r in connection.execute(query)] @reflection.cache def get_table_names(self, connection, schema=None, **kw): @@ -640,7 +640,7 @@ def get_schema_names(self, connection, **kw): where(~sysschema.c.schemaname.like(str('Q%'))). \ where(~sysschema.c.schemaname.like(str('SYS%'))). \ order_by(sysschema.c.schemaname) - return [self.normalize_name(r[0]) for r in connection.execute(query)] + return [self.normalize_name(r[0].rstrip()) for r in connection.execute(query)] # Retrieves a list of table names for a given schema @reflection.cache @@ -990,7 +990,7 @@ def get_schema_names(self, connection, **kw): query = sql.select(sysschema.c.tabschema).\ where(not_(sysschema.c.tabschema.like('SYS%'))).\ distinct(sysschema.c.tabschema) - return [self.normalize_name(r[0]) for r in connection.execute(query)] + return [self.normalize_name(r[0].rstrip()) for r in connection.execute(query)] def get_table_comment(self, connection, table_name, schema=None, **kw): raise NotImplementedError()