From bada5fa6eb6e375410f13bb95c1f7ee0c5fbf3f0 Mon Sep 17 00:00:00 2001 From: Alexandre Bourret Date: Wed, 13 Dec 2023 14:18:35 +0100 Subject: [PATCH 1/4] Fix failing recipe fails in 'Add an error column' mode [sc-163656] --- python-lib/rest_api_recipe_session.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python-lib/rest_api_recipe_session.py b/python-lib/rest_api_recipe_session.py index 929928a..811aaa3 100644 --- a/python-lib/rest_api_recipe_session.py +++ b/python-lib/rest_api_recipe_session.py @@ -78,8 +78,10 @@ def retrieve_next_page(self, is_raw_output): logger.info("retrieve_next_page: Calling next page") json_response = self.client.paginated_api_call(can_raise_exeption=self.can_raise) default_dict = { - DKUConstants.REPONSE_ERROR_KEY: json_response.get(DKUConstants.REPONSE_ERROR_KEY, None) + DKUConstants.REPONSE_ERROR_KEY: "" } if self.behaviour_when_error == "keep-error-column" else {} + if isinstance(json_response, dict) and DKUConstants.REPONSE_ERROR_KEY in default_dict: + default_dict[DKUConstants.REPONSE_ERROR_KEY] = json_response.get(DKUConstants.REPONSE_ERROR_KEY, None) metadata = self.client.get_metadata() if self.display_metadata else default_dict is_api_returning_dict = True if self.extraction_key: From 81b8576da8f45b624ba930bce2ba4147ce07032e Mon Sep 17 00:00:00 2001 From: Alexandre Bourret Date: Wed, 13 Dec 2023 14:18:53 +0100 Subject: [PATCH 2/4] Update changelog --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bd4c50..5217bdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [Version 1.2.1](https://github.com/dataiku/dss-plugin-api-connect/releases/tag/v1.2.1) - Bugfix release - 2023-12-13 + +- Fix the `Add an error column` error behaviour on the recipe +- Code-env descriptor for DSS 12 + +## [Version 1.1.5](https://github.com/dataiku/dss-plugin-api-connect/releases/tag/v1.1.5) - Bugfix release - 2023-12-13 + +- Fix the `Add an error column` error behaviour on the recipe +- Code-env descriptor for DSS 11 + ## [Version 1.2.0](https://github.com/dataiku/dss-plugin-api-connect/releases/tag/v1.2.0) - Feature and bugfix release - 2023-05-31 - Add Brotli compression From e860fb23e71a527f38cb30b210a0dce9a4277a81 Mon Sep 17 00:00:00 2001 From: Alexandre Bourret Date: Wed, 13 Dec 2023 14:19:21 +0100 Subject: [PATCH 3/4] v1.2.1 --- plugin.json | 2 +- python-lib/dku_constants.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.json b/plugin.json index 7a77754..16b241b 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { "id": "api-connect", - "version": "1.2.0", + "version": "1.2.1", "meta": { "label": "API Connect", "description": "Retrieve data from any REST API", diff --git a/python-lib/dku_constants.py b/python-lib/dku_constants.py index bec81b3..6b48052 100644 --- a/python-lib/dku_constants.py +++ b/python-lib/dku_constants.py @@ -2,6 +2,6 @@ class DKUConstants(object): API_RESPONSE_KEY = "api_response" FORBIDDEN_KEYS = ["token", "password", "api_key_value"] FORM_DATA_BODY_FORMAT = "FORM_DATA" - PLUGIN_VERSION = "1.2.0" + PLUGIN_VERSION = "1.2.1" RAW_BODY_FORMAT = "RAW" REPONSE_ERROR_KEY = "dku_error" From 6bcb5ae3b2a75751894dd229be713e1012246903 Mon Sep 17 00:00:00 2001 From: Alexandre Bourret Date: Wed, 13 Dec 2023 14:45:54 +0100 Subject: [PATCH 4/4] Add integration test --- tests/python/integration/test_scenario.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/python/integration/test_scenario.py b/tests/python/integration/test_scenario.py index 4f39521..f254dc6 100644 --- a/tests/python/integration/test_scenario.py +++ b/tests/python/integration/test_scenario.py @@ -45,3 +45,7 @@ def test_run_api_connect_relative_url_pagination(user_dss_clients): def test_run_api_connect_check_sc_110446(user_dss_clients): dss_scenario.run(user_dss_clients, project_key=TEST_PROJECT_KEY, scenario_id="CHECKSC110446") + + +def test_run_api_connect_check_sc_163656_error_column_always_in_schema(user_dss_clients): + dss_scenario.run(user_dss_clients, project_key=TEST_PROJECT_KEY, scenario_id="SC163656")