From 9938c14621aab8cfb490d925bd776324339453be Mon Sep 17 00:00:00 2001 From: hanniabu Date: Thu, 23 May 2024 21:42:30 -0400 Subject: [PATCH] fix error --- _data/smoothing-pools-processed.json | 2 +- .../for_hire_listings.cpython-312.pyc | Bin 0 -> 4438 bytes _scripts/__pycache__/hardware.cpython-312.pyc | Bin 5341 -> 5272 bytes .../__pycache__/job_listings.cpython-312.pyc | Bin 0 -> 4903 bytes .../smoothing_pools.cpython-312.pyc | Bin 4887 -> 4840 bytes .../__pycache__/utilities.cpython-312.pyc | Bin 7180 -> 7285 bytes _scripts/collect_data.py | 6 ++--- _scripts/for_hire_listings.py | 2 +- _scripts/hardware.py | 2 +- _scripts/job_listings.py | 24 +++++++++++++----- _scripts/requirements.txt | 3 +-- _scripts/smoothing_pools.py | 2 +- _scripts/utilities.py | 2 +- 13 files changed, 26 insertions(+), 17 deletions(-) create mode 100644 _scripts/__pycache__/for_hire_listings.cpython-312.pyc create mode 100644 _scripts/__pycache__/job_listings.cpython-312.pyc diff --git a/_data/smoothing-pools-processed.json b/_data/smoothing-pools-processed.json index d235cf0..46194af 100644 --- a/_data/smoothing-pools-processed.json +++ b/_data/smoothing-pools-processed.json @@ -1 +1 @@ -{"smooth":{"validators_active":1914,"validators_pending":13,"validators_total":1927},"smoothly":{"validators_active":55,"validators_pending":66,"validators_total":121}} \ No newline at end of file +{"smooth":{"validators_active":1934,"validators_pending":12,"validators_total":1946},"smoothly":{"validators_active":56,"validators_pending":65,"validators_total":121}} \ No newline at end of file diff --git a/_scripts/__pycache__/for_hire_listings.cpython-312.pyc b/_scripts/__pycache__/for_hire_listings.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c244b45ca9b34e51ddbe812f529aeb5f4248a043 GIT binary patch literal 4438 zcma)9U2Gf25#Bo<|4ES)MM<{&!^D9jg^c2gIIBQ__9btM9iW9@+SwydmKC?@ z65MZhXKrV9c6N65FK)L3LGk|cVkYlF=+6t>xTGzE=M5Js5Ep}7V!bBx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LB|w!On|0Lb{BTxiUu-_fVjAF@>Jnao)wI1v{%Sp5Hi2QVlnxHun%MO nWLps_t~j6ykfV#uCnt*N3Vq_@V&wiP#lR?Yl|i=13Mc^p*X%zA diff --git a/_scripts/__pycache__/job_listings.cpython-312.pyc b/_scripts/__pycache__/job_listings.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bedb3e20a1c0f451ce5457128391edb0b5de9e2c GIT binary patch literal 4903 zcmbtY>2Djy6`$SZwLC;p6m|NL56Pw+9=fa}ZEDGqE!(nW%W@nkiJ2v5Ni9Wk>D{Fy zGGa{!0pbD)>Hr1eqArjRE#TBa5%doz>V68)FJu%~#M%V{v|sW~u?;kEP@r#?T!~iQ zBj^a6-@KVOZ{ECl^X9GosX=r?eFv3(4Emo0Qq%@jd zq%~v~89+K|NEsFl6vE7+5gXn`izaM@+Kf$5Td)~wHb?m^UlY+YK1#J_H#jEy& z7zrl@SrO84Ia*s<12@zR{GNPE5j~Xcv4pPSb`L_*8BAdsGuVKQ*o4j4f>~_EHf+a^ zJ9Zc|*Tx#OF(-DxnET(1H9j}y!5-X%8?YB-Hfw(^&&_MaZMYqGU?<+57dIAA`W?In z@5TG-^fuHfTx;U}xDy}12k{|%7b6!&S_V z$FaC-l4J3h9G4(!pgKc}Q8^G7#dwkrM8#CFCPKmagL7h%hYf8XO6Sr3P^dGy#7Uqs z*s?RFnr72r89v`6YS9eT@1sqegf`2FYs1g>i+K`ci6$t9#Wj;q}TOF<1 zqe+2JD`D+2scek`E(~$`TM5jL~M2L_{D39 z(0u>Gpg$5@o4O|F?PtXZ+==R|ly_)S!o-FkN^J~>b4Brz4n0=T|S z%<$=OBuC7vva6!Btm&jWi6&e!8J75{C}CM;l44wCtG5l#!DmpdJKC$ZsKjG934w#? zLdT=3Q5%%W%hUWJN#q;LVOWDGB#`)_k3a8Q|TQ2+*Eq)YAGpiAv8(P(ExAJ2?8gWaRy+Txk4bt zoHhWwX2=j2GhQ(QU}M(!4MLt3LYy+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vlq*ycE;|1m9Yq;5MPkI4=Q+}Y1<~F9iKht8> z0>HLi$bK{nxU{g!*4aQ0as>pv+h4cWksc}vH1uzO-(IKneqxD3NZAg%hvB-y_wjZZ z-TCUJ&;tC2qCowadcUuVtJEr5V;0aV^}QvW{(mLpYP#&`;G<@IMlAzU*~zsiuYI3N z17I?V+$xD!-p5F@04l{-&x#mx`$l@Q8S+1qaDAF3T?LLQ_{rq$D55QzVH}T~`!}2i zic?!ALU?_5k8XJTi!)Wy;JuZ8VCeexsS{Z}j}ZkN@Sq-eZ|cU>cUugQ-#xW_?~!Nn z30VFeYZv;!HfBOUw~ZY^zh=i6=C`(2nBNWgeS{r1GWSEa zam4%)8KLd7R(;nZ@z=7DFw4>)NL3BQqrM@Nx;Y-y*O9uK!ut&fK(DnmW7*eQo5 F@t?A75>@~J literal 0 HcmV?d00001 diff --git a/_scripts/__pycache__/smoothing_pools.cpython-312.pyc b/_scripts/__pycache__/smoothing_pools.cpython-312.pyc index d8afb2129eaee9c5f3e1a5c94fae0bb4d2a15993..ee4e8410582c0b5dd15641fd89a6fbb3b1d31c03 100644 GIT binary patch delta 185 zcmbQP_Cl5SG%qg~0}u#&_fHGm$h(rCixtRY2I9|BlMnD;mYB=Dnh~Ucfq{{sgd4(Q zV8{}f?8qpr$Wp=w6PeAB!Zw#_4f|>)hzKJ?C4(l%z9_ik#{9O7dw#048)%`CLiFxtd_!7A^=hV0<#(BvaV)? zuo)RjxFIYChAg4Uj*P;JEF~f^k=YC>>~opcaI9v6sjg(uS diff --git a/_scripts/__pycache__/utilities.cpython-312.pyc b/_scripts/__pycache__/utilities.cpython-312.pyc index 6d0f7203aaf6194f3538f182d6cea3569395e421..557fa6d852886d33904e482873489f60da967f64 100644 GIT binary patch delta 1303 zcmZuwOKTKC5Z>NQcGhGjyKZ)}FQbW?#1(ucMB`iYATh2cqDTyqao3*24V#^zW|hQ) ziK3|BlLqnN9}vArz>9bj6arqn$RM6P=t1z{1H8nlo**ht$k*LpS6A2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E)Pcu-^z|N%dmU|6kfpMy$m6B-If+GzDwgkse;{*^4?|}|-DRZnfJLTq5R1l2p zzAtx*P98@KbP==@P!$j+Ac7l}1L$giZE?c}$N|!*gany;MYbxwN%g}y0TMRSMsJ59 z7?LU&6m5tX;h(HhJdO0Q9`P+w8$OF_Y{Tk8HtnV)A*d6fXpJdrDw6kkg-~~$A_Q!p zmr@c)im~XYzA@CBcsCxh8Kx@Pz$H>h9x`0@!oB!HX&%xmuGjl%u@Fo8C(ypg#OH8W zJc+q}8iH9Y@>P+e)K`dmPA7=_D_^I zw1k*RbfNpB#D&d$67%Q?7KJjoQh#@m)YA3_1&6+n+sap;df&WbKIp&K4nzRUq-B@$ zM_KLWNGTi;%(Xszp4iSi#s(E)M* diff --git a/_scripts/collect_data.py b/_scripts/collect_data.py index edc5fa9..c5856fe 100644 --- a/_scripts/collect_data.py +++ b/_scripts/collect_data.py @@ -7,10 +7,10 @@ def run_app(): - update_smoothing_pool_data() - check_hardware_availability() + # update_smoothing_pool_data() + # check_hardware_availability() update_job_listings() - update_for_hire_listings() + # update_for_hire_listings() diff --git a/_scripts/for_hire_listings.py b/_scripts/for_hire_listings.py index 23ebaa6..67e05ac 100644 --- a/_scripts/for_hire_listings.py +++ b/_scripts/for_hire_listings.py @@ -74,7 +74,7 @@ def update_for_hire_listings(): save_listing_data(processed_data) except: error = f"Bad response" - utilities.log(f"{error}: {metric_id}_{data_source}") + utilities.log(f"{error}: {script_id}") utilities.report_error(error, context=f"{script_id}__update_for_hire_listings") diff --git a/_scripts/hardware.py b/_scripts/hardware.py index e7a8584..0c08842 100644 --- a/_scripts/hardware.py +++ b/_scripts/hardware.py @@ -55,7 +55,7 @@ def check_hardware_availability(): save_unavailable_products_data(updated_unavailable_products) else: error = f"Bad response" - utilities.log(f"{error}: {metric_id}_{data_source}") + utilities.log(f"{error}: {script_id}") utilities.report_error(error, context=f"{script_id}__check_hardware_availability") return diff --git a/_scripts/job_listings.py b/_scripts/job_listings.py index 1dc25cd..edd38f4 100644 --- a/_scripts/job_listings.py +++ b/_scripts/job_listings.py @@ -28,10 +28,13 @@ def get_listing_data(): } # get the sheet data # reference: https://docs.gspread.org/en/v5.7.0/user-guide.html + print("gc...") gc = gspread.service_account_from_dict(credentials) - sheet = gc.open_by_key("1FN73olU-8djRhfGqEc7-2LsjfwR6Qqj0T3Y5-bfxHqs").worksheet("Job Listings") + print("sheet...") + sheet = gc.open_by_key(utilities.SHEETS_URL).worksheet("Job Listings") + print("sheet_data...") sheet_data = sheet.get_all_records() - # utilities.log(sheet_data, context=f"{script_id}__get_listing_data") + utilities.log(sheet_data, context=f"{script_id}__get_listing_data") return sheet_data def process_listing_data(raw_data): @@ -69,11 +72,18 @@ def save_listing_data(processed_data): def update_job_listings(): try: raw_data = get_listing_data() + except Exception as e: + print(e) + try: processed_data = process_listing_data(raw_data) + except Exception as e: + print(e) + try: save_listing_data(processed_data) - except: - error = f"Bad response" - utilities.log(f"{error}: {metric_id}_{data_source}") - utilities.report_error(error, context=f"{script_id}__update_job_listings") - + except Exception as e: + print(e) + # except: + # error = f"Bad response" + # utilities.log(f"{error}: {script_id}") + # utilities.report_error(error, context=f"{script_id}__update_job_listings") diff --git a/_scripts/requirements.txt b/_scripts/requirements.txt index d0cc4df..3b148b7 100644 --- a/_scripts/requirements.txt +++ b/_scripts/requirements.txt @@ -1,5 +1,4 @@ -# gspread==6.1.2 -gspread==5.7.0 +gspread==5.12.4 python-dotenv==1.0.1 PyYAML==6.0.1 PyYAML==6.0.1 diff --git a/_scripts/smoothing_pools.py b/_scripts/smoothing_pools.py index c2738d8..17a6316 100644 --- a/_scripts/smoothing_pools.py +++ b/_scripts/smoothing_pools.py @@ -68,7 +68,7 @@ def update_smoothing_pool_data(): save_smoothing_pool_data(smooth_subs, smoothly_subs) else: error = f"Bad response" - utilities.log(f"{error}: {metric_id}_{data_source}") + utilities.log(f"{error}: {script_id}") utilities.report_error(error, context=f"{script_id}__update_smoothing_pool_data") return diff --git a/_scripts/utilities.py b/_scripts/utilities.py index 5b56938..d393284 100644 --- a/_scripts/utilities.py +++ b/_scripts/utilities.py @@ -30,7 +30,7 @@ load_dotenv() GOOGLE_TOKEN = os.environ.get("GOOGLE_TOKEN") - +SHEETS_URL = os.environ.get("SHEETS_URL") def fetch(url, method="GET", payload={}, headers={}, retries=2, delay=0, retry_delay=0, context="", data_type="json"):