From 06f47c53e7f96b959c77d51614e7c656bba4762a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Fri, 26 Mar 2021 15:33:10 +0100 Subject: [PATCH 1/6] Rename extras_require setup param --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index df3ec0209..fcf6f5bd7 100644 --- a/setup.py +++ b/setup.py @@ -95,7 +95,7 @@ def get_version(): include_package_data=True, install_requires=REQUIRES, - extras_requires={ + extras_require={ 'tests': EXTRAS_REQUIRES_TESTS }, python_requires='>=3.5' From 1fbad8406b864ea6b1b6b040af2c6fe622e6e129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Fri, 26 Mar 2021 15:36:46 +0100 Subject: [PATCH 2/6] Bump dev version --- cartoframes/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cartoframes/_version.py b/cartoframes/_version.py index 58d478ab1..f231a4ac9 100644 --- a/cartoframes/_version.py +++ b/cartoframes/_version.py @@ -1 +1 @@ -__version__ = '1.2.0' +__version__ = '1.2.1.dev' From 929f801555605681de94cb0f2eccdf98d28c251a Mon Sep 17 00:00:00 2001 From: Mmoncadaisla Date: Wed, 7 Apr 2021 18:19:08 +0200 Subject: [PATCH 3/6] Use SQL API standard endpoint in _create_table_from_columns --- cartoframes/io/managers/context_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cartoframes/io/managers/context_manager.py b/cartoframes/io/managers/context_manager.py index 7343f03ed..cbadff356 100644 --- a/cartoframes/io/managers/context_manager.py +++ b/cartoframes/io/managers/context_manager.py @@ -283,7 +283,7 @@ def _create_table_from_columns(self, table_name, schema, columns, cartodbfy): query = 'BEGIN; {create}; {cartodbfy}; COMMIT;'.format( create=_create_table_from_columns_query(table_name, columns), cartodbfy=_cartodbfy_query(table_name, schema) if cartodbfy else '') - self.execute_long_running_query(query) + self.execute_query(query) def _truncate_table(self, table_name, schema, cartodbfy): log.debug('TRUNCATE table "{}"'.format(table_name)) From 48307c58d9c182091062bbdc1dadb416819ac3d4 Mon Sep 17 00:00:00 2001 From: Mmoncadaisla Date: Wed, 7 Apr 2021 18:24:13 +0200 Subject: [PATCH 4/6] Check that execute_query is ran in test instead of execute_long_running_query --- tests/unit/io/managers/test_context_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/io/managers/test_context_manager.py b/tests/unit/io/managers/test_context_manager.py index a8fdb2262..2b7e12f9d 100644 --- a/tests/unit/io/managers/test_context_manager.py +++ b/tests/unit/io/managers/test_context_manager.py @@ -62,7 +62,7 @@ def test_copy_from(self, mocker): mocker.patch('cartoframes.io.managers.context_manager._create_auth_client') mocker.patch.object(ContextManager, 'has_table', return_value=False) mocker.patch.object(ContextManager, 'get_schema', return_value='schema') - mock_create_table = mocker.patch.object(ContextManager, 'execute_long_running_query') + mock_create_table = mocker.patch.object(ContextManager, 'execute_query') mock = mocker.patch.object(ContextManager, '_copy_from') df = DataFrame({'A': [1]}) columns = [ColumnInfo('A', 'a', 'bigint', False)] From a0bd8e50c27799ca89eb8c9280bd05a76a640544 Mon Sep 17 00:00:00 2001 From: Mmoncadaisla Date: Tue, 13 Apr 2021 14:12:27 +0200 Subject: [PATCH 5/6] Avoid Batch API when the table structure does not change --- cartoframes/io/managers/context_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cartoframes/io/managers/context_manager.py b/cartoframes/io/managers/context_manager.py index cbadff356..4565f1c82 100644 --- a/cartoframes/io/managers/context_manager.py +++ b/cartoframes/io/managers/context_manager.py @@ -290,7 +290,7 @@ def _truncate_table(self, table_name, schema, cartodbfy): query = 'BEGIN; {truncate}; {cartodbfy}; COMMIT;'.format( truncate=_truncate_table_query(table_name), cartodbfy=_cartodbfy_query(table_name, schema) if cartodbfy else '') - self.execute_long_running_query(query) + self.execute_query(query) def _truncate_and_drop_add_columns(self, table_name, schema, df_columns, table_columns, cartodbfy): log.debug('TRUNCATE AND DROP + ADD columns table "{}"'.format(table_name)) From 01891524a0bbf32ca3c44d5e361398822b7eaa73 Mon Sep 17 00:00:00 2001 From: Mmoncadaisla Date: Wed, 28 Apr 2021 17:20:17 +0200 Subject: [PATCH 6/6] Release cartoframes v1.2.1 --- CHANGELOG.md | 6 ++++++ README.rst | 8 ++++---- cartoframes/_version.py | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 311998e84..1003adacb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.2.1] - 2021-04-28 + +### Changed + +- Avoid batch api to carto create table (#1731) + ## [1.2.0] - 2021-03-26 ### Changed diff --git a/README.rst b/README.rst index 81772b238..301ac326a 100644 --- a/README.rst +++ b/README.rst @@ -4,8 +4,8 @@ CARTOframes .. image:: https://travis-ci.org/CartoDB/cartoframes.svg?branch=develop :target: https://travis-ci.org/CartoDB/cartoframes -.. image:: https://img.shields.io/badge/pypi-v1.2.0-orange - :target: https://pypi.org/project/cartoframes/1.2.0 +.. image:: https://img.shields.io/badge/pypi-v1.2.1-orange + :target: https://pypi.org/project/cartoframes/1.2.1 A Python package for integrating `CARTO `__ maps, analysis, and data services into data science workflows. @@ -14,11 +14,11 @@ Python data analysis workflows often rely on the de facto standards `pandas