-
Notifications
You must be signed in to change notification settings - Fork 63
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
Feature/fix enrichment new catalogue #1083
Conversation
…oframes into feature/fix_enrichment_new_catalogue
…oframes into feature/fix_enrichment_new_catalogue
This reverts commit 8bb6da9.
…/fix_enrichment_new_catalogue
@alejandrohall there are some tests failing, could you take a look? |
@alrocar Done! |
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.
It looks perfect, but I would change dataset names used in tests using fake ones.
FROM `carto-do-customers.{user_dataset}\ | ||
.ags_demographics_crimerisk_usa_blockgroup_2015_yearly_2018` enrichment_table | ||
.view_ags_demographics_crimerisk_usa_blockgroup_2015_yearly_2018` enrichment_table |
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 think we are trying to avoid using real names
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.
We need real names because of functions are using the real catalog, so we need real examples of table names. Also, I cannot see any problems, because we are offering publicly this dataset through website and catalog
@@ -162,14 +170,6 @@ def __process_agg_operators(agg_operators, variables): | |||
return agg_operators_result |
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.
__process_agg_operators
method should also take into account what happens if this argument is a string, as we're doing in the enrich_polygons
method. If it's a string, it throws 'str' object has no attribute 'copy'
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.
Fixed!
I've added a couple of comments. Although I made some changes to make the |
variables_underscored='_'.join(variables), enrichment_table=table, | ||
enrichment_geo_table=table_to_geotable[table], user_dataset=user_dataset, | ||
working_project=working_project, data_table=data_table, | ||
'''.format(enrichment_id=enrichment_id, variables_underscored='_'.join(variables), |
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.
variables_underscored
is not being used
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.
Removed unused variable from format method!
Let's take into account this too https://github.com/CartoDB/data-observatory/issues/188#issuecomment-540737126, before merging the PR |
I discovered another error that is related with the If we convert the column type to |
I would add this fix (convert to float) in the lib. |
For some reason, after merging the enriched DataFrame in the main DataFrame the pandas method Fortunately, there is a solution. The fix consists of using a custom JSONEncoder for the |
…toDB/cartoframes into feature/fix_enrichment_new_catalogue
bd9d001
to
3155cf8
Compare
def encode_geodataframe(data): | ||
filtered_geometries = _filter_null_geometries(data) | ||
data = _set_time_cols_epoc(filtered_geometries).to_json() | ||
data = _set_time_cols_epoc(filtered_geometries).to_json(cls=CustomJSONEncoder) |
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.
Nice 👍
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 🚀
No description provided.