Closed Mmoncadaisla closed 3 years ago
This pull request has been linked to Clubhouse Story #175987: [economicalinsurance] CARTOframes datasets generated from query are not CartoDBfyed.
@Jesus89 I've just added a test to verify the cartodbfication step is executed when calling the ContextManager's create_table_from_query
method, please let me know if you think it's ok and/or if there is any other additional test we should add as part of this PR 🙏🏼
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 copy_table
, create_table_from_query
and ContextManager's create_table_from_query
🙂
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