소스 검색

调整治理

baoyubo 9 달 전
부모
커밋
d58aee189f
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      DataGovernance.py

+ 4 - 2
DataGovernance.py

@@ -23,8 +23,10 @@ def jwd_to_area(location):
     }
     response = requests.post(url=url, headers=headers, json=location, verify=False)
     if response.status_code == 200:
-        return response.json()['data'][0]['district']
-
+        try:
+            return response.json()['data'][0]['district']
+        except:
+            return None
 def put_area(table : str,longitude='longitude',latitude='latitude'):
     conn=None
     cur = None