tianyunperfect 2 anni fa
parent
commit
671c5bb306
2 ha cambiato i file con 7 aggiunte e 19 eliminazioni
  1. 1 1
      project/call_sh_app.py
  2. 6 18
      tmp.py

+ 1 - 1
project/call_sh_app.py

@@ -97,4 +97,4 @@ def download(path: str):
 
 if __name__ == '__main__':
     # uvicorn call_sh:app --reload --port 19999
-    uvicorn.run(app='call_sh_app:app', host="0.0.0.0", port=9999, reload=True, debug=True)
+    uvicorn.run(app='call_sh_app:app', host="0.0.0.0", port=9999, reload=True)

+ 6 - 18
tmp.py

@@ -1,19 +1,7 @@
-import datetime
+import pandas as pd
+import psycopg2
 
-import requests
-import ssl
-
-ssl._create_default_https_context = ssl._create_unverified_context
-
-requests.post("https://api.tianyunperfect.cn/web_history/location_history", json={
-    "location_str": "tset",
-    "location_xy": "test",
-    "msg": "test",
-    "create_time": "2022-10-01 1:1:1",
-    "update_time": "2022-10-01 1:1:1",
-})
-
-
-def exec(obj):
-    obj['jicha_person_180days'] = 777
-    return obj
+eng_idc = psycopg2.connect(database='data_warehouse_bigtree', user='model', password='model123', host='10.0.54.80')
+sql = "select * from udt.model_score_monitor limit 5 offset 0;"
+data_df = pd.read_sql(sql=sql, con=eng_idc)
+# data_df.to_excel('excel1.xlsx', sheet_name='Sheet1', index=False)  # index false为不写入索引