-
Notifications
You must be signed in to change notification settings - Fork 11
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
Interpolate DA from CD in Canada #528
Conversation
tasks/ca/statcan/data.py
Outdated
if colname != 'geo_code': | ||
in_colnames.append('({colname} * (ST_Area(da.the_geom)/ST_Area(cd.the_geom))) {colname}'.format(colname=colname)) | ||
|
||
insert_query = ''' |
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.
multiple spaces after operator
tasks/ca/statcan/data.py
Outdated
in_colnames = ['da.geom_id'] | ||
for colname in out_colnames: | ||
if colname != 'geo_code': | ||
in_colnames.append('({colname} * (ST_Area(da.the_geom)/ST_Area(cd.the_geom))) {colname}'.format(colname=colname)) |
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.
line too long (129 > 120 characters)
tasks/ca/statcan/data.py
Outdated
@@ -1,5 +1,6 @@ | |||
import os | |||
import urllib.request | |||
import time |
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.
'time' imported but unused
if colname != 'geo_code': | ||
# We reduce the number of decimals to reduce the size of the row to avoid hit | ||
# the limit which is 8Kb. More info https://github.com/CartoDB/bigmetadata/issues/527 | ||
in_colnames.append('round(cast(float8 ({colname} * (ST_Area(da.the_geom)/ST_Area(cd.the_geom))) as numeric), 2) {colname}'.format(colname=colname)) |
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.
line too long (163 > 120 characters)
if colname != 'geo_code': | ||
# We reduce the number of decimals to reduce the size of the row to avoid hit | ||
# the limit which is 8Kb. More info https://github.com/CartoDB/bigmetadata/issues/527 | ||
in_colnames.append('round(cast(float8 ({colname} * (ST_Area(da.the_geom)/ST_Area(cd.the_geom))) as numeric), 2) {colname}'.format(colname=colname)) |
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.
line too long (163 > 120 characters)
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.
LGTM
Taking into account the unsolved bug in #527this works for the99%100% of the tables