-
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
Add cartodbfy step for create_table_from_query and copy_table functions #1744
Add cartodbfy step for create_table_from_query and copy_table functions #1744
Conversation
This pull request has been linked to Clubhouse Story #175987: [economicalinsurance] CARTOframes datasets generated from query are not CartoDBfyed. |
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 this logic can be moved to context_manager.create_table_from_query
with a parameter cartodbfy=True
like in the context_manager.copy_*
functions. It would be nice to add tests for the affected functions.
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.
Note: we should add some tests for create_table_from_query
. It's good to have tests to check the default values, in the case cartodbfy=True
@Jesus89 I've just added a test to verify the cartodbfication step is executed when calling the ContextManager's |
I would add also tests without the cartodbfy parameter, to check that the default value is properly set in all the functions |
Thank you @Jesus89 (sorry I had misread it at first!) added tests to verify that the input default cartodbfy parameter is True in |
Context
After this PR, the cartodbfication step for
to_carto
was removed from the ContextManager's_drop_create_table_from_query
method to be performed later on this function instead.However, this has introduced a bug, causing that both
create_table_from_query
andcopy_table
functions (which relied on this step for cartodbfying tables) result in non-cartodbfied tables.Further context can be found here: https://app.clubhouse.io/cartoteam/story/175987/economicalinsurance-cartoframes-datasets-generated-from-query-are-not-cartodbfyed
Relevant PR changes
cartoframes/io/managers/context_manager.py
Add cartodbfy parameter with default valueTrue
forcreate_table_from_query
method to perform the table cartodbficationcartoframes/io/carto.py
Add cartodbfy parameter forcreate_table_from_query
andcopy_table
functions and pass it to ContextManager'screate_table_from_query
methodtests/unit/io/managers/test_context_manager.py
Add test to verify that the cartodbfication step is executed viaexecute_long_running_query
methodtests/unit/io/test_carto.py
Add tests to verify that the cartodbfy parameter is passed as expected to ContextManager'screate_table_from_query
method