fix blank lines at end of csv

This commit is contained in:
Kenneth Kehl
2025-04-04 09:13:46 -07:00
parent 82934daa02
commit 0bdf0cb073

View File

@@ -29,6 +29,10 @@ def get_csv_upload(service_id, upload_id):
def s3upload(service_id, filedata):
# sometimes people upload files with hundreds of blank lines at the end
data = filedata["data"]
cleaned_data = "\n".join(line for line in data.splitlines() if line.strip())
filedata["data"] = cleaned_data
upload_id = str(uuid.uuid4())
bucket_name, file_location, access_key, secret_key, region = get_csv_location(