Skip to content

Commit 1a71ea2

Browse files
tidy up comments and prints
1 parent 13dfdd6 commit 1a71ea2

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

scripts/jobs/data_and_insight/icaseworks_ingest_to_raw.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,12 @@ def dump_dataframe(response, location, filename):
140140

141141

142142
def get_latest_timestamp(table_dict):
143+
# TODO: reintroduce try except
143144
# try:
144145
print(f"Getting max timestamp")
145146
# 2025-01-05T15:06:16
146147

148+
# TODO: needs refactoring to allow for different tables
147149
sql_query = 'select max("casestatustouchtimes_lastupdatedtime") as latest from "data-and-insight-raw-zone"."icaseworks_foi"'
148150

149151
conn = connect(s3_staging_dir=s3_staging_location, region_name=region_name)
@@ -152,7 +154,7 @@ def get_latest_timestamp(table_dict):
152154
latest_date = df.iloc[0, 0]
153155
latest_date = latest_date.replace("T", " ")
154156

155-
print(f"dataframe outputting")
157+
print("dataframe outputting")
156158
print(f"Time Found: {latest_date}")
157159

158160
return latest_date
@@ -203,20 +205,16 @@ def authenticate_icaseworks(api_key, secret):
203205
signature=signature,
204206
headers=headers,
205207
)
206-
print(response)
207208

208209
# Get token
209210
auth_token = response.json().get("access_token")
210-
print(f"auth token: {auth_token}")
211211

212212
# Create auth header for API Calls and auth payload
213213

214214
authorization = f"Bearer {auth_token}"
215-
print(authorization)
216215

217216
auth_payload = []
218217

219-
# Note: I don't know how to generate the below cookie. That is extracted using postman. Not sure how to recreate this at all
220218
auth_headers = {"Authorization": authorization}
221219
print(f"")
222220
return auth_payload, auth_headers
@@ -230,7 +228,6 @@ def get_data(table_dict, date_to_call, auth_headers, auth_payload):
230228
case_id_list = get_report_fromtime(
231229
case_id_report_id, date_to_call, auth_headers, auth_payload
232230
)
233-
# print(f'Type of case_id_list {type(case_id_list)}')
234231

235232
dict_to_call["DF"] = (
236233
case_id_list # This will append the response to the DF column in the dictionary

0 commit comments

Comments
 (0)