Skip to content

Commit

Permalink
理论上, 下标不会越界的
Browse files Browse the repository at this point in the history
  • Loading branch information
feiazifeiazi committed Oct 14, 2024
1 parent 391d9d1 commit a15fe8c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sql/engines/pgsql.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ def query(
for row in rows:
new_row = []
for idx, col_value in enumerate(row):
column_type_code = column_type_codes[idx] if idx < len(column_type_codes) else None
# 理论上, 下标不会越界的
column_type_code = (
column_type_codes[idx] if idx < len(column_type_codes) else None
)
# 只在列类型为 json 或 jsonb 时转换
if column_type_code in [JSON_TYPE_CODE, JSONB_TYPE_CODE]:
if isinstance(col_value, (dict, list)):
Expand Down

0 comments on commit a15fe8c

Please sign in to comment.