Skip to content

Commit ba1fe41

Browse files
committed
fix: sqlserver encode
1 parent 4abf176 commit ba1fe41

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/apps/datasource/models/datasource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def to_dict(self):
9999
class TableSchema:
100100
def __init__(self, attr1, attr2):
101101
self.tableName = attr1
102-
self.tableComment = attr2 if isinstance(attr2, str) else attr2.decode("utf-8")
102+
self.tableComment = attr2 if attr2 is None or isinstance(attr2, str) else attr2.decode("utf-8")
103103

104104
tableName: str
105105
tableComment: str
@@ -109,7 +109,7 @@ class ColumnSchema:
109109
def __init__(self, attr1, attr2, attr3):
110110
self.fieldName = attr1
111111
self.fieldType = attr2
112-
self.fieldComment = attr3 if isinstance(attr3, str) else attr3.decode("utf-8")
112+
self.fieldComment = attr3 if attr3 is None or isinstance(attr3, str) else attr3.decode("utf-8")
113113

114114
fieldName: str
115115
fieldType: str

0 commit comments

Comments
 (0)