Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the nmdb CSV export by calling getvalue() #6064

Merged
merged 2 commits into from
Oct 7, 2020
Merged

Conversation

higs4281
Copy link
Member

@higs4281 higs4281 commented Oct 2, 2020

Not sure why this cropped up now, but along the way we lost the ability
to feed a file object to boto3 for uploading to S3. Boto creates a
hash of the content and expects bytes in making the hash, and
our previous routine delivered unicode.

The solution is to pass the bytes instead of the file object to boto,
by calling getvalue() on the file object.

Testing

I ran the zusa prep job cf.gov-nmdb-data-prep against this branch, and it succeeded. The charts on DEV5 and CSV downloads on S3 look good.

@higs4281 higs4281 requested a review from schbetsy October 2, 2020 19:41
Not sure why this cropped up now, but along the way we lost the ability
to feed a bare file object to boto3 for uploading to S3. Boto creates and
md5 hash of the content and expects bytes in making the hash, and
our previous code delivered unicode.

The solution is to pass the bytes instead of the file object to boto,
by calling `getvalue()` on the file object.
@higs4281 higs4281 requested a review from a team October 5, 2020 12:20
@higs4281 higs4281 merged commit 83315fc into main Oct 7, 2020
@higs4281 higs4281 deleted the fix-nmdb-csv-export branch October 7, 2020 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants