구글 시트 batch로 수정

feature-imageMatch
김성경 2026-06-19 16:26:39 +09:00
parent 009b1a5d09
commit b908408b4a
2 changed files with 3 additions and 2 deletions

View File

@ -22,7 +22,8 @@ def _read_sheet_data(sheet_name: str) -> tuple[str, str]:
)
gc = gspread.authorize(creds)
ws = gc.open_by_key(prompt_settings.PROMPT_SPREADSHEET).worksheet(sheet_name)
_sheet_cache[sheet_name] = (ws.cell(3, 2).value, ws.cell(2, 2).value)
values = ws.batch_get(["B2:B3"])[0] # [[B2], [B3]]
_sheet_cache[sheet_name] = (values[1][0], values[0][0]) # (B3=template, B2=model)
return _sheet_cache[sheet_name]

View File

@ -7,4 +7,4 @@
ALTER TABLE project
ADD COLUMN biz_type VARCHAR(50) NULL DEFAULT 'place'
COMMENT '업종 분류 (place: 기본, accommodation: 숙박, restaurant: 음식점)';
COMMENT '업종 분류 (place: 기본, accommodation: 숙박, restaurant: 음식점)' AFTER id;