Fix DB2 Schema Trailing Whitespaces (#17475)

This commit is contained in:
IceS2 2024-08-20 08:13:14 +02:00 committed by GitHub
parent 3ad096a889
commit ddd8c41864
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,7 +10,7 @@
# limitations under the License.
"""Db2 source module"""
import traceback
from typing import Optional
from typing import Iterable, Optional
from ibm_db_sa.base import ischema_names
from sqlalchemy.engine.reflection import Inspector
@ -52,6 +52,13 @@ class Db2Source(CommonDbSourceService):
)
return cls(config, metadata)
def get_raw_database_schema_names(self) -> Iterable[str]:
if self.service_connection.__dict__.get("databaseSchema"):
yield self.service_connection.databaseSchema
else:
for schema_name in self.inspector.get_schema_names():
yield schema_name.rstrip()
@staticmethod
def get_table_description(
schema_name: str, table_name: str, inspector: Inspector