From ba1fe415cd725a6f0478494d074d4db1c8a0fc2d Mon Sep 17 00:00:00 2001 From: junjun Date: Tue, 22 Jul 2025 17:01:44 +0800 Subject: [PATCH] fix: sqlserver encode --- backend/apps/datasource/models/datasource.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/apps/datasource/models/datasource.py b/backend/apps/datasource/models/datasource.py index 08e38ca9..1f810e9e 100644 --- a/backend/apps/datasource/models/datasource.py +++ b/backend/apps/datasource/models/datasource.py @@ -99,7 +99,7 @@ class DatasourceConf(BaseModel): class TableSchema: def __init__(self, attr1, attr2): self.tableName = attr1 - self.tableComment = attr2 if isinstance(attr2, str) else attr2.decode("utf-8") + self.tableComment = attr2 if attr2 is None or isinstance(attr2, str) else attr2.decode("utf-8") tableName: str tableComment: str @@ -109,7 +109,7 @@ class ColumnSchema: def __init__(self, attr1, attr2, attr3): self.fieldName = attr1 self.fieldType = attr2 - self.fieldComment = attr3 if isinstance(attr3, str) else attr3.decode("utf-8") + self.fieldComment = attr3 if attr3 is None or isinstance(attr3, str) else attr3.decode("utf-8") fieldName: str fieldType: str