code review feedback

This commit is contained in:
Kenneth Kehl
2024-09-30 09:08:18 -07:00
parent f844da8c68
commit 544e7e61e4

View File

@@ -164,20 +164,13 @@ def read_s3_file(bucket_name, object_key, s3res):
.read() .read()
.decode("utf-8") .decode("utf-8")
) )
# TODO we probably don't need this phone number check anymore. set_job_cache(job_cache, job_id, object)
# Originally, there were csv uploads that were not valid set_job_cache(job_cache, f"{job_id}_phones", extract_phones(object))
# for messaging sending. They may have been experimental, or set_job_cache(
# they may have not been caught by validation. When we're sure job_cache,
# all csv files have a phone number column, we can remove the if. f"{job_id}_personalisation",
# We are essentially just making sure this object looks like a job. extract_personalisation(object),
if "phone number" in object.lower(): )
set_job_cache(job_cache, job_id, object)
set_job_cache(job_cache, f"{job_id}_phones", extract_phones(object))
set_job_cache(
job_cache,
f"{job_id}_personalisation",
extract_personalisation(object),
)
except LookupError: except LookupError:
# perhaps our key is not formatted as we expected. If so skip it. # perhaps our key is not formatted as we expected. If so skip it.