版本修改

This commit is contained in:
王文艳
2026-07-22 16:13:44 +08:00
parent a11383312e
commit b7534064aa
4 changed files with 92 additions and 70 deletions
+4
View File
@@ -6,6 +6,10 @@ import pandas as pd
from elasticsearch import helpers
import logging
log = logging.getLogger(__name__)
import os
# 🛡️ 极其重要:必须在导入 goojia_utils 之前禁用 ES 8.x 的兼容性 Content-Type 头部请求!
# 这样客户端就会使用普通的 'application/json' 头部,彻底解决低版本 Elasticsearch 报错 406 的故障。
os.environ["ELASTIC_CLIENT_APIVERSIONING"] = "0"
flag = False
for province in areautils.get_all_province():