-
Notifications
You must be signed in to change notification settings - Fork 4
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
Cache GIDD exports using S3 #628
base: develop
Are you sure you want to change the base?
Conversation
🔍 Existing Issues For ReviewYour pull request is modifying functions with the following pre-existing issues: 📄 File: apps/gidd/views.py
Did you find this useful? React with a 👍 or 👎 |
c1a3ef9
to
b332143
Compare
DISAGGREGATION_EXPORT = 'disaggregation-export' | ||
DISAGGREGATION_EXPORT_GEOJSON = 'disaggregation-export-geojson' | ||
DISASTER_EXPORT = 'disaster-export' | ||
DISPLACEMENT_EXPORT = 'displacement-export' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also saw conflict-export in the gidd export.
We need to see if we also add them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conflict-export is generated using filter by another export.
apps/gidd/cache.py
Outdated
return ( | ||
re.sub( | ||
' +', | ||
' ', | ||
(StatusLog.last_release_date() or '').replace(',', ' ') | ||
) | ||
).replace(',', ' ').strip().replace(' ', '-') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we converting datetime to date?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
GiddExportCache.Key.DISAGGREGATION_EXPORT_GEOJSON, | ||
lambda: self._export_disaggregated_geojson(filename, qs), | ||
s3_parameters={ | ||
'ResponseContentDisposition': f'attachment; filename={filename}.geojson', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need the response content type here? or is json default content type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
NOTE: This is automatically handed by S3 as well
Addresses
Changes
This PR doesn't introduce any:
print
This PR contains valid: